Skip to content

Commit 863cb19

Browse files
committed
macos: Escape filename properly
shellescape() is not quite correct, as it also adds single quotes around otherwise proper filenames, e.g. it turns test into 'test', which jobstart() will complain about in neovim. The regression was introduced in 145a2fd to fix the problem with spaces in the filename in #13. Because vim's job_start() implementation is a little more robust than the neovim counterpart and can handle the single quotes, noone noticed the problem back then. To fix this we switch to fnameescape(), which doesn't enclose everything in quotes but rather escapes every problematic character individually, e.g. test turns into test, and test asdf turns into test\ asdf. Fixes #14
1 parent 6864405 commit 863cb19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/lumen/platforms/macos.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let s:exe = shellescape(resolve(expand('<sfile>:p:h')) . '/macos/watcher')
1+
let s:exe = fnameescape(resolve(expand('<sfile>:p:h')) . '/macos/watcher')
22

33
func lumen#platforms#macos#watch_cmd()
44
return [s:exe]

0 commit comments

Comments
 (0)