Also fix tokenizer_state in bracketed paste path

Also removes our remaining use of
`__fish_commandline_is_singlequoted`.

See #7782.
This commit is contained in:
Fabian Homborg 2021-04-20 15:29:28 +02:00
parent dc57ba01a2
commit 9c413b039d
2 changed files with 2 additions and 2 deletions

View file

@ -1,5 +1,5 @@
# TODO: This function is deprecated. It was used in fish_clipboard_paste # TODO: This function is deprecated. It was used in fish_clipboard_paste
# which some users copied, so maybe leave it around for a few years. # which some users copied, so maybe leave it around for a few years.
function __fish_commandline_is_singlequoted --description "Return 0 if the current token has an open single-quote" function __fish_commandline_is_singlequoted --description "Return 0 if the current token has an open single-quote"
string match -q 'single*' (__fish_tokenizer_state -- (commandline -ct)) string match -q 'single*' (__fish_tokenizer_state -- (commandline -ct | string collect))
end end

View file

@ -182,7 +182,7 @@ function __fish_start_bracketed_paste
set -g __fish_last_bind_mode $fish_bind_mode set -g __fish_last_bind_mode $fish_bind_mode
# If the token is currently single-quoted, # If the token is currently single-quoted,
# we escape single-quotes (and backslashes). # we escape single-quotes (and backslashes).
__fish_commandline_is_singlequoted string match -q 'single*' (__fish_tokenizer_state -- (commandline -ct | string collect))
and set -g __fish_paste_quoted 1 and set -g __fish_paste_quoted 1
end end