Fix clipboard_paste nicer

Instead of hacking in arbitrary characters to avoid splitting, just
use `string collect`.

This reverts commit e450190d50.

Fixes #7782, but nicer.
This commit is contained in:
Fabian Homborg
2021-03-06 08:40:07 +01:00
parent 25d85bdc64
commit 10ef0d9daf
2 changed files with 3 additions and 9 deletions

View File

@@ -26,7 +26,7 @@ function fish_clipboard_paste
# in order to turn it into a single literal token.
#
# This eases pasting non-code (e.g. markdown or git commitishes).
set -l quote_state (__fish_tokenizer_state -- (commandline -ct))
set -l quote_state (__fish_tokenizer_state -- (commandline -ct | string collect))
if contains -- $quote_state single single-escaped
if status test-feature regex-easyesc
set data (string replace -ra "(['\\\])" '\\\\$1' -- $data)