Add self-insert-notfirst readline command

This adds a new readline command self-insert-notfirst, which is
analogous to self-insert, except that it does nothing if the cursor
is at the beginning. This will serve as a higher-performance implementation
for stripping leading spaces on paste.
This commit is contained in:
ridiculousfish
2020-03-04 14:10:24 -08:00
parent e333f90c07
commit 09baecce5d
4 changed files with 31 additions and 7 deletions

View File

@@ -162,6 +162,10 @@ The following special input functions are available:
- ``repaint-mode`` reexecutes the fish_mode_prompt function and redraws the prompt. This is useful for vi-mode. If no fish_mode_prompt exists, it acts like a normal repaint.
- ``self-insert``, inserts the matching sequence into the command line
- ``self-insert-notfirst``, inserts the matching sequence into the command line, unless the cursor is at the beginning
- ``suppress-autosuggestion``, remove the current autosuggestion
- ``swap-selection-start-stop``, go to the other end of the highlighted text without changing the selection