aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-04-16 09:05:21 +1000
committernyamatongwe <unknown>2012-04-16 09:05:21 +1000
commitd5110563aee91348b5c60a13a0aaf2893d50d3ea (patch)
tree10490965d3b172a48843097840ab4712092c5cd2 /src
parent09b1f297feb98e85d7b01fbd7b39e4bfdd2516e0 (diff)
downloadscintilla-mirror-d5110563aee91348b5c60a13a0aaf2893d50d3ea.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));