diff options
-rw-r--r-- | doc/ScintillaDoc.html | 8 | ||||
-rw-r--r-- | include/Scintilla.h | 3 | ||||
-rw-r--r-- | src/AutoComplete.cxx | 11 | ||||
-rw-r--r-- | src/AutoComplete.h | 7 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 11 |
5 files changed, 37 insertions, 3 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 6678f3aac..c2ce990df 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -538,12 +538,18 @@ SCI_AUTOCACTIVE SCI_AUTOCPOSSTART SCI_AUTOCCOMPLETE SCI_AUTOCSTOPS(<unused>,char *chars) +SCI_AUTOCSETSEPARATOR(char separator) +SCI_AUTOCGETSEPARATOR +SCI_AUTOCSELECT(<unused>,char *stringtoselect) </pre> <p> Auto completion displays a list box based upon the users typing showing likely identifiers. The SCI_AUTOCSHOW message causes this list to be displayed, with its argument being a list of - words separated by space characters. SCI_AUTOCPOSSTART returns the value of the current + words separated by separator characters. The initial separator character is a space but this can + be set or got with SCI_AUTOCSETSEPARATOR and SCI_AUTOCGETSEPARATOR. + SCI_AUTOCPOSSTART returns the value of the current position when SCI_AUTOCSHOW started display of the list. + An entry can be selected SCI_AUTOCSELECT. </p> <p> The current selection can be triggered with the SCI_AUTOCCOMPLETE message. This has the same diff --git a/include/Scintilla.h b/include/Scintilla.h index 58fc6777b..e86dec35e 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -216,6 +216,9 @@ extern "C" { #define SCI_AUTOCPOSSTART SCI_START + 103 #define SCI_AUTOCCOMPLETE SCI_START + 104 #define SCI_AUTOCSTOPS SCI_START + 105 +#define SCI_AUTOCSETSEPARATOR SCI_START + 106 +#define SCI_AUTOCGETSEPARATOR SCI_START + 107 +#define SCI_AUTOCSELECT SCI_START + 108 #define SCI_GETTABWIDTH SCI_START + 121 #define SCI_SETINDENT SCI_START + 122 diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx index c3ec29c3c..75e26fe28 100644 --- a/src/AutoComplete.cxx +++ b/src/AutoComplete.cxx @@ -15,6 +15,7 @@ AutoComplete::AutoComplete() { active = false; posStart = 0; strcpy(stopChars, ""); + separator = ' '; } AutoComplete::~AutoComplete() { @@ -44,6 +45,14 @@ bool AutoComplete::IsStopChar(char ch) { return ch && strchr(stopChars, ch); } +void AutoComplete::SetSeparator(char separator_) { + separator = separator_; +} + +char AutoComplete::GetSeparator() { + return separator; +} + int AutoComplete::SetList(const char *list) { int maxStrLen = 12; lb.Clear(); @@ -53,7 +62,7 @@ int AutoComplete::SetList(const char *list) { char *startword = words; int i = 0; for (; words && words[i]; i++) { - if (words[i] == ' ') { + if (words[i] == separator) { words[i] = '\0'; lb.Append(startword); maxStrLen = Platform::Maximum(maxStrLen, strlen(startword)); diff --git a/src/AutoComplete.h b/src/AutoComplete.h index 10216027b..e4f8ade0d 100644 --- a/src/AutoComplete.h +++ b/src/AutoComplete.h @@ -9,6 +9,7 @@ class AutoComplete { bool active; char stopChars[256]; + char separator; public: ListBox lb; int posStart; @@ -27,7 +28,11 @@ public: void SetStopChars(const char *stopChars_); bool IsStopChar(char ch); - // The list string contains a sequence of words separated by spaces + // The separator character is used when interpreting the list in SetList + void SetSeparator(char separator_); + char GetSeparator(); + + // The list string contains a sequence of words separated by the separator character int SetList(const char *list); void Show(); diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 80ef3097b..972e4fbff 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -324,9 +324,20 @@ LRESULT ScintillaBase::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) { AutoCompleteCompleted(); break; + case SCI_AUTOCSETSEPARATOR: + ac.SetSeparator(wParam); + break; + + case SCI_AUTOCGETSEPARATOR: + return ac.GetSeparator(); + case SCI_AUTOCSTOPS: ac.SetStopChars(reinterpret_cast<char *>(lParam)); break; + + case SCI_AUTOCSELECT: + ac.Select(reinterpret_cast<char *>(lParam)); + break; case SCI_CALLTIPSHOW: { AutoCompleteCancel(); |