Skip to content

Commit 85503fb

Browse files
committed
[Search History] fix unquoted regex in preview command
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 --.
1 parent 615ce65 commit 85503fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functions/_fzf_search_history.fish

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function _fzf_search_history --description "Search command history. Replace the
2323
--scheme=history \
2424
--prompt="Search History> " \
2525
--query=(commandline) \
26-
--preview="string replace --regex $time_prefix_regex '' {} | fish_indent --ansi" \
26+
--preview="string replace --regex '$time_prefix_regex' '' -- {} | fish_indent --ansi" \
2727
--preview-window="bottom:3:wrap" \
2828
$fzf_history_opts |
2929
string split0 |

0 commit comments

Comments
 (0)