Skip to content

Commit 4bc6add

Browse files
authored
fix: Pattern delimiter not found #193
For windows backslash should be escaped in [^\]. Fixes #192
1 parent 4d4e707 commit 4bc6add

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

syntax/dirvish.vim

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ if 'dirvish' !=# get(b:, 'current_syntax', 'dirvish')
22
finish
33
endif
44

5-
let s:sep = exists('+shellslash') && !&shellslash ? '\' : '/'
6-
let s:sep_esc = s:sep == '\' ? '\\' : '/'
5+
let s:sep = exists('+shellslash') && !&shellslash ? '\\' : '/'
76
let s:escape = 'substitute(escape(v:val, ".$~"), "*", ".*", "g")'
87

98
" Define once (per buffer).
109
if !exists('b:current_syntax')
11-
exe 'syntax match DirvishPathHead =.*'.s:sep_esc.'\ze[^'.s:sep.']\+'.s:sep_esc.'\?$= conceal'
12-
exe 'syntax match DirvishPathTail =[^'.s:sep.']\+'.s:sep_esc.'$='
10+
exe 'syntax match DirvishPathHead =.*'.s:sep.'\ze[^'.s:sep.']\+'.s:sep.'\?$= conceal'
11+
exe 'syntax match DirvishPathTail =[^'.s:sep.']\+'.s:sep.'$='
1312
exe 'syntax match DirvishSuffix =[^'.s:sep.']*\%('.join(map(split(&suffixes, ','), s:escape), '\|') . '\)$='
1413
endif
1514

0 commit comments

Comments
 (0)