From d2f5daf8e8985209ae34577c137b6077e1a57624 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Mon, 2 Jan 2023 21:43:46 +0100 Subject: [PATCH] bindings: If handler doesn't exist, set immediately Fixes #9443 --- share/functions/fish_default_key_bindings.fish | 5 ++++- share/functions/fish_vi_key_bindings.fish | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index 1c976117f..95d5e7a4d 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -14,7 +14,10 @@ function fish_default_key_bindings -d "emacs-like key binds" # This triggers the handler, which calls us again and ensures the user_key_bindings # are executed. set fish_key_bindings fish_default_key_bindings - return + # unless the handler somehow doesn't exist, which would leave us without bindings. + # this happens in no-config mode. + functions -q __fish_reload_key_bindings + and return end end diff --git a/share/functions/fish_vi_key_bindings.fish b/share/functions/fish_vi_key_bindings.fish index 2ca0c9474..9fc512238 100644 --- a/share/functions/fish_vi_key_bindings.fish +++ b/share/functions/fish_vi_key_bindings.fish @@ -28,7 +28,10 @@ function fish_vi_key_bindings --description 'vi-like key bindings for fish' # This triggers the handler, which calls us again and ensures the user_key_bindings # are executed. set fish_key_bindings fish_vi_key_bindings - return + # unless the handler somehow doesn't exist, which would leave us without bindings. + # this happens in no-config mode. + functions -q __fish_reload_key_bindings + and return end set -l init_mode insert