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 | 8b447b76bbc110e055a0637657f5f00c65cc98dd (patch) | |
tree | 3323e59c81a1d6ec2e5c12c56e57da4da74fd4e9 /src | |
parent | b0296d86a48642f2f381c3e0b11a022482ae25e3 (diff) | |
download | scintilla-mirror-8b447b76bbc110e055a0637657f5f00c65cc98dd.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) { |