From c608f5f369418ec7942f1e5cd1616116896ea3f7 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 1 Jul 2012 20:32:39 +1000 Subject: Fix hang when Zero Width Space U+200B occurs at start of document. --- src/Editor.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 07f7beb39..c1f30e124 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3228,7 +3228,7 @@ void Editor::DrawBlockCaret(Surface *surface, ViewStyle &vsDraw, LineLayout *ll, // glyph / combining character. If so we'll need to draw that too. int offsetFirstChar = offset; int offsetLastChar = offset + (posAfter - posCaret); - while ((offsetLastChar - numCharsToDraw) >= lineStart) { + while ((posBefore > 0) && ((offsetLastChar - numCharsToDraw) >= lineStart)) { if ((ll->positions[offsetLastChar] - ll->positions[offsetLastChar - numCharsToDraw]) > 0) { // The char does not share horizontal space break; -- cgit v1.2.3