Skip to content

Commit 0cfdd16

Browse files
committed
Use shellslash to determine path separator
shellslash should tell vim what slash to pass to the shell. Following that logic, the code shouldn't check 'shell' at all. Instead, it should only use shellslash: exists('+shellslash') && &shellslash == 0 I doubt cmd.exe would be used as a shell on platforms that don't have shellslash. shellslash only exists on Windows and evaluates to 0 on Linux (tested gvim 7.4.52 on Ubuntu). So this change shouldn't break other platforms. Now dirvish uses conceal to hide the directories in the listing when shellslash is enabled with cmd.exe (on Windows). Tested on gvim 7.4.1832 on Win8.1 with 'shellslash' and 'noshellslash'. dirvish correctly conceals paths.
1 parent c76e3d3 commit 0cfdd16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

syntax/dirvish.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if exists("b:current_syntax")
22
finish
33
endif
44

5-
let s:sep = (&shell =~? 'cmd.exe') ? '\\' : '\/'
5+
let s:sep = (exists('+shellslash') && &shellslash == 0) ? '\\' : '\/'
66

77
exe 'syntax match DirvishPathHead ''\v.*'.s:sep.'\ze[^'.s:sep.']+'.s:sep.'?$'' conceal'
88
exe 'syntax match DirvishPathTail ''\v[^'.s:sep.']+'.s:sep.'$'''

0 commit comments

Comments
 (0)