From f2756c22868f53ea332fb6743fbe58c48d8b5c85 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Wed, 18 Jan 2017 17:57:41 -0500 Subject: [PATCH] Go to correct position after word completion Closes #2675, Closes #2802 --- PowerEditor/src/ScitillaComponent/AutoCompletion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp index 97036c37..84919e83 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp @@ -342,8 +342,8 @@ bool AutoCompletion::showWordComplete(bool autoInsert) if (wordArray.size() == 1 && autoInsert) { - _pEditView->replaceTargetRegExMode(wordArray[0].c_str(), startPos, curPos); - _pEditView->execute(SCI_GOTOPOS, startPos + wordArray[0].length()); + int replacedLength = _pEditView->replaceTargetRegExMode(wordArray[0].c_str(), startPos, curPos); + _pEditView->execute(SCI_GOTOPOS, startPos + replacedLength); return true; }