From 46ed77bf195c6bc08601b0e5a2055de2fc4b9cff Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Mon, 4 Jan 2016 21:58:42 +0100 Subject: [PATCH] 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. --- src/keybindings.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/keybindings.c b/src/keybindings.c index 8913c572..e676855a 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -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;