Commit cae9e9de authored by Andy Vawer's avatar Andy Vawer
Browse files

Fix for Bugs Ticket #408: Edit magic char search for \n results in an...

Fix for Bugs Ticket #408: Edit magic char search for \n results in an invisible found selection.  Add check to selection content before removing caret.
parent 57282c86
......@@ -36,6 +36,17 @@
static txt owner = 0;
static BOOL txtscrap_selection_zerowidth(txt t, txt_index from, txt_index to)
{
/*Return TRUE if the selection is just newlines (ie zero-width), FALSE if any other chars*/
for ( ; from < to; from++)
if (txt_charat(t, from) != '\n') return FALSE;
return TRUE;
}
void txtscrap_setselect(txt t, txt_index from, txt_index to)
{
......@@ -57,7 +68,7 @@ else
if (owner != (txt) NULL && owner != t)
txt_setselect(owner, 0, 0);
txt_setselect(t, from, to);
txt_setcharoptions(t, txt_CARET, from==to ? txt_CARET : 0);
txt_setcharoptions(t, txt_CARET, from==to ? txt_CARET : txtscrap_selection_zerowidth(t, from, to) * txt_CARET);
owner = t;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment