Skip to content

Commit

Permalink
fix findstart of completion
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Nov 18, 2009
1 parent 5ab062a commit 97cbf29
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions vimlib/plugin/emoticon.vim
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,20 @@ fun! s:gen_key(i)
endf

fun! CompleteEmoticon(s,base)
for i in range(1,200)
let key = s:gen_key(i)
cal complete_add( { 'word': s:generate() , 'menu': key } )
endfor
if a:s
" locate the start of the word
let line = getline('.')
let start = col('.') - 1
while start > 0 && line[start - 1] =~ '\a'
let start -= 1
endwhile
return start
else
for i in range(1,200)
let key = s:gen_key(i)
cal complete_add( { 'word': s:generate() , 'menu': key } )
endfor
endif
endf

com! NewEmoticon :cal s:newEmoticon()
Expand Down

0 comments on commit 97cbf29

Please sign in to comment.