Skip to content
Browse files

better syntax highlighting for :NRM

  • Loading branch information...
1 parent 86cc415 commit 82880f7d7c2136e0a190eaee814f14c1e7a6b9cd @chrisbra committed
Showing with 9 additions and 10 deletions.
  1. +9 −10 autoload/nrrwrgn.vim
View
19 autoload/nrrwrgn.vim
@@ -527,18 +527,17 @@ fun! <sid>DeleteMatches(instn) "{{{1
endfun
fun! <sid>HideNrrwRgnLines() "{{{1
- let cnc = has("Conceal")
- let cmd='syn match NrrwRgnStart "^# Start NrrwRgn\d\+$" '.
- \ (cnc ? 'conceal' : '')
+ let char1 = <sid>ReturnComments()[0]
+ let cmd='syn match NrrwRgnStart "^'.char1.' Start NrrwRgn\d\+$"'
exe cmd
- let cmd='syn match NrrwRgnEnd "^# End NrrwRgn\d\+$" '.
- \ (cnc ? 'conceal' : '')
+ let cmd='syn match NrrwRgnEnd "^'.char1.' End NrrwRgn\d\+$"'
exe cmd
- syn region NrrwRgn start="^# Start NrrwRgn\z(\d\+\).*$"
- \ end="^# End NrrwRgn\z1$" fold transparent
- if cnc
- setl conceallevel=3
- endif
+ exe 'syn region NrrwRgn '.
+ \ ' start="^\ze'. char1.' Start NrrwRgn"'.
+ \ ' skip="'.char1.' Start NrrwRgn\(\d\+\)\_.\{-}End NrrwRgn\1$"'.
+ \ ' end="^$" fold transparent'
+ hi default link NrrwRgnStart Comment
+ hi default link NrrwRgnEnd Comment
setl fdm=syntax
endfun

0 comments on commit 82880f7

Please sign in to comment.
Something went wrong with that request. Please try again.