]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0909: insert completion is slow to collect many matches v9.2.0909
authorSamuel Schlesinger <sgschlesinger@gmail.com>
Tue, 4 Aug 2026 20:31:44 +0000 (20:31 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 4 Aug 2026 20:31:44 +0000 (20:31 +0000)
commit31b7b1a7da4e282ebdf09f3c1c3e16ded7b76e8a
treec08c2fd8125785755304e110619265152b0cf63d
parentaeac948c6273076f666b473862af70e8b7e6c653
patch 9.2.0909: insert completion is slow to collect many matches

Problem:  ins_compl_add() checks for a duplicate by scanning the whole
          match list, making collection of N matches quadratic.
Solution: Look matches up in a hashtab instead; each entry counts the
          matches with that string (Samuel Schlesinger).

closes: #20926

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/hashtab.c
src/insexpand.c
src/testdir/test_ins_complete.vim
src/version.c