From bc1b3df36204e68bb1076f34d33efdc5ebf65f6b Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 7 Apr 2003 08:14:32 +0000 Subject: Fix bug on GTK+ 2.x where synchronous repaint causes currentPos to be used before it is reset. --- src/Editor.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 36390b427..85cac79ea 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1410,7 +1410,7 @@ void Editor::LinesSplit(int pixelWidth) { unsigned int posLineStart = pdoc->LineStart(line); LayoutLine(line, surface, vs, ll, pixelWidth); for (int subLine = 1; subLine < ll->lines; subLine++) { - pdoc->InsertString(posLineStart + (subLine - 1) * strlen(eol) + + pdoc->InsertString(posLineStart + (subLine - 1) * strlen(eol) + ll->LineStart(subLine), eol); targetEnd += strlen(eol); } @@ -4857,6 +4857,13 @@ void Editor::SetDocPointer(Document *document) { pdoc = document; } pdoc->AddRef(); + + // Ensure all positions within document + currentPos = 0; + anchor = 0; + targetStart = 0; + targetEnd = 0; + // Reset the contraction state to fully shown. cs.Clear(); cs.InsertLines(0, pdoc->LinesTotal() - 1); -- cgit v1.2.3