From 378f452eaa0abbe1a6e3d41963adfcee11803a09 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Wed, 5 Feb 2025 19:06:37 +0100 Subject: [PATCH] Revert token movement bindings Comments by macOS users have shown that, apparently, on that platform this isn't wanted. The functions are there for people to use, but we need more time to figure out if and how we're going to bind these by default. For example, we could change these bindings depending on the OS in future. This reverts most of commit 6af96a81a8c6ff5e632d4dda7448f5f01d7a5d35. Fixes #10926 See #11107 --- CHANGELOG.rst | 1 + doc_src/interactive.rst | 4 ++-- share/functions/__fish_shared_key_bindings.fish | 4 ++-- share/functions/fish_default_key_bindings.fish | 3 +-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 40034f71b..acb828026 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,7 @@ Changes since 4.0b1 the old behavior that leaves a "^C" marker is available as "cancel-commandline" (:issue:`10935`) - The ``make test`` target was removed as it can no longer be defined in new CMake versions. Use ``make fish_run_tests``. The built-in test target will run if you built fish before, but will not print output if it fails (:issue:`11116`). +- :kbd:`alt-backspace`, :kdb:`alt-left` and :kbd:`alt-right` operate on words again instead of full arguments, reverting to how it was in 3.7 and before (:issue:`10926`). fish 4.0.0 (released ???) ========================= diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index b21381f35..3f9b1ba76 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -303,7 +303,7 @@ Some bindings are common across Emacs and vi mode, because they aren't text edit - :kbd:`alt-enter` inserts a newline at the cursor position. This is useful to add a line to a commandline that's already complete. -- :kbd:`alt-left` (``←``) and :kbd:`alt-right` (``→``) move the cursor one argument left or right, or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, :kbd:`alt-right` (``→``) (or :kbd:`alt-f`) accepts the first argument in the suggestion. +- :kbd:`alt-left` (``←``) and :kbd:`alt-right` (``→``) move the cursor one word left or right (to the next space or punctuation mark), or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, :kbd:`alt-right` (``→``) (or :kbd:`alt-f`) accepts the first word in the suggestion. - :kbd:`ctrl-left` (``←``) and :kbd:`ctrl-right` (``→``) move the cursor one word left or right. These accept one word of the autosuggestion - the part they'd move over. @@ -368,7 +368,7 @@ To enable emacs mode, use :doc:`fish_default_key_bindings ` moves to the end. diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish index 26be8e392..6c2259e03 100644 --- a/share/functions/__fish_shared_key_bindings.fish +++ b/share/functions/__fish_shared_key_bindings.fish @@ -54,8 +54,8 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod $legacy_bind --preset $argv -k sright forward-bigword $legacy_bind --preset $argv -k sleft backward-bigword - bind --preset $argv alt-right nextd-or-forward-token - bind --preset $argv alt-left prevd-or-backward-token + bind --preset $argv alt-right nextd-or-forward-word + bind --preset $argv alt-left prevd-or-backward-word bind --preset $argv alt-up history-token-search-backward bind --preset $argv alt-down history-token-search-forward diff --git a/share/functions/fish_default_key_bindings.fish b/share/functions/fish_default_key_bindings.fish index a64c628d9..166d160f0 100644 --- a/share/functions/fish_default_key_bindings.fish +++ b/share/functions/fish_default_key_bindings.fish @@ -57,9 +57,8 @@ function fish_default_key_bindings -d "emacs-like key binds" bind --preset $argv alt-u upcase-word bind --preset $argv alt-c capitalize-word - bind --preset $argv alt-backspace backward-kill-token + bind --preset $argv alt-backspace backward-kill-word bind --preset $argv ctrl-backspace backward-kill-word - bind --preset $argv alt-delete kill-token bind --preset $argv ctrl-delete kill-word bind --preset $argv alt-b backward-word bind --preset $argv alt-f forward-word