[patch] hanging buffer completion

89 views
Skip to first unread message

Christian Brabandt

unread,
Jan 15, 2014, 5:54:16 PM1/15/14
to vim...@vim.org
Bram,
consider this:

cat /tmp/dict
catharsis
catechism
catastrophe

vim -u NONE -N -c 'set cpt=k,. dictionary=/tmp/dict'

$put ='canz'
$put ='canq'
0put ='ca'
Got to the end of the first line, and press <C-N>

Note, how Vim hangs. This happens, because in the function
ins_compl_get_exp() in edit.c:4406 Vim will start an endless loop,
because the search wraps and it will keep finding matches and not
terminate the loop.

Attached patch fixes this.

This behaviour was mentioned at
http://stackoverflow.com/questions/20968671

Best,
Christian
--
completion_hang.diff

Bram Moolenaar

unread,
Jan 16, 2014, 3:51:22 PM1/16/14
to Christian Brabandt, vim...@vim.org
Thanks for the fix.


--
"Hit any key to continue" is a lie.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages