diff options
| author | 2026-10-11 03:16:44 +0100 | |
|---|---|---|
| committer | 2026-10-11 03:16:44 +0100 | |
| commit | 0dc5795d5ba4d5ef053398ee18f78e4f9f285443 (patch) | |
| tree | f0e7369dd9b4311965bbb77d86baac8fe337cfbb | |
| parent | fe41d305fc3ebc3d16b2a3f1bd3442060eebfb73 (diff) | |
| download | sst-0dc5795d5ba4d5ef053398ee18f78e4f9f285443.tar.gz sst-0dc5795d5ba4d5ef053398ee18f78e4f9f285443.zip | |
Fix todo.vim shell handling in Vim 9 on Windows
I always used Neovim where this seemed to work but recently switched to
Vim where it doesn't seem to work. I've now tested it in both and it
seems fine. All zero other users of this script can now rejoice!
| -rw-r--r-- | tools/todo.vim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/todo.vim b/tools/todo.vim index 04c704d..cb73b2f 100644 --- a/tools/todo.vim +++ b/tools/todo.vim @@ -4,14 +4,19 @@ function! Todo(...) if exists("a:1") && a:1 != "" copen " cex "" | cadde to avoid insta-jumping - if &shell == "cmd.exe" - cex "" | cadde system("git grep -nF TODO(".shellescape(a:1).")") + if &shell !~ "(.*[\\/])?cmd\.exe" + " for some reason vim ties quoting behaviour to whether or not the + " user prefers forward slashes in their file paths. + let oldssl=&ssl + set nossl + cex "" | cadde system("git grep -nF TODO^(".shellescape(a:1)."^)") + let &ssl=oldssl else cex "" | cadde system("git grep -nF \"TODO(\"".shellescape(a:1)."\\)") endif else " just displaying like this for now... - if &shell == "cmd.exe" + if &shell !~ "(.*[\\/])?cmd\.exe" " FIXME: write a Windows batch equivalent!? in the meantime, you " need a Unix shell to track issues :^) cex "" | cclose | !sh tools/todo |
