aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2012-04-16 09:05:21 +1000
committernyamatongwe <devnull@localhost>2012-04-16 09:05:21 +1000
commit817b02c3e3a6d82d6f19f77f15f795a072a82a4c (patch)
treef8bbcc7e265ba307903877ca063c5bee8220682d /src
parentdac7fe49689a2edbd42a9b5fed10a94ea05969fc (diff)
downloadscintilla-mirror-817b02c3e3a6d82d6f19f77f15f795a072a82a4c.tar.gz
Case-insensitive auto-completion selection. Bug #3516538.
From Markus Nißl.
Diffstat (limited to 'src')
-rw-r--r--src/AutoComplete.cxx7
-rw-r--r--src/AutoComplete.h1
-rw-r--r--src/ScintillaBase.cxx7
3 files changed, 13 insertions, 2 deletions
diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx
index 2752ef0c9..644f16517 100644
--- a/src/AutoComplete.cxx
+++ b/src/AutoComplete.cxx
@@ -14,6 +14,7 @@
#include "CharacterSet.h"
#include "AutoComplete.h"
+#include "Scintilla.h"
#ifdef SCI_NAMESPACE
using namespace Scintilla;
@@ -30,7 +31,8 @@ AutoComplete::AutoComplete() :
startLen(0),
cancelAtStartPos(true),
autoHide(true),
- dropRestOfWord(false) {
+ dropRestOfWord(false),
+ ignoreCaseBehaviour(SC_CASEINSENSITITIVEBEHAVIOUR_RESPECTCASE) {
lb = ListBox::Allocate();
stopChars[0] = '\0';
fillUpChars[0] = '\0';
@@ -153,7 +155,8 @@ void AutoComplete::Select(const char *word) {
--pivot;
}
location = pivot;
- if (ignoreCase) {
+ if (ignoreCase
+ && ignoreCaseBehaviour == SC_CASEINSENSITITIVEBEHAVIOUR_RESPECTCASE) {
// Check for exact-case match
for (; pivot <= end; pivot++) {
lb->GetValue(pivot, item, maxItemLen);
diff --git a/src/AutoComplete.h b/src/AutoComplete.h
index aefab120a..19a1271ac 100644
--- a/src/AutoComplete.h
+++ b/src/AutoComplete.h
@@ -31,6 +31,7 @@ public:
bool cancelAtStartPos;
bool autoHide;
bool dropRestOfWord;
+ unsigned int ignoreCaseBehaviour;
AutoComplete();
~AutoComplete();
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index f78d0fb96..9d4f93c3f 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -727,6 +727,13 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
case SCI_AUTOCGETIGNORECASE:
return ac.ignoreCase;
+ case SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR:
+ ac.ignoreCaseBehaviour = wParam;
+ break;
+
+ case SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR:
+ return ac.ignoreCaseBehaviour;
+
case SCI_USERLISTSHOW:
listType = wParam;
AutoCompleteStart(0, reinterpret_cast<const char *>(lParam));