Age | Commit message (Collapse) | Author |
|
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)
|
|
Problem: Some insert completion code is not tested.
Solution: Add a few tests. Refactor thesaurus completion. (Yegappan
Lakshmanan, closes #9460)
|
|
Problem: Insert mode completion functions are too long.
Solution: Split up into multiple functions. (Yegappan Lakshmanan,
closes #9431)
|
|
Problem: Insert mode completion function is too long.
Solution: Refactor into multiple functions. (Yegappan Lakshmanan,
closes #9423)
|
|
Problem: illegal memory access when completing with invalid bytes.
Solution: Avoid going over the end of the completion text.
|
|
Problem: Cannot use script-local function for setting *func options.
Solution: Use the script context. (Yegappan Lakshmanan, closes #9362)
|
|
Problem: Setting *func options insufficiently tested.
Solution: Impove tests. (Yegappan Lakshmanan, closes #9337)
|
|
Problem: Lambda for option that is a function may be garbage collected.
Solution: Set a reference in the funcref. (Yegappan Lakshmanan,
closes #9330)
|
|
Problem: Options that take a function insufficiently tested.
Solution: Add additional tests and enhance existing tests. (Yegappan
Lakshmanan, closes #9298)
|
|
Problem: might crash when callback is not valid.
Solution: Check for valid callback. (Yegappan Lakshmanan, closes #9293)
|
|
Problem: Cannot assign a lambda to an option that takes a function.
Solution: Automatically convert the lambda to a string. (Yegappan
Lakshmanan, closes #9286)
|
|
Problem: Cannot use a lambda for 'imactivatefunc'.
Solution: Add lambda support for 'imactivatefunc' and 'imstatusfunc'.
(Yegappan Lakshmanan, closes #9275)
|
|
Problem: Cannot use a lambda for 'completefunc' and 'omnifunc'.
Solution: Implement lambda support. (Yegappan Lakshmanan, closes #9257)
|