mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 21:03:12 +00:00
Fix fish_clipboard_paste with string-replace-fewer-backslashes
This is the one place in fish where we use a `\` in the replacement of a `string replace -r`, so we'll have to check the feature.
This commit is contained in:
parent
864bb1f7a6
commit
83932441bb
1 changed files with 5 additions and 1 deletions
|
@ -26,7 +26,11 @@ function fish_clipboard_paste
|
|||
#
|
||||
# This eases pasting non-code (e.g. markdown or git commitishes).
|
||||
if __fish_commandline_is_singlequoted
|
||||
set data (string replace -ra "(['\\\])" '\\\\\\\$1' -- $data)
|
||||
if status test-feature string-replace-fewer-backslashes
|
||||
set data (string replace -ra "(['\\\])" '\\\\$1' -- $data)
|
||||
else
|
||||
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,
|
||||
|
|
Loading…
Reference in a new issue