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 {