From 3852bb7e5c982b91a0caadc5330758b31354fdef Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Mon, 18 Jan 2016 10:22:57 +0100 Subject: [PATCH] ui: Fixed error locations at line end span down to next line --- src/lib_gui/qt/element/QtCodeArea.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib_gui/qt/element/QtCodeArea.cpp b/src/lib_gui/qt/element/QtCodeArea.cpp index 8d959f36..e58b9cb4 100644 --- a/src/lib_gui/qt/element/QtCodeArea.cpp +++ b/src/lib_gui/qt/element/QtCodeArea.cpp @@ -734,7 +734,11 @@ std::vector QtCodeArea::getCursorRectsForAnnotation(const Annotation& ann { if (line == annotation.endLine) { - cursor.setPosition(annotation.end); + // Avoid that annotations at line end span down to first column of the next line. + if (annotation.startLine != annotation.endLine || document()->findBlockByLineNumber(line - m_startLineNumber).length() != annotation.endCol) + { + cursor.setPosition(annotation.end); + } } else {