mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 19:03:38 +08:00
fish_clipboard_paste: Don't add histignore spaces
If we're at the beginning of the commandline, we trim leading whitespace so we don't trigger histignore. Since that's the main issue of problems with histignore: Closes #4327.
This commit is contained in:
parent
5a9d153363
commit
ad0c8cfb83
|
@ -28,6 +28,11 @@ function fish_clipboard_paste
|
|||
if __fish_commandline_is_singlequoted
|
||||
set data (string replace -ra "(['\\\])" '\\\\\\\$1' -- $data)
|
||||
end
|
||||
if not string length -q -- (commandline -c)
|
||||
# If we're at the beginning of the first line, trim whitespace from the start,
|
||||
# so we don't trigger ignoring history.
|
||||
set data (string trim -l -- $data)
|
||||
end
|
||||
if test -n "$data"
|
||||
commandline -i -- $data
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user