mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 03:51:20 -03:00
Fix line-wise autosuggestion false positive when line doesn't start command
To reduce the likelihood of false positive line-wise history
autosuggestions, we only them when the cursor's line starts a new
process ("parse_util_process_extent").
There are still false positives. Given
$ true &&
somecommand
$ echo "
someothercommand
"
typing "some" suggests "someothercommand" from history even though
that was not actually used as command.
Fix this by using similar rules for suggestion candidates.
Might help #12290
This commit is contained in:
@@ -80,3 +80,11 @@ run("rm configure")
|
||||
send("./con")
|
||||
use_suggestion()
|
||||
expect_prompt(">./con\r\n")
|
||||
|
||||
send(control("c"))
|
||||
run("touch somecommand")
|
||||
run("chmod +x somecommand")
|
||||
run('echo "multiline-token\n./somecommand arg1 arg2"')
|
||||
send("./some")
|
||||
use_suggestion()
|
||||
expect_prompt(">./somecommand \r\n")
|
||||
|
||||
Reference in New Issue
Block a user