helix-mirror/helix-term/src
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.
2022-11-17 10:00:48 +09:00
..
commands Capture word parts while calculating shellwords (#4632) 2022-11-17 10:00:48 +09:00
keymap Change diagnostic picker keybind to <space>d (#4229) 2022-10-17 16:45:42 +09:00
ui sort fuzzy matches with equal score by length in picker (#4698) 2022-11-16 17:28:20 -06:00
application.rs fix test compilation 2022-11-09 22:17:14 +09:00
args.rs Fix confusion with using --hsplit --vsplit on startup at same time (#4202) 2022-10-11 09:25:42 -04:00
commands.rs Use key-sequence format for command palette keybinds (#4712) 2022-11-17 09:58:54 +09:00
compositor.rs fix test compilation 2022-11-09 22:17:14 +09:00
config.rs Move top level lsp config to editor.lsp (#1868) 2022-03-28 10:11:52 +09:00
health.rs Show clipboard info in --health output (#2947) 2022-09-01 01:23:45 +09:00
job.rs remove Callback::Compositor variant 2022-10-18 22:31:39 -04:00
keymap.rs Improve keymap errors from command typos (#3931) 2022-09-22 09:30:42 +08:00
lib.rs Add refresh-config and open-config command (#1803) 2022-03-25 18:05:20 +09:00
main.rs document should save even if formatter fails 2022-10-18 22:31:39 -04:00