reflow: Fix infinite loop on some input with many consecutive spaces

Avoid triggering auto-indentation with consecutive whitespaces when
reflowing, as it can lead to infinite loop if auto-indent leads to
inserting full lines.

Fixes #848.
This commit is contained in:
Colomban Wendling 2016-01-04 21:58:42 +01:00
parent d1fcd9f226
commit 46ed77bf19

View File

@ -2247,9 +2247,7 @@ static gint split_line(GeanyEditor *editor, gint column)
if (!found)
break;
sci_set_current_position(sci, pos + 1, FALSE);
sci_cancel(sci); /* don't select from completion list */
sci_send_command(sci, SCI_NEWLINE);
sci_insert_text(sci, pos + 1, editor_get_eol_char(editor));
line++;
}
return line - start_line;