From 52a5cfdb30c6cdf5f9628b26fda3168e982b4bc4 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Tue, 23 Jul 2024 12:47:33 +0200 Subject: [PATCH] QmlDesigner: Fix NavigatorView context help Remove line increment in jumpToModelNode code as it erroneously puts the cursor in the text editor to the next line of a selected item. As the NavigatorView and others currently using the context help function of the text editor, which internally depends on the cursor position, and hence on the assumption that when selecting an item via any view the cursor is placed on the item an not inside the item, pushing the cursor down by one line breaks that assumption. As a result the context help searches for nothing or a property (e.g. id) and not the selected node. Task-number: QDS-13252 Change-Id: I00810a0ff8ddd49177ebf18e3eea7b6b05cc0af3 Reviewed-by: Tim Jenssen --- .../qmldesigner/components/texteditor/texteditorwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp index 127780f9181..e70ddb68d84 100644 --- a/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp +++ b/src/plugins/qmldesigner/components/texteditor/texteditorwidget.cpp @@ -115,7 +115,7 @@ void TextEditorWidget::jumpToModelNode(const ModelNode &modelNode) if (nodeOffset > 0) { int line, column; m_textEditor->editorWidget()->convertPosition(nodeOffset, &line, &column); - m_textEditor->editorWidget()->gotoLine(line + 1, column); + m_textEditor->editorWidget()->gotoLine(line, column); highlightToModelNode(modelNode); }