diff options
author | nyamatongwe <unknown> | 2002-11-21 12:35:51 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2002-11-21 12:35:51 +0000 |
commit | 80a672aa76c64c58f5a7571879b83e1e44cd2db6 (patch) | |
tree | f3b69c94fcefff4ff2b0828a740940b9d0b96fb6 /src | |
parent | 882b4355011c56f17284981bab13ed74ed395284 (diff) | |
download | scintilla-mirror-80a672aa76c64c58f5a7571879b83e1e44cd2db6.tar.gz |
Patch from Biswa to add icons to autocompletion lists.
Diffstat (limited to 'src')
-rw-r--r-- | src/AutoComplete.h | 5 | ||||
-rw-r--r-- | src/PropSet.cxx | 24 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 4 |
3 files changed, 21 insertions, 12 deletions
diff --git a/src/AutoComplete.h b/src/AutoComplete.h index 622a5666e..7983e3611 100644 --- a/src/AutoComplete.h +++ b/src/AutoComplete.h @@ -15,6 +15,7 @@ class AutoComplete { char stopChars[256]; char fillUpChars[256]; char separator; + char typesep; // Type seperator public: bool ignoreCase; @@ -48,6 +49,10 @@ public: void SetSeparator(char separator_); char GetSeparator(); + /// The typesep character is used for seperating the word from the type + void SetTypesep(char separator_); + char GetTypesep(); + /// The list string contains a sequence of words separated by the separator character void SetList(const char *list); diff --git a/src/PropSet.cxx b/src/PropSet.cxx index b527c385c..60d53088f 100644 --- a/src/PropSet.cxx +++ b/src/PropSet.cxx @@ -98,13 +98,13 @@ void PropSet::Set(const char *key, const char *val, int lenKey, int lenVal) { lenVal = static_cast<int>(strlen(val)); unsigned int hash = HashString(key, lenKey); for (Property *p = props[hash % hashRoots]; p; p = p->next) { - if ((hash == p->hash) && - ((strlen(p->key) == static_cast<unsigned int>(lenKey)) && + if ((hash == p->hash) && + ((strlen(p->key) == static_cast<unsigned int>(lenKey)) && (0 == strncmp(p->key, key, lenKey)))) { // Replace current value delete [](p->val); p->val = StringDup(val, lenVal); - return ; + return; } } // Not found @@ -257,7 +257,7 @@ SString PropSet::GetWild(const char *keybase, const char *filename) { if (keyfile == NULL) keyfile = orgkeyfile; - for (; ; ) { + for (;;) { char *del = strchr(keyfile, ';'); if (del == NULL) del = keyfile + strlen(keyfile); @@ -328,9 +328,9 @@ void PropSet::Clear() { while (p) { Property *pNext = p->next; p->hash = 0; - delete p->key; + delete []p->key; p->key = 0; - delete p->val; + delete []p->val; p->val = 0; delete p; p = pNext; @@ -669,13 +669,13 @@ char *WordList::GetNearestWords( if (!cond) { // Find first match while ((pivot > start) && - (0 == CompareNCaseInsensitive(wordStart, + (0 == CompareNCaseInsensitive(wordStart, wordsNoCase[pivot-1], searchLen))) { --pivot; } // Grab each match while ((pivot <= end) && - (0 == CompareNCaseInsensitive(wordStart, + (0 == CompareNCaseInsensitive(wordStart, wordsNoCase[pivot], searchLen))) { wordlen = LengthWord(wordsNoCase[pivot], otherSeparator) + 1; wordsNear.append(wordsNoCase[pivot], wordlen, ' '); @@ -695,14 +695,14 @@ char *WordList::GetNearestWords( if (!cond) { // Find first match while ((pivot > start) && - (0 == strncmp(wordStart, - words[pivot-1], searchLen))) { + (0 == strncmp(wordStart, + words[pivot-1], searchLen))) { --pivot; } // Grab each match while ((pivot <= end) && - (0 == strncmp(wordStart, - words[pivot], searchLen))) { + (0 == strncmp(wordStart, + words[pivot], searchLen))) { wordlen = LengthWord(words[pivot], otherSeparator) + 1; wordsNear.append(words[pivot], wordlen, ' '); ++pivot; diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index ab6e9a19b..1c44b0bd6 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -509,6 +509,10 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara case SCI_AUTOCGETDROPRESTOFWORD: return ac.dropRestOfWord; + case SCI_REGISTERIMAGE: + ac.lb.SetTypeXpm(wParam, reinterpret_cast<const char **>(lParam)); + break; + case SCI_CALLTIPSHOW: { AutoCompleteCancel(); if (!ct.wCallTip.Created()) { |