diff options
author | nyamatongwe <devnull@localhost> | 2000-10-06 05:22:31 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2000-10-06 05:22:31 +0000 |
commit | 5c41080720d60f7cb87b31e091d6e2ce33864431 (patch) | |
tree | cc7188805a9579ed3186aae7bb28ccd2357b5b89 /src | |
parent | e2b900a39b29d8281cf39bc8ede6b33577b86310 (diff) | |
download | scintilla-mirror-5c41080720d60f7cb87b31e091d6e2ce33864431.tar.gz |
patch from John Ehresman to autocompletion when cancelAtStartpos is false
and user backspaces into pre-existing text.
Diffstat (limited to 'src')
-rw-r--r-- | src/ScintillaBase.cxx | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 4f182850a..b812426c2 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -279,31 +279,19 @@ void ScintillaBase::AutoCompleteCompleted(char fillUp/*='\0'*/) { } ac.Cancel(); - if (ac.ignoreCase) { - if (currentPos != ac.posStart) { - pdoc->DeleteChars(ac.posStart, currentPos - ac.posStart); - } - SetEmptySelection(ac.posStart - ac.startLen); - pdoc->DeleteChars(ac.posStart - ac.startLen, ac.startLen); - if (item != -1) { - SString piece = selected; - if (fillUp) - piece += fillUp; - pdoc->InsertString(currentPos, piece.c_str()); - SetEmptySelection(currentPos + piece.length()); - } - } else { - if (currentPos != ac.posStart) { - pdoc->DeleteChars(ac.posStart, currentPos - ac.posStart); - } - SetEmptySelection(ac.posStart); - if (item != -1) { - SString piece = selected + ac.startLen; - if (fillUp) - piece += fillUp; - pdoc->InsertString(currentPos, piece.c_str()); - SetEmptySelection(currentPos + piece.length()); - } + Position firstPos = ac.posStart - ac.startLen; + if (currentPos < firstPos) + return; + if (currentPos != firstPos) { + pdoc->DeleteChars(firstPos, currentPos - firstPos); + } + SetEmptySelection(ac.posStart); + if (item != -1) { + SString piece = selected; + if (fillUp) + piece += fillUp; + pdoc->InsertString(firstPos, piece.c_str()); + SetEmptySelection(firstPos + piece.length()); } } |