diff options
author | nyamatongwe <unknown> | 2000-10-06 05:22:31 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-10-06 05:22:31 +0000 |
commit | 9c425e1893829eaf95842c68a78348cabda790f0 (patch) | |
tree | cc7188805a9579ed3186aae7bb28ccd2357b5b89 /src | |
parent | 103d8f1e3babef4bc69d9aee26e6ba97808ba970 (diff) | |
download | scintilla-mirror-9c425e1893829eaf95842c68a78348cabda790f0.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()); } } |