You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/helix-core
Michael Davis c6b83368b3
Capture word parts while calculating shellwords (#4632)
This fixes an edge case for completing shellwords. With a file
"a b.txt" in the current directory, the sequence `:open a\<tab>`
will result in the prompt containing `:open aa\ b.txt`. This is
because the length of the input which is trimmed when replacing with
completion is calculated on the part of the input which is parsed by
shellwords and then escaped (in a separate operation), which is lossy.
In this case it loses the trailing backslash.

The fix provided here refactors shellwords to track both the _words_
(shellwords with quotes and escapes resolved) and the _parts_ (chunks
of the input which turned into each word, with separating whitespace
removed). When calculating how much of the input to delete when
replacing with the completion item, we now use the length of the last
part.

This also allows us to eliminate the duplicate work done in the
`ends_with_whitespace` check.
2 years ago
..
src Capture word parts while calculating shellwords (#4632) 2 years ago
tests deps: Update tree-sitter-rust (supports let-else && let-chains) 2 years ago
.gitignore Initial import. 4 years ago
Cargo.toml build(deps): bump once_cell from 1.15.0 to 1.16.0 (#4548) 2 years ago