mirror of
https://github.com/vim/vim
synced 2025-07-15 16:51:57 +00:00
Problem: completion: can only complete from keyword characters Solution: remove this restriction, allow completion functions when called from i_CTRL-N/i_CTRL-P to be triggered from non-keyword characters (Girish Palya) Previously, functions specified in the `'complete'` option were restricted to starting completion only from keyword characters (as introduced in PR 17065). This change removes that restriction. With this change, user-defined functions (e.g., `omnifunc`, `userfunc`) used in `'complete'` can now initiate completion even when triggered from non-keyword characters. This makes it easier to reuse existing functions alongside other sources without having to consider whether the cursor is on a keyword or non-keyword character, or worry about where the replacement should begin (i.e., the `findstart=1` return value). The logic for both the “collection” and “filtering” phases now fully respects each source’s specified start column. This also extends to fuzzy matching, making completions more predictable. Internally, this builds on previously merged infrastructure that tracks per-source metadata. This PR focuses on applying that metadata to compute the leader string and insertion text appropriately for each match. Also, a memory corruption has been fixed in prepare_cpt_compl_funcs(). closes: #17651 Signed-off-by: Girish Palya <girishji@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>