Permalink
Browse files

change the line retrieving the word under the cursor

  • Loading branch information...
1 parent 9951c14 commit 43ff22c88388d3e92a89c9bf7ab90c75aec37583 @itchyny committed Jun 4, 2016
Showing with 2 additions and 2 deletions.
  1. +2 −2 autoload/cursorword.vim
@@ -2,7 +2,7 @@
" Filename: autoload/cursorword.vim
" Author: itchyny
" License: MIT License
-" Last Change: 2016/04/27 21:30:00.
+" Last Change: 2016/06/04 22:38:29.
" =============================================================================
let s:save_cpo = &cpo
@@ -23,7 +23,7 @@ function! cursorword#matchadd() abort
if !enable && !get(w:, 'cursorword_match') | return | endif
let line = getline('.')
let linenr = line('.')
- let word = matchstr(line[:(col('.')-1)], '\k*$')[:-2] . matchstr(line[(col('.')-1):], '^\k*')
+ let word = matchstr(line[:(col('.')-1)], '\k*$') . matchstr(line[(col('.')-1):], '^\k*')[1:]
if get(w:, 'cursorword_state', []) ==# [ linenr, word, enable ] | return | endif
let w:cursorword_state = [ linenr, word, enable ]
silent! call matchdelete(w:cursorword_id0)

0 comments on commit 43ff22c

Please sign in to comment.