From 986492e47b6a13a9b55f59e9327a880dc45574d3 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 18 Oct 2015 20:12:40 +0200 Subject: [PATCH] Fix Javascript autocompletion not working regression. --- .../src/ScitillaComponent/AutoCompletion.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp index 112002ca..ab37472a 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp @@ -669,19 +669,21 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m void AutoCompletion::update(int character) { + if (!character) + return; + const NppGUI & nppGUI = NppParameters::getInstance()->getNppGUI(); if (!_funcCompletionActive && nppGUI._autocStatus == nppGUI.autoc_func) return; - if (nppGUI._funcParams || _funcCalltip.isVisible()) { - if (_funcCalltip.updateCalltip(character)) { //calltip visible because triggered by autocomplete, set mode + if (nppGUI._funcParams || _funcCalltip.isVisible()) + { + if (_funcCalltip.updateCalltip(character)) //calltip visible because triggered by autocomplete, set mode + { return; //only return in case of success, else autocomplete } } - if (!character) - return; - //If autocomplete already active, let Scintilla handle it if (_pEditView->execute(SCI_AUTOCACTIVE) != 0) return; @@ -698,7 +700,6 @@ void AutoCompletion::update(int character) showApiComplete(); else if (nppGUI._autocStatus == nppGUI.autoc_both) showApiAndWordComplete(); - } } @@ -845,6 +846,9 @@ const TCHAR * AutoCompletion::getApiFileName() if (_curLang > L_EXTERNAL) _curLang = L_TEXT; + if (_curLang == L_JAVASCRIPT) + _curLang = L_JS; + return ScintillaEditView::langNames[_curLang].lexerName; }