aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/shellwords.rs
Commit message (Collapse)AuthorAge
* Fix typos (#6643)Daniel Sedlak2023-04-07
|
* Fix utf8 length handling for shellwords (#5738)Mike Trinkala2023-02-01
| | | | | | | If the last argument to shellwords ends in a multibyte utf8 character the entire argument will be dropped. e.g. `:sh echo test1 test2ð’€€` will only output `test1` Add additional tests based on the code review feedback
* Capture word parts while calculating shellwords (#4632)Michael Davis2022-11-17
| | | | | | | | | | | | | | | | | | | 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.
* Escape filenames in command completionMichael Davis2022-11-07
| | | | | | This changes the completion items to be rendered with shellword escaping, so a file `a b.txt` is rendered as `a\ b.txt` which matches how it should be inputted.
* Fix whitespace handling in command-mode completionMichael Davis2022-11-07
| | | | | | | | | | 8584b38cfbe6ffe3e5d539ad953c413e44e90bfa switched to shellwords for completion in command-mode. This changes the conditions for choosing whether to complete the command or use the command's completer. This change processes the input as shellwords up-front and uses shellword logic about whitespace to determine whether the command or argument should be completed.
* Add missed test attribute in #4316 (#4557)Poliorcetics2022-11-01
|
* Correctly handle escaping in completion (#4316)Armin Ronacher2022-11-01
| | | | | * Correctly handle escaping in completion * Added escaping tests
* Fix shellwords delimiter handling (#4098)A-Walrus2022-10-21
| | | | | | | | | * Fix shellwords delimiter handling This allows commands such as `:set statusline.center ["file-type"]` to work. Before the quotes within the list would mess it up. Also added a test to ensure correct behavior * Rename Delimiter -> OnWhitespace
* Enable shellwords for Windows (with escaping disabled) (#2767)ath32022-06-21
|
* Open files with spaces in filename, allow opening multiple files (#1231)ath32021-12-12