mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 19:41:15 -03:00
Fix regression causing missing autosuggestions after (
Commit 4f3d6427ce (Fix regression causing crash in "commandline -j",
2025-01-12) wasn't quite right; it mishandles the edge case where
the current process has no token, fix that.
This commit is contained in:
@@ -4650,16 +4650,15 @@ fn get_autosuggestion_performer(
|
||||
};
|
||||
|
||||
// Search history for a matching item unless this line is not a continuation line or quoted.
|
||||
if {
|
||||
let cursor_line_has_process_start = {
|
||||
let mut tokens = vec![];
|
||||
parse_util_process_extent(&command_line, cursor_pos, Some(&mut tokens));
|
||||
tokens
|
||||
.first()
|
||||
.map(|tok| {
|
||||
range_of_line_at_cursor(&command_line, tok.offset()) == search_string_range
|
||||
})
|
||||
.unwrap_or_default()
|
||||
} {
|
||||
range_of_line_at_cursor(
|
||||
&command_line,
|
||||
tokens.first().map(|tok| tok.offset()).unwrap_or(cursor_pos),
|
||||
) == search_string_range
|
||||
};
|
||||
if cursor_line_has_process_start {
|
||||
let mut searcher = HistorySearch::new_with_type(
|
||||
history,
|
||||
search_string.to_owned(),
|
||||
|
||||
@@ -30,3 +30,9 @@ isolated-tmux send-keys A C-h
|
||||
tmux-sleep
|
||||
isolated-tmux capture-pane -p
|
||||
# CHECK: prompt 2> : ./COMPL
|
||||
|
||||
isolated-tmux send-keys C-u 'echo (echo)' Enter
|
||||
isolated-tmux send-keys C-l 'echo ('
|
||||
tmux-sleep
|
||||
isolated-tmux capture-pane -p
|
||||
# CHECK: prompt 3> echo (echo)
|
||||
|
||||
Reference in New Issue
Block a user