From 152aff4c7e26c4eccf0168ae401dbcd13b54c796 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 13 Sep 2017 11:31:58 +0200 Subject: We don't want persistentSelection and centralize the setCursorPosition hack Which breaks mouse selection btw. --- framework/qml/TextEditor.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'framework/qml') diff --git a/framework/qml/TextEditor.qml b/framework/qml/TextEditor.qml index 8a298989..724ee03f 100644 --- a/framework/qml/TextEditor.qml +++ b/framework/qml/TextEditor.qml @@ -42,11 +42,16 @@ FocusScope { Kube.DocumentHandler { id: document document: edit.textDocument - cursorPosition: edit.cursorPosition selectionStart: edit.selectionStart selectionEnd: edit.selectionEnd //textColor: colorDialog.color onTextChanged: root.htmlEnabled ? root.text = htmlText : root.text = plainText + + cursorPosition: edit.cursorPosition + onCursorPositionChanged: { + //Only necessary to skip over invisible char + edit.cursorPosition = cursorPosition + } } Kube.ScrollHelper { @@ -62,10 +67,8 @@ FocusScope { focus: true anchors.fill: parent selectByMouse: true - persistentSelection: true wrapMode: TextEdit.Wrap textFormat: Qt.RichText - cursorPosition: document.cursorPosition } TextArea.flickable: edit } -- cgit v1.2.3