diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2014-05-25 08:53:25 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2014-05-25 08:53:25 +1000 |
commit | 8eea3418fcb2e24f1e666b40b669029a4bcc4135 (patch) | |
tree | 0f2c89b6bf77a66cf45d09ec665b45bcea5b0867 /src | |
parent | 4e5903ca21ac15692c94be0167f18b994d3df2f9 (diff) | |
download | scintilla-mirror-8eea3418fcb2e24f1e666b40b669029a4bcc4135.tar.gz |
Handle cases where multiple selection autocompletion requires removing previous text.
From Mitchell Foral.
Diffstat (limited to 'src')
-rw-r--r-- | src/ScintillaBase.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 9430a54e0..d42dfc7ff 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -215,7 +215,8 @@ void ScintillaBase::AutoCompleteInsert(Position startPos, int removeLen, const c int positionInsert = sel.Range(r).Start().Position(); positionInsert = InsertSpace(positionInsert, sel.Range(r).caret.VirtualSpace()); if (positionInsert - removeLen >= 0) { - pdoc->DeleteChars(positionInsert - removeLen, removeLen); + positionInsert -= removeLen; + pdoc->DeleteChars(positionInsert, removeLen); } const int lengthInserted = pdoc->InsertString(positionInsert, text, textLen); if (lengthInserted > 0) { |