mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00:00
Only set bind mode if it changed
This is potentially costly (as functions listening for the variable will be executed). Fixes #3216.
This commit is contained in:
parent
7ce042ccff
commit
a0623e870b
1 changed files with 4 additions and 1 deletions
|
@ -216,7 +216,10 @@ wcstring input_get_bind_mode() {
|
||||||
|
|
||||||
/// Set the current bind mode.
|
/// Set the current bind mode.
|
||||||
void input_set_bind_mode(const wcstring &bm) {
|
void input_set_bind_mode(const wcstring &bm) {
|
||||||
env_set(FISH_BIND_MODE_VAR, bm.c_str(), ENV_GLOBAL);
|
// Only set this if it differs to not execute variable handlers all the time.
|
||||||
|
if (input_get_bind_mode() != bm.c_str()) {
|
||||||
|
env_set(FISH_BIND_MODE_VAR, bm.c_str(), ENV_GLOBAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the arity of a given input function.
|
/// Returns the arity of a given input function.
|
||||||
|
|
Loading…
Reference in a new issue