Merge branch 'molsonkiko-fix_shortcut_mapper_scintilla_shortcut'

pull/14789/head
Don Ho 9 months ago
commit ee74fe5879

@ -222,6 +222,21 @@ bool ShortcutMapper::isFilterValid(PluginCmdShortcut sc)
return match;
}
bool ShortcutMapper::isFilterValid(ScintillaKeyMap sc)
{
// do a classic search on shortcut name,
// then see if the list of keycombos matches (e.g. "Ctrl+X or Alt+Y" matches "or" and "Alt" and "Ctrl+")
if (_shortcutFilter.empty())
return true;
wstring shortcut_name = stringToLower(string2wstring(sc.getName(), CP_UTF8));
if (shortcut_name.find(_shortcutFilter) != std::string::npos)
return true; // name matches
wstring shortcut_value = stringToLower(string2wstring(sc.toString(), CP_UTF8));
return shortcut_value.find(_shortcutFilter) != std::string::npos; // list of shortcuts matches
}
void ShortcutMapper::fillOutBabyGrid()
{
NppParameters& nppParam = NppParameters::getInstance();

@ -57,6 +57,7 @@ public:
generic_string getTextFromCombo(HWND hCombo);
bool isFilterValid(Shortcut);
bool isFilterValid(PluginCmdShortcut sc);
bool isFilterValid(ScintillaKeyMap sc);
protected :
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);

Loading…
Cancel
Save