Added hicursorwords v0.2

This commit is contained in:
Austen Adler 2017-02-08 12:23:45 -05:00
parent bce734f742
commit ef9128435a
No known key found for this signature in database
GPG Key ID: 7ECEE590CCDFE3F1

View File

@ -75,7 +75,7 @@ endfunction
function! s:HiCursorWords__getWordUnderTheCursor(linestr, linenum, colnum) function! s:HiCursorWords__getWordUnderTheCursor(linestr, linenum, colnum)
"let word = substitute(a:linestr, '.*\(\<\k\{-}\%' . a:colnum . 'c\k\{-}\>\).*', '\1', '') "expand('<word>') "let word = substitute(a:linestr, '.*\(\<\k\{-}\%' . a:colnum . 'c\k\{-}\>\).*', '\1', '') "expand('<word>')
let word = matchstr(a:linestr, '\k*\%' . a:colnum . 'c\k\+') let word = matchstr(a:linestr, '\k*\%' . a:colnum . 'c\k\+')
if a:linestr == word if word == ''
return '' return ''
endif endif
return '\V\<' . word . '\>' return '\V\<' . word . '\>'
@ -111,7 +111,7 @@ function! s:HiCursorWords__startHilighting()
augroup HiCursorWordsUpdate augroup HiCursorWordsUpdate
autocmd! autocmd!
autocmd CursorHold,CursorHoldI * autocmd CursorHold,CursorHoldI *
\ let &updatetime = b:HiCursorWords__oldUpdatetime \ if exists('b:HiCursorWords__oldUpdatetime') | let &updatetime = b:HiCursorWords__oldUpdatetime | endif
\ | call s:HiCursorWords__execute() \ | call s:HiCursorWords__execute()
augroup END augroup END
endfunction endfunction