From 5305dc49182acef1574427bb57ad24025967738d Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 14 Apr 2004 22:03:56 +0000 Subject: Patch from Trent Mick. Prevent autocompletion from deleting prefix when actioned with no choice selected. Cancel autocompletion when backspacing beyond the start position rather than to the start position. --- src/ScintillaBase.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index e42b5dc65..cc02674b3 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -297,7 +297,7 @@ void ScintillaBase::AutoCompleteCharacterAdded(char ch) { } void ScintillaBase::AutoCompleteCharacterDeleted() { - if (currentPos <= ac.posStart - ac.startLen) { + if (currentPos < ac.posStart - ac.startLen) { ac.Cancel(); } else if (ac.cancelAtStartPos && (currentPos <= ac.posStart)) { ac.Cancel(); @@ -314,6 +314,8 @@ void ScintillaBase::AutoCompleteCompleted() { ac.lb->GetValue(item, selected, sizeof(selected)); } ac.Cancel(); + if (item == -1) + return; if (listType > 0) { userListSelected = selected; -- cgit v1.2.3