From c27477ed450161a1abd859c5256ff97de15b9e91 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 5 Jan 2016 18:24:37 +1100 Subject: Fix infinite loop with both wrap and idle styling to end turned on. --- src/Editor.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 29799534e..08248a3d9 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4886,17 +4886,13 @@ void Editor::Tick() { } bool Editor::Idle() { + bool needWrap = Wrapping() && wrapPending.NeedsWrap(); - bool idleDone; - - bool wrappingDone = !Wrapping(); - - if (!wrappingDone) { + if (needWrap) { // Wrap lines during idle. WrapLines(wsIdle); // No more wrapping - if (!wrapPending.NeedsWrap()) - wrappingDone = true; + needWrap = wrapPending.NeedsWrap(); } else if (needIdleStyling) { IdleStyling(); } @@ -4906,7 +4902,7 @@ bool Editor::Idle() { // false will stop calling this idle function until SetIdle() is // called again. - idleDone = wrappingDone && !needIdleStyling; // && thatDone && theOtherThingDone... + const bool idleDone = !needWrap && !needIdleStyling; // && thatDone && theOtherThingDone... return !idleDone; } -- cgit v1.2.3