Age | Commit message (Collapse) | Author |
|
Problem: cannot use fuzzy keyword completion
(Maxim Kim)
Solution: add the "fuzzycollect" value for the 'completeopt'
setting, to gather matches using fuzzy logic (glepnir)
fixes: #14912
closes: #14976
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Test for patch 9.1.0489 doesn't fail without the fix.
Solution: Use "!" flag of feedkeys() so that ex_normal_busy is not set
and ins_compl_check_keys() is not skipped (zeertzjq).
closes: #15018
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: default completion may break with fuzzy
Solution: check that completion_match_array is not null
(glepnir)
closes: #15010
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: completed item not update on fuzzy completion
Solution: reset compl_shown_match when at original match position
(glepnir)
closes: #14955
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Sorting of completeopt+=fuzzy is not stable.
Solution: Compare original indexes when scores are the same.
(zeertzjq)
closes: #14988
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Cannot have buffer-local value for 'completeopt'
(Nick Jensen).
Solution: Make 'completeopt' global-local (zeertzjq).
Also for some reason test Test_ColonEight_MultiByte seems to be failing
sporadically now. Let's mark it as flaky.
fixes: #5487
closes: #14922
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: typos in some comments
(after v9.1.0466)
Solution: fix comments
(zeertzjq)
closes: #14919
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: no fuzzy-matching support for insert-completion
Solution: enable insert-mode completion with fuzzy-matching
using :set completopt+=fuzzy (glepnir).
closes: #14878
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: completion may be wrong when deleting all chars
Solution: reset compl_shown_match
closes: #14854
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
in 'cfu'
Problem: [security]: Heap buffer overflow when calling complete_add()
in the first call of 'completefunc'
Solution: Call check_cursor() after calling 'completefunc' (zeertzjq)
closes: #14391
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Typos in code and tests.
Solution: Fix typos (zeertzjq).
closes: #14321
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: complete_info() returns wrong order of items
(after v9.0.2018)
Solution: Revert Patch v9.0.2018
(Girish Palya)
bug fix: complete_info() gives wrong results
1) complete_info() reverses list of items during <c-p>
2) 'selected' item index is wrong during <c-p>
3) number of items returnd can be wrong
Solution:
- Decouple 'cp_number' from 'selected' index since they need not be
correlated
- Do not iterate the list backwards
- Add targeted tests
Regression introduced by https://github.com/vim/vim/commit/69fb5afb3bc9da24c2fb0eafb0027ba9c6502fc2
Following are unnecessary commits to patch problems from above:
https://github.com/vim/vim/commit/fef66301665027f1801a18d796f74584666f41ef
https://github.com/vim/vim/commit/daef8c74375141974d61b85199b383017644978c
All the tests from above commits are retained though.
fixes: #14204
closes: #14241
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Segfault with CompleteChanged autocommand
(markonm )
Solution: Test match->cp_prev for being NULL before accessing it
closes: #13929
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: complete_info() skips entries with 'noselect'
Solution: Check, if first entry is at original text state
Unfortunately, Commit daef8c74375141974d61b85199b383017644978c
introduced a regression, that when ':set completeopt+=noselect' is set
and no completion item has been selected yet, it did not fill the
complete_info['items'] list.
This happened, because the current match item did not have the
CP_ORIGINAL_TEXT flag set and then the cp->prev pointer did point to the
original flag item, which caused the following while loop to not being
run but being skipped instead.
So when the 'noselect' is set, only start with to the previous selection
item, if the initial completion item has the CP_ORIGINAL_TEXT flag set,
else use the 2nd previous item instead.
fixes: #13451
closes: #13452
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: CI fails because of trailing whitespace in test
Solution: Remove it
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Completion menu may be wrong
Solution: Check for the original direction of the completion menu,
add more tests, make it work with 'noselect'
completion: move in right direction when filling completion_info()
When moving through the insert completion menu and switching directions,
we need to make sure we start at the correct position in the list and
move correctly forward/backwards through it, so that we do not skip
entries and the selected item points to the correct entry in the list
of completion entries generated by the completion_info() function.
The general case is this:
1) CTRL-X CTRL-N, we will traverse the list starting from
compl_first_match and then go forwards (using the cp->next pointer)
through the list (skipping the very first entry, which has the
CP_ORIGINAL_TEXT flag set (since that is the empty/non-selected entry
2) CTRL-X CTRL-P, we will traverse the list starting from
compl_first_match (which now points to the last entry). The previous
entry will have the CP_ORIGINAL_TEXT flag set, so we need to start
traversing the list from the second prev pointer.
There are in fact 2 special cases after starting the completion menu
with CTRL-X:
3) CTRL-N and then going backwards by pressing CTRL-P again.
compl_first_match will point to the same entry as in step 1 above,
but since compl_dir_foward() has been switched by pressing CTRL-P
to backwards we need to pretend to be in still in case 1 and still
traverse the list in forward direction using the cp_next pointer
4) CTRL-P and then going forwards by pressing CTRL-N again.
compl_first_match will point to the same entry as in step 2 above,
but since compl_dir_foward() has been switched by pressing CTRL-N
to forwards we need to pretend to be in still in case 2 and still
traverse the list in backward direction using the cp_prev pointer
For the 'noselect' case however, this is slightly different again. When
going backwards, we only need to go one cp_prev pointer back. And
resting of the direction works again slightly different. So we need to
take the noselect option into account when deciding in which direction
to iterate through the list of matches.
related: #13402
related: #12971
closes: #13408
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: completion shows current word after completion restart
Solution: remove the word being completed after completion restart
The word being completed is shown in a completion list after completion
restart, because it isn't removed from the current buffer before
searching for matches.
Also adjust `Test_complete_add_onechar` to match the new behavior.
closes: #13349
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: nwounkn <nwounkn@gmail.com>
|
|
Problem: complete_info() returns wrong index
Solution: Make order of 'info' in completion_info consistent
Start the iteration from the same point and follow the same direction as
done when assigning the completion numbers. This way we remove the
dependence on the completion direction and make the order of 'info'
consistent.
closes: #12230
closes: #12971
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
|
|
Problem: Completion popup in wrong position with virtual text "above".
Solution: Adjust the column. (closes #12210)
|
|
Problem: Ballooneval interferes with Insert completion.
Solution: Ignore mouse-move events when completing. (closes #12094,
closes #12092)
|
|
Problem: Code style is not check in test scripts.
Solution: Add basic code style check for test files.
|
|
Problem: Some test function names do not match what they are doing.
Solution: Leave out user data for the test that is called "NoUserData".
(closes #11703)
|
|
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.
|
|
Problem: Using freed memory when 'tagfunc' wipes out buffer that holds
'complete'.
Solution: Make a copy of the option. Make sure cursor position is valid.
|
|
Problem: Insert complete tests leave a mapping behind.
Solution: Use a buffer-local mapping. (closes #11211)
|
|
Problem: 'completeopt' "longest" is not used for complete().
Solution: Also use "longest" for complete(). (Bjorn Linse, closes #11206)
|
|
Problem: Common names in test files causes tests to be flaky.
Solution: Use more specific names.
|
|
Problem: Error message for list argument could be clearer.
Solution: Include the argument number. (Yegappan Lakshmanan, closes #11027)
|
|
Problem: MS-Windows: completion test fails.
Solution: Adjust directory prefix.
|
|
Problem: Using common name in tests leads to flaky tests.
Solution: Rename files and directories to be more specific.
|
|
Problem: No test for what patch 9.0.0155 fixes.
Solution: Add a test. Fix typos. (closes #10822)
|
|
Problem: Reading past end of line with insert mode completion.
Solution: Check text length.
|
|
Problem: Plugins cannot change v:completed_item.
Solution: Make v:completed_item writeable. (Shougo Matsushita,
closes #10801)
|
|
Problem: Accessing uninitialized memory when completing long line.
Solution: Terminate string with NUL.
|
|
Problem: Reading past end of completion with duplicate match.
Solution: Check string length
|
|
Problem: Reading past end of completion with a long line and 'infercase'
set.
Solution: Allocate the string if needed.
|
|
Problem: The command line test is getting quite big.
Solution: Move command line window tests to a separate file.
|
|
Problem: With some completion reading past end of string.
Solution: Check the length of the string.
|
|
Problem: "textlock" is always zero.
Solution: Remove "textlock" and rename "textwinlock" to "textlock".
(closes #10489)
|
|
Problem: 'completefunc'/'omnifunc' error does not end completion.
Solution: Check if there was an error or exception. (closes #10486,
closes #4218)
|
|
Problem: :startinsert right after :stopinsert does not work when popup menu
is still visible.
Solution: Use ins_compl_active() instead of pum_visible(). (closes #10352)
|
|
Problem: Smart indenting does not work after completion.
Solution: Set "can_si". (Christian Brabandt, closes #10113, closes #558)
|
|
Problem: In the GUI a modifier is not recognized for the key typed after
CTRL-X, which may result in a mapping to be used. (Daniel
Steinberg)
Solution: Recognize a modifier starting with CSI. (closes #9889)
|
|
Problem: Wrong color for half of wide character next to pum scrollbar.
Solution: Redraw the screen cell with the right color. (closes #9874)
|
|
Problem: Vim9: using a script-local function requires using "s:" when
setting 'completefunc'.
Solution: Do not require "s:" in Vim9 script. (closes #9796)
|
|
Problem: Vim9: some tests fail.
Solution: Fix the tests, mostly by removing "s:".
|
|
Problem: Autoload tests fails.
Solution: Use export instead of name with #.
|
|
Problem: Vim9: can still use a global function without g: at the script
level.
Solution: Also check for g: at the script level. (issue #9637)
|
|
Problem: Vim9: finding global function without g: prefix but not finding
global variable is inconsistent.
Solution: Require using g: for a global function. Change the vim9.vim
script into a Vim9 script with exports. Fix that import in legacy
script does not work.
|
|
Problem: Insert mode completion is insufficiently tested.
Solution: Add more tests. Fix uncovered memory leak. (Yegappan Lakshmanan,
closes #9489)
|