summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/documenthandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/domain/documenthandler.cpp')
-rw-r--r--framework/src/domain/documenthandler.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/framework/src/domain/documenthandler.cpp b/framework/src/domain/documenthandler.cpp
index 266f4a27..0f949da8 100644
--- a/framework/src/domain/documenthandler.cpp
+++ b/framework/src/domain/documenthandler.cpp
@@ -94,16 +94,20 @@ void DocumentHandler::setCursorPosition(int position)
94 //Skip over invisible char 94 //Skip over invisible char
95 if (m_cursorPosition < position) { 95 if (m_cursorPosition < position) {
96 auto cursor = textCursor(); 96 auto cursor = textCursor();
97 cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); 97 if (!cursor.atEnd()) {
98 if (cursor.selectedText() == "\u2063") { 98 cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
99 position++; 99 if (cursor.selectedText() == "\u2063") {
100 position++;
101 }
100 } 102 }
101 } 103 }
102 if (m_cursorPosition > position) { 104 if (m_cursorPosition > position) {
103 auto cursor = textCursor(); 105 auto cursor = textCursor();
104 cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor); 106 if (!cursor.atStart()) {
105 if (cursor.selectedText() == "\u2063") { 107 cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
106 position--; 108 if (cursor.selectedText() == "\u2063") {
109 position--;
110 }
107 } 111 }
108 } 112 }
109 m_cursorPosition = position; 113 m_cursorPosition = position;