Optimize setting image call in auto-completion
In PR #11088 the calling scinitilla is not optimized: SCI_REGISTERIMAGE & SCI_AUTOCSETTYPESEPARATOR need to be called only once.
This commit is contained in:
parent
c394a890aa
commit
6c345e907b
|
@ -117,9 +117,13 @@ bool AutoCompletion::showApiComplete()
|
|||
if (len >= _keyWordMaxLen)
|
||||
return false;
|
||||
|
||||
if (!_isFxImageRegistered)
|
||||
{
|
||||
_pEditView->execute(SCI_AUTOCSETTYPESEPARATOR, WPARAM('?'));
|
||||
_pEditView->execute(SCI_REGISTERIMAGE, FUNC_IMG_ID, LPARAM(xpmfn));
|
||||
_isFxImageRegistered = true;
|
||||
}
|
||||
_pEditView->execute(SCI_AUTOCSETSEPARATOR, WPARAM(' '));
|
||||
_pEditView->execute(SCI_AUTOCSETTYPESEPARATOR, WPARAM('?'));
|
||||
_pEditView->execute(SCI_REGISTERIMAGE, FUNC_IMG_ID, LPARAM(xpmfn));
|
||||
_pEditView->execute(SCI_AUTOCSETIGNORECASE, _ignoreCase);
|
||||
_pEditView->showAutoComletion(curPos - startPos, _keyWords.c_str());
|
||||
|
||||
|
@ -202,10 +206,13 @@ bool AutoCompletion::showApiAndWordComplete()
|
|||
}
|
||||
|
||||
// Make Scintilla show the autocompletion menu
|
||||
|
||||
if (!_isFxImageRegistered)
|
||||
{
|
||||
_pEditView->execute(SCI_AUTOCSETTYPESEPARATOR, WPARAM('?'));
|
||||
_pEditView->execute(SCI_REGISTERIMAGE, FUNC_IMG_ID, LPARAM(xpmfn));
|
||||
_isFxImageRegistered = true;
|
||||
}
|
||||
_pEditView->execute(SCI_AUTOCSETSEPARATOR, WPARAM(' '));
|
||||
_pEditView->execute(SCI_AUTOCSETTYPESEPARATOR, WPARAM('?'));
|
||||
_pEditView->execute(SCI_REGISTERIMAGE, FUNC_IMG_ID, LPARAM(xpmfn));
|
||||
_pEditView->execute(SCI_AUTOCSETIGNORECASE, _ignoreCase);
|
||||
_pEditView->showAutoComletion(curPos - startPos, words.c_str());
|
||||
return true;
|
||||
|
@ -464,8 +471,6 @@ bool AutoCompletion::showWordComplete(bool autoInsert)
|
|||
// Make Scintilla show the autocompletion menu
|
||||
|
||||
_pEditView->execute(SCI_AUTOCSETSEPARATOR, WPARAM(' '));
|
||||
_pEditView->execute(SCI_AUTOCSETTYPESEPARATOR, WPARAM('?'));
|
||||
_pEditView->execute(SCI_REGISTERIMAGE, FUNC_IMG_ID, LPARAM(xpmfn));
|
||||
_pEditView->execute(SCI_AUTOCSETIGNORECASE, _ignoreCase);
|
||||
_pEditView->showAutoComletion(curPos - startPos, words.c_str());
|
||||
return true;
|
||||
|
|
|
@ -79,6 +79,7 @@ private:
|
|||
LangType _curLang = L_TEXT;
|
||||
TiXmlDocument *_pXmlFile = nullptr;
|
||||
TiXmlElement *_pXmlKeyword = nullptr;
|
||||
bool _isFxImageRegistered = false;
|
||||
|
||||
InsertedMatchedChars _insertedMatchedChars;
|
||||
|
||||
|
|
Loading…
Reference in New Issue