Skip to content

Commit

Permalink
Add word boundaries to Vim search patterns
Browse files Browse the repository at this point in the history
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
xolox committed Jul 28, 2010
1 parent 47a223e commit 59637bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion luainspect.vim
Expand Up @@ -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)
endfor
endfunction
Expand Down

0 comments on commit 59637bd

Please sign in to comment.