Rename InputModeChange hook to ModeChange

InputModeChange is a bit long to type and its pretty clear in Kakoune
that "Mode" means "Input mode", so use a shorter and as clear name.
This commit is contained in:
Maxime Coste 2018-01-21 10:34:09 +11:00
parent 07dfcd336d
commit d22c989984
4 changed files with 6 additions and 6 deletions

View File

@ -120,7 +120,7 @@ of the given *group*.
*RuntimeError* `error message`::
an error was encountered while executing a user command
*InputModeChange* `<old mode>:<new mode>`::
*ModeChange* `<old mode>:<new mode>`::
Triggered whenever the current input mode changes
*KakBegin* `session name`::

View File

@ -758,7 +758,7 @@ static constexpr auto hooks = {
"InsertBegin", "InsertChar", "InsertDelete", "InsertEnd", "InsertIdle", "InsertKey",
"InsertMove", "InsertCompletionHide", "InsertCompletionShow", "InsertCompletionSelect",
"KakBegin", "KakEnd", "FocusIn", "FocusOut", "RuntimeError", "PromptIdle",
"NormalBegin", "NormalEnd", "NormalIdle", "NormalKey", "InputModeChange", "RawKey",
"NormalBegin", "NormalEnd", "NormalIdle", "NormalKey", "ModeChange", "RawKey",
"WinClose", "WinCreate", "WinDisplay", "WinResize", "WinSetOption",
};

View File

@ -1418,7 +1418,7 @@ void InputHandler::push_mode(InputMode* new_mode)
m_mode_stack.emplace_back(new_mode);
new_mode->on_enabled();
context().hooks().run_hook("InputModeChange", format("{}:{}", prev_name, new_mode->name()), context());
context().hooks().run_hook("ModeChange", format("{}:{}", prev_name, new_mode->name()), context());
}
void InputHandler::pop_mode(InputMode* mode)
@ -1432,7 +1432,7 @@ void InputHandler::pop_mode(InputMode* mode)
m_mode_stack.pop_back();
current_mode().on_enabled();
context().hooks().run_hook("InputModeChange", format("{}:{}", prev_name, current_mode().name()), context());
context().hooks().run_hook("ModeChange", format("{}:{}", prev_name, current_mode().name()), context());
}
void InputHandler::reset_normal_mode()
@ -1446,7 +1446,7 @@ void InputHandler::reset_normal_mode()
m_mode_stack.resize(1);
current_mode().on_enabled();
context().hooks().run_hook("InputModeChange", format("{}:{}", prev_name, current_mode().name()), context());
context().hooks().run_hook("ModeChange", format("{}:{}", prev_name, current_mode().name()), context());
}
void InputHandler::insert(InsertMode mode, int count)

View File

@ -46,7 +46,7 @@ static const char* startup_info =
" the add-highlighter and remove-highlighter command syntax changed.\n"
" * Regex implementation switched to a custom one, the syntax is slightly\n"
" less tolerant.\n"
" * InputModeChange hook has been introduced and is expected to replace\n"
" * ModeChange hook has been introduced and is expected to replace\n"
" the various ${MODE}Begin/${MODE}End hooks, consider those deprecated.\n";
struct startup_error : runtime_error