Closed habamax closed 4 years ago
cc @lxhillwind
with
vim -u NONE
set nocp
set conceallevel=2
packadd vim-dirvish
-
I don't get errors but also no syntax and no conceal:
PS, no errors in WSL vim/nvim.
Okay, you have to escape \
in [^\]
as was in previous version. Otherwise for windows closing square bracket is escaped and whole regex confuses vim syntax.
" Define once (per buffer).
if !exists('b:current_syntax')
exe 'syntax match DirvishPathHead =.*'.s:sep_esc.'\ze[^'.s:sep_esc.']\+'.s:sep_esc.'\?$= conceal'
exe 'syntax match DirvishPathTail =[^'.s:sep_esc.']\+'.s:sep_esc.'$='
exe 'syntax match DirvishSuffix =[^'.s:sep_esc.']*\%('.join(map(split(&suffixes, ','), s:escape), '\|') . '\)$='
endif
This works for me
And having this makes s:sep
and s:sep_esc
redundant, probably better just escape and use it like this:
let s:sep = escape(exists('+shellslash') && !&shellslash ? '\' : '/', '\\')
let s:escape = 'substitute(escape(v:val, ".$~"), "*", ".*", "g")'
" Define once (per buffer).
if !exists('b:current_syntax')
exe 'syntax match DirvishPathHead =.*'.s:sep.'\ze[^'.s:sep.']\+'.s:sep.'\?$= conceal'
exe 'syntax match DirvishPathTail =[^'.s:sep.']\+'.s:sep.'$='
exe 'syntax match DirvishSuffix =[^'.s:sep.']*\%('.join(map(split(&suffixes, ','), s:escape), '\|') . '\)$='
endif
With the recent update I get error opening dirvish:
OS: Win10 vim: 8.2.1558 nvim: current nightly