Skip to content

Commit

Permalink
[Search History] fix unquoted regex in preview command
Browse files Browse the repository at this point in the history
Resolves #314. The problem was that the regex used to generate the
preview was unquoted so fish interpreted it as a filename glob. I
also fixed another potential bug by delinating the string replace
command options from its arguments with --.
  • Loading branch information
PatrickF1 committed Nov 6, 2023
1 parent 615ce65 commit 85503fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/_fzf_search_history.fish
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function _fzf_search_history --description "Search command history. Replace the
--scheme=history \
--prompt="Search History> " \
--query=(commandline) \
--preview="string replace --regex $time_prefix_regex '' {} | fish_indent --ansi" \
--preview="string replace --regex '$time_prefix_regex' '' -- {} | fish_indent --ansi" \
--preview-window="bottom:3:wrap" \
$fzf_history_opts |
string split0 |
Expand Down

0 comments on commit 85503fb

Please sign in to comment.