diff --git a/src/text_editor/commands.cpp b/src/text_editor/commands.cpp index 184d0d2..e04db51 100644 --- a/src/text_editor/commands.cpp +++ b/src/text_editor/commands.cpp @@ -245,3 +245,16 @@ void CMD_OpenLogs() { void CMD_Errors() { CMD_OpenLogs(); } RegisterCommand(CMD_Errors, "", "Opens the text editor logs and clear error counter"); + +void CheckKeybindingColission() { + ForItem (x, GlobalCommands) { + if (x.trigger == NULL) continue; + ForItem (y, GlobalCommands) { + if (y.trigger == NULL) continue; + if (&x == &y) continue; + if (x.trigger == y.trigger) { + ReportErrorf("Hotkey colission between: '%S' and '%S'", x.name, y.name); + } + } + } +} \ No newline at end of file diff --git a/src/text_editor/plugin_config.cpp b/src/text_editor/plugin_config.cpp index 016c285..d15027f 100644 --- a/src/text_editor/plugin_config.cpp +++ b/src/text_editor/plugin_config.cpp @@ -153,6 +153,7 @@ void Set(String string) { if (trigger) { cmd->binding = quote; cmd->trigger = trigger; + CheckKeybindingColission(); } return; } diff --git a/src/text_editor/text_editor.cpp b/src/text_editor/text_editor.cpp index 56b7125..fe292df 100644 --- a/src/text_editor/text_editor.cpp +++ b/src/text_editor/text_editor.cpp @@ -1005,6 +1005,7 @@ int main(int argc, char **argv) EnterOrEscapeKeySet = ParseKeyCached("escape | enter"); AltEnterKeySet = ParseKeyCached("alt-enter"); ShiftEnterKeySet = ParseKeyCached("shift-enter"); + CheckKeybindingColission(); #if PLUGIN_CONFIG