Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Add word boundaries to Vim search patterns

This shouldn't be necessary except that the semantic highlighting
performed by luainspect.vim conflicts with the dynamic highlighting
created by my easytags.vim plug-in and this exposes a strange
highlighting bug, where for example in the following:

    local function foobar() end

The 'f' of 'foobar' is highlighted as luaFuncTag while 'oobar' is
highlighted as luaInspectLocalUnused. Note that this bug doesn't
seem to surface unless the two plugins both want to highlight
the same variable...
  • Loading branch information...
1 parent 47a223e commit 59637bd8e2843b51780866f10899f759aa07c416 @xolox committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  luainspect.vim
2  luainspect.vim
@@ -63,7 +63,7 @@ EOF
" Highlight variables in buffer based on positions.
for fields in split(listing, "\n")
let [type, lnum, start, end] = split(fields)
- let command = 'syntax match %s /\%%%il\%%>%ic.\+\%%<%ic/'
+ let command = 'syntax match %s /\%%%il\%%>%ic\<\w\+\>\%%<%ic/'
execute printf(command, type, lnum, start - 1, end + 2)

0 comments on commit 59637bd

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