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:
Fabian Homborg 2019-03-13 12:15:45 +01:00
parent 5a9d153363
commit ad0c8cfb83

View File

@ -28,6 +28,11 @@ function fish_clipboard_paste
if __fish_commandline_is_singlequoted if __fish_commandline_is_singlequoted
set data (string replace -ra "(['\\\])" '\\\\\\\$1' -- $data) set data (string replace -ra "(['\\\])" '\\\\\\\$1' -- $data)
end 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" if test -n "$data"
commandline -i -- $data commandline -i -- $data
end end