From 02eaf147dad4808b2032f015f833bb0bd799a08b Mon Sep 17 00:00:00 2001 From: Bojan Petrovic <bojan85@gmail.com> Date: Mon, 11 Jun 2012 17:57:01 +0200 Subject: [PATCH] Text Editor: Fix handling of snippet parameter with no name Problem was that typing into overlay selection of the snippet parameter with no name ended the snippet editing. For example, "do {$$} while ($confition$);" was unusable. Change-Id: Ife0e68340de328a3492e242ce861f7c9dd225d7e Reviewed-by: Leandro Melo <leandro.melo@nokia.com> --- src/plugins/texteditor/texteditoroverlay.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index 8833dd4b329..1fce619e9ef 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -95,9 +95,7 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end, selection.m_cursor_end = QTextCursor(document->docHandle(), end); if (overlaySelectionFlags & ExpandBegin) { - if (begin > 0 && begin < end) { // not empty - selection.m_cursor_begin.setKeepPositionOnInsert(true); - } + selection.m_cursor_begin.setKeepPositionOnInsert(true); } if (overlaySelectionFlags & LockSize) -- GitLab