summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_ins_complete.vim
AgeCommit message (Collapse)Author
2024-06-19patch 9.1.0503: cannot use fuzzy keyword completionv9.1.0503glepnir
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>
2024-06-16patch 9.1.0493: Test for patch 9.1.0489 doesn't fail without the fixv9.1.0493zeertzjq
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>
2024-06-15patch 9.1.0489: default completion may break with fuzzyv9.1.0489glepnir
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>
2024-06-14patch 9.1.0487: completed item not update on fuzzy completionv9.1.0487glepnir
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>
2024-06-14patch 9.1.0484: Sorting of completeopt+=fuzzy is not stablev9.1.0484zeertzjq
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>
2024-06-05patch 9.1.0469: Cannot have buffer-local value for 'completeopt'v9.1.0469zeertzjq
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>
2024-06-05patch 9.1.0467: typos in some commentsv9.1.0467zeertzjq
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>
2024-06-03patch 9.1.0463: no fuzzy-matching support for insert-completionv9.1.0463glepnir
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>
2024-05-27patch 9.1.0447: completion may be wrong when deleting all charsv9.1.0447glepnir
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>
2024-04-02patch 9.1.0254: [security]: Heap buffer overflow when calling complete_add() ↵v9.1.0254zeertzjq
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>
2024-03-28patch 9.1.0220: Few typos in source and test filesv9.1.0220zeertzjq
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>
2024-03-20patch 9.1.0190: complete_info() returns wrong order of itemsv9.1.0190Girish Palya
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>
2024-01-29patch 9.1.0065: Segfault with CompleteChanged autocommandv9.1.0065Christian Brabandt
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>
2023-11-04patch 9.0.2090: complete_info() skips entries with 'noselect'v9.0.2090Christian Brabandt
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>
2023-10-27patch 9.0.2077: CI fails because of trailing whitespace in testv9.0.2077Christian Brabandt
Problem: CI fails because of trailing whitespace in test Solution: Remove it Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-27patch 9.0.2074: Completion menu may be wrongv9.0.2074Christian Brabandt
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>
2023-10-17patch 9.0.2039: completion shows current word after completion restartv9.0.2039nwounkn
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>
2023-10-11patch 9.0.2018: complete_info() returns wrong indexv9.0.2018LemonBoy
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>
2023-03-31patch 9.0.1432: completion popup in wrong position with virtual text "above"v9.0.1432Bram Moolenaar
Problem: Completion popup in wrong position with virtual text "above". Solution: Adjust the column. (closes #12210)
2023-03-02patch 9.0.1371: ballooneval interferes with Insert completionv9.0.1371zeertzjq
Problem: Ballooneval interferes with Insert completion. Solution: Ignore mouse-move events when completing. (closes #12094, closes #12092)
2023-01-28patch 9.0.1257: code style is not check in test scriptsv9.0.1257Bram Moolenaar
Problem: Code style is not check in test scripts. Solution: Add basic code style check for test files.
2022-12-15patch 9.0.1062: some test function names do not match what they are doingv9.0.1062zeertzjq
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)
2022-09-29patch 9.0.0625: too many delete() calls in testsv9.0.0625Bram Moolenaar
Problem: Too many delete() calls in tests. Solution: Use deferred delete where possible.
2022-09-24patch 9.0.0579: using freed memory when 'tagfunc' wipes out bufferv9.0.0579Bram Moolenaar
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.
2022-09-24patch 9.0.0572: insert complete tests leave a mapping behindv9.0.0572zeertzjq
Problem: Insert complete tests leave a mapping behind. Solution: Use a buffer-local mapping. (closes #11211)
2022-09-24patch 9.0.0567: 'completeopt' "longest" is not used for complete()v9.0.0567bfredl
Problem: 'completeopt' "longest" is not used for complete(). Solution: Also use "longest" for complete(). (Bjorn Linse, closes #11206)
2022-09-02patch 9.0.0363: common names in test files causes tests to be flakyv9.0.0363Bram Moolenaar
Problem: Common names in test files causes tests to be flaky. Solution: Use more specific names.
2022-09-01patch 9.0.0345: error message for list argument could be clearerv9.0.0345Bram Moolenaar
Problem: Error message for list argument could be clearer. Solution: Include the argument number. (Yegappan Lakshmanan, closes #11027)
2022-08-29patch 9.0.0325: MS-Windows: completion test failsv9.0.0325Bram Moolenaar
Problem: MS-Windows: completion test fails. Solution: Adjust directory prefix.
2022-08-29patch 9.0.0323: using common name in tests leads to flaky testsv9.0.0323Bram Moolenaar
Problem: Using common name in tests leads to flaky tests. Solution: Rename files and directories to be more specific.
2022-07-31patch 9.0.0118: no test for what patch 9.0.0155 fixesv9.0.0118zeertzjq
Problem: No test for what patch 9.0.0155 fixes. Solution: Add a test. Fix typos. (closes #10822)
2022-07-28patch 9.0.0102: reading past end of line with insert mode completionv9.0.0102Bram Moolenaar
Problem: Reading past end of line with insert mode completion. Solution: Check text length.
2022-07-27patch 9.0.0092: plugins cannot change v:completed_itemv9.0.0092Shougo Matsushita
Problem: Plugins cannot change v:completed_item. Solution: Make v:completed_item writeable. (Shougo Matsushita, closes #10801)
2022-07-23patch 9.0.0060: accessing uninitialized memory when completing long linev9.0.0060Bram Moolenaar
Problem: Accessing uninitialized memory when completing long line. Solution: Terminate string with NUL.
2022-07-07patch 9.0.0046: reading past end of completion with duplicate matchv9.0.0046Bram Moolenaar
Problem: Reading past end of completion with duplicate match. Solution: Check string length
2022-07-07patch 9.0.0045: reading past end of completion with a long linev9.0.0045Bram Moolenaar
Problem: Reading past end of completion with a long line and 'infercase' set. Solution: Allocate the string if needed.
2022-07-02patch 9.0.0027: the command line test is getting quite bigv9.0.0027Bram Moolenaar
Problem: The command line test is getting quite big. Solution: Move command line window tests to a separate file.
2022-07-01patch 9.0.0020: with some completion reading past end of stringv9.0.0020Bram Moolenaar
Problem: With some completion reading past end of string. Solution: Check the length of the string.
2022-05-27patch 8.2.5029: "textlock" is always zerov8.2.5029zeertzjq
Problem: "textlock" is always zero. Solution: Remove "textlock" and rename "textwinlock" to "textlock". (closes #10489)
2022-05-26patch 8.2.5022: 'completefunc'/'omnifunc' error does not end completionv8.2.5022LemonBoy
Problem: 'completefunc'/'omnifunc' error does not end completion. Solution: Check if there was an error or exception. (closes #10486, closes #4218)
2022-05-04patch 8.2.4865: :startinsert right after :stopinsert may not workv8.2.4865zeertzjq
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)
2022-04-07patch 8.2.4710: smart indenting does not work after completionv8.2.4710Christian Brabandt
Problem: Smart indenting does not work after completion. Solution: Set "can_si". (Christian Brabandt, closes #10113, closes #558)
2022-03-04patch 8.2.4502: in the GUI a modifier is not recognized after CTRL-Xv8.2.4502Bram Moolenaar
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)
2022-03-03patch 8.2.4497: wrong color for half of wide character next to pum scrollbarv8.2.4497Bram Moolenaar
Problem: Wrong color for half of wide character next to pum scrollbar. Solution: Redraw the screen cell with the right color. (closes #9874)
2022-02-18patch 8.2.4416: Vim9: using a script-local function requires using "s:"v8.2.4416Bram Moolenaar
Problem: Vim9: using a script-local function requires using "s:" when setting 'completefunc'. Solution: Do not require "s:" in Vim9 script. (closes #9796)
2022-02-12patch 8.2.4361: Vim9: some tests failv8.2.4361Bram Moolenaar
Problem: Vim9: some tests fail. Solution: Fix the tests, mostly by removing "s:".
2022-01-30patch 8.2.4265: autoload tests failsv8.2.4265Bram Moolenaar
Problem: Autoload tests fails. Solution: Use export instead of name with #.
2022-01-30patch 8.2.4260: Vim9: can still use a global function without g:v8.2.4260Bram Moolenaar
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)
2022-01-29patch 8.2.4257: Vim9: finding global function without g: prefix inconsistentv8.2.4257Bram Moolenaar
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.
2022-01-08patch 8.2.4037: Insert mode completion is insufficiently testedv8.2.4037Yegappan Lakshmanan
Problem: Insert mode completion is insufficiently tested. Solution: Add more tests. Fix uncovered memory leak. (Yegappan Lakshmanan, closes #9489)