forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Leandro Melo
parent
71730cf798
commit
02eaf147da
@@ -95,10 +95,8 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end,
|
|||||||
selection.m_cursor_end = QTextCursor(document->docHandle(), end);
|
selection.m_cursor_end = QTextCursor(document->docHandle(), end);
|
||||||
|
|
||||||
if (overlaySelectionFlags & ExpandBegin) {
|
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)
|
if (overlaySelectionFlags & LockSize)
|
||||||
selection.m_fixedLength = (end - begin);
|
selection.m_fixedLength = (end - begin);
|
||||||
|
Reference in New Issue
Block a user