Skip to content

Commit

Permalink
syntax: eliminate DirvishArgFullPath group
Browse files Browse the repository at this point in the history
Match DirvishArg to full path and mark it with
"contains=DirvishPathHead".

ref #123
  • Loading branch information
justinmk committed Nov 15, 2018
1 parent c236cb3 commit 9c67fa7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions syntax/dirvish.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ endif
" Define (again). Other windows (different arglists) need the old definitions.
" Do these last, else they may be overridden (see :h syn-priority).
for s:p in argv()
let s:f = fnamemodify(s:p, ':p') " Full path.
let s:base = escape(fnamemodify(s:f[-1:] ==# s:sep ? s:f[:-2] : s:f, ':t'), '@*.^$~\')
exe 'syntax match DirvishArgFullPath @^'.escape(s:f, '@*.^$~\').'$@ contains=DirvishPathHead,DirvishArg'
exe 'syntax match DirvishArg @'.s:base.'\'.s:sep.'\?$@ contained'
exe 'syntax match DirvishArg ,'.escape(fnamemodify(s:p,':p'),',*.^$~\').'$, contains=DirvishPathHead'
endfor

let b:current_syntax = 'dirvish'

0 comments on commit 9c67fa7

Please sign in to comment.