Commit Graph

50 Commits

Author SHA1 Message Date
zeertzjq
57b731818d vim-patch:9.0.0567: 'completeopt' "longest" is not used for complete()
Problem:    'completeopt' "longest" is not used for complete().
Solution:   Also use "longest" for complete(). (Bjorn Linse, closes vim/vim#11206)
87af60c915
2022-09-24 21:16:43 +08:00
zeertzjq
3290e472c0 vim-patch:8.2.4037: Insert mode completion is insufficiently tested
Problem:    Insert mode completion is insufficiently tested.
Solution:   Add more tests.  Fix uncovered memory leak. (Yegappan Lakshmanan,
            closes vim/vim#9489)
370791465e
2022-08-25 08:27:44 +08:00
zeertzjq
cabc1861c4 vim-patch:8.2.3989: some insert completion code is not tested
Problem:    Some insert completion code is not tested.
Solution:   Add a few tests.  Refactor thesaurus completion. (Yegappan
            Lakshmanan, closes vim/vim#9460)
e982586f8e

vim-patch:9.0.0254: typo in function name

Problem:    Typo in function name.
Solution:   Rename the function. (closes vim/vim#10971)
5fb3aabc2b
2022-08-25 08:27:44 +08:00
zeertzjq
dd77a00621 vim-patch:9.0.0102: reading past end of line with insert mode completion
Problem:    Reading past end of line with insert mode completion.
Solution:   Check text length.
a6f9e30016
2022-08-25 06:53:59 +08:00
zeertzjq
6680002169 vim-patch:9.0.0060: accessing uninitialized memory when completing long line
Problem:    Accessing uninitialized memory when completing long line.
Solution:   Terminate string with NUL.
b9e717367c
2022-08-25 06:53:59 +08:00
zeertzjq
5d1f0c3eca vim-patch:9.0.0046: reading past end of completion with duplicate match
Problem:    Reading past end of completion with duplicate match.
Solution:   Check string length
baefde1455
2022-08-25 06:53:59 +08:00
zeertzjq
c366a63e4c vim-patch:9.0.0045: reading past end of completion with a long line
Problem:    Reading past end of completion with a long line and 'infercase'
            set.
Solution:   Allocate the string if needed.
caea66442d

Cherry-pick the deletion of a blank line from patch 9.0.0027.

N/A patches for version.c:

vim-patch:9.0.0054: compiler warning for size_t to int conversion

Problem:    Compiler warning for size_t to int conversion.
Solution:   Add type cast. (Mike Williams, closes vim/vim#10741)
c7bd2f08e5
2022-08-25 06:53:59 +08:00
zeertzjq
b0569f5813
vim-patch:9.0.0020: with some completion reading past end of string (#19922)
Problem:    With some completion reading past end of string.
Solution:   Check the length of the string.
f12129f171
2022-08-24 16:59:03 +08:00
zeertzjq
9ac44c7f5d vim-patch:8.2.3944: insert mode completion functions are too long
Problem:    Insert mode completion functions are too long.
Solution:   Split up into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9431)
5d2e007ccb

Cherry-pick can_cindent_get() -> get_can_cindent() from patch 8.1.2062.
2022-08-24 15:47:15 +08:00
zeertzjq
ef748af01d vim-patch:8.2.3937: Insert mode completion function is too long
Problem:    Insert mode completion function is too long.
Solution:   Refactor into multiple functions. (Yegappan Lakshmanan,
            closes vim/vim#9423)
edc6f10390

Cherry-pick a typo fix from patch 8.2.3637.
2022-08-24 15:47:14 +08:00
zeertzjq
2c522854c7 vim-patch:9.0.0118: no test for what patch 9.0.0155 fixes
Problem:    No test for what patch 9.0.0155 fixes.
Solution:   Add a test. Fix typos.  (closes vim/vim#10822)
750209459c
2022-07-31 18:51:06 +08:00
zeertzjq
7d9e68669c
vim-patch:9.0.0092: plugins cannot change v:completed_item (#19542)
Problem:    Plugins cannot change v:completed_item.
Solution:   Make v:completed_item writeable. (Shougo Matsushita,
            closes vim/vim#10801)
61021aa318
2022-07-28 05:19:38 +08:00
zeertzjq
1f1863ed54
vim-patch:8.2.4502 (#19439)
vim-patch:8.2.4502: in the GUI a modifier is not recognized after CTRL-X

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 vim/vim#9889)
d979d64fa2

Code is N/A. This just ports the test change.
Test depends on README.txt in testdir. Add that file.
Reorder test_ins_complete.vim to match upstream.
2022-07-21 06:00:16 +08:00
zeertzjq
006334f3a7 vim-patch:8.2.2427: can still switch windows for 'completefunc'
Problem:    Can still switch windows for 'completefunc'.
Solution:   Also disallow switching windows for other completions.
3eb6bd9c2b

Assert E565 instead of E578.
Need to assert a different string because patch 8.2.1919 hasn't been
ported yet.
2022-07-17 13:51:46 +08:00
zeertzjq
f72ec95958 vim-patch:8.2.2426: allowing 'completefunc' to switch windows causes trouble
Problem:    Allowing 'completefunc' to switch windows causes trouble.
Solution:   use "textwinlock" instead of "textlock".
28976e2acc

Assert E565 instead of E578.

vim-patch:8.2.0670: cannot change window when evaluating 'completefunc'

Problem:    Cannot change window when evaluating 'completefunc'.
Solution:   Make a difference between not changing text or buffers and also
            not changing window.
6adb9ea0a6

vim-patch:8.2.5029: "textlock" is always zero

Problem:    "textlock" is always zero.
Solution:   Remove "textlock" and rename "textwinlock" to "textlock".
            (closes vim/vim#10489)
cfe456543e
2022-07-17 13:51:46 +08:00
zeertzjq
b0bbcfa239 vim-patch:8.2.2424: some tests are known to cause an error with ASAN
Problem:    Some tests are known to cause an error with ASAN.
Solution:   Add CheckNotAsan.
97202d9516

Move CheckNotMSWindows to the right place.
Omit test_memory_usage.vim: a Lua test is used for this file.
2022-07-17 13:51:46 +08:00
zeertzjq
95b1191505 vim-patch:8.2.0698: insert mode completion not fully tested
Problem:    Insert mode completion not fully tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#6041)
f9ab52e155

Cherry-pick test_ins_complete.vim changes from patches 8.2.{0522,0615}.
2022-07-17 13:51:39 +08:00
zeertzjq
e53330a603 vim-patch:8.2.0655: search code not sufficiently tested
Problem:    Search code not sufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5999)
224a5f17c6

Cherry-pick test_charsearch.vim change from patch 8.2.0448.
Cherry-pick test_search.vim changes from patch 8.2.0619.
2022-07-17 10:03:58 +08:00
zeertzjq
880de9a489
test(old): align defaults to Vim after every test (#19301)
This can avoid divergences from Vim in some small places.
2022-07-10 06:59:58 +08:00
zeertzjq
a5175fe489
vim-patch:8.2.5022: 'completefunc'/'omnifunc' error does not end completion (#19083)
Problem:    'completefunc'/'omnifunc' error does not end completion.
Solution:   Check if there was an error or exception. (closes vim/vim#10486,
            closes vim/vim#4218)
9bcb9ca9c7
2022-06-25 18:38:35 +08:00
zeertzjq
6798f1fab0
vim-patch:8.2.4865: :startinsert right after :stopinsert may not work (#18418)
Problem:    :startinsert right after :stopinsert does not work when popup menu
            is still visible.
Solution:   Use ins_compl_active() instead of pum_visible(). (closes vim/vim#10352)
cd5dbad184
2022-05-05 06:58:20 +08:00
zeertzjq
65a5cea0d3
vim-patch:8.2.4710: smart indenting does not work after completion (#18030)
Problem:    Smart indenting does not work after completion.
Solution:   Set "can_si". (Christian Brabandt, closes vim/vim#10113, closes vim/vim#558)
ac72c21da6
2022-04-08 07:12:47 +08:00
zeertzjq
fe621b4ac0 vim-patch:8.1.0711: test files still use function!
Problem:    Test files still use function!.
Solution:   Remove the exclamation mark.  Fix overwriting a function.
1e1153600c

Some of the changes were already applied previously.
2022-02-07 05:34:20 +08:00
Sean Dewar
796224028b
vim-patch:8.2.3629: command completion in cmdline window uses global commands
Problem:    Command completion in cmdline window uses global user commands,
            not local commands for the window where it was opened from.
Solution:   Use local commands. (closes vim/vim#9168)
a119812437
2022-01-30 22:25:15 +00:00
zeertzjq
8e945c2524 vim-patch:8.2.1762: when a timer uses :stopinsert completion isn't stopped
Problem:    When a timer uses :stopinsert Insert mode completion isn't
            stopped. (Stanley Chan)
Solution:   Call ins_compl_prep(ESC).
d0e1b7103c
2022-01-15 22:33:16 +08:00
zeertzjq
9697023a0b
vim-patch:8.2.3389: cannot stop insert mode completion without side effects #15538
Problem:    Cannot stop insert mode completion without side effects.
Solution:   Add CTRL-X CTRL-Z. (closes vim/vim#8821)
dca29d9cf4
2021-09-10 17:14:32 -07:00
Gregory Anders
d8ab8cccd0 test: update tests to work with 'hidden' 2021-08-18 12:17:12 -06:00
Andy K. Massimino
6519b18471 vim-patch:8.2.0088: insufficient tests for tags; bug in using extra tag field
Problem:    Insufficient tests for tags; bug in using extra tag field when
            using an ex command to position the cursor.
Solution:   Fix the bug, add more tests. (Yegappan Lakshmanan, closes vim/vim#5439)
830c1afc9d
2021-03-21 10:37:45 -04:00
Jan Edmund Lazo
7bbe8a4900
vim-patch:8.2.2130: Insert mode completion messages end up in message history
Problem:    Insert mode completion messages end up in message history.
Solution:   Set msg_hist_off. (closes vim/vim#7452
cc2335896b
2020-12-12 14:07:16 -05:00
Jan Edmund Lazo
f85386d170
vim-patch:8.2.1907: complete_info().selected may be wrong
Problem:    Complete_info().selected may be wrong.
Solution:   Update cp_number if it was never set. (issue vim/vim#6945)
f9d51354de

Misc changes:

For variables and function parameters that use "Direction" enum values,
update their type from from "int" to "Direction".
It is hard to review function parameters that must accept
"Direction" enum values only.
2020-12-03 18:58:29 -05:00
Jan Edmund Lazo
6bc1844b11
vim-patch:8.2.1673: complete_info() selected index has an invalid value
Problem:    complete_info() selected index has an invalid value. (Ben Jackson)
Solution:   Set the index when there is only one match. (closes vim/vim#6945)
            Add test for complete_info().
b806aa5bd9
2020-12-03 18:58:29 -05:00
skippi
6a0cb2a948 vim-patch:8.2.1747: result of expand() unexpectedly depends on 'completeslash'
Problem:    Result of expand() unexpectedly depends on 'completeslash'.
Solution:   Temporarily reset 'completeslash'. (Yasuhiro Matsumoto,
            closes vim/vim#7021)
8f187fc630
2020-10-26 15:22:23 -05:00
skippi
f8fd3d44ac vim-patch:8.1.1791: 'completeslash' also applies to globpath()
Problem:    'completeslash' also applies to globpath().
Solution:   Add the WILD_IGNORE_COMPLETESLASH flag. (test by Yasuhiro
            Matsumoto, closes vim/vim#4760)
2020-10-26 15:22:23 -05:00
skippi
089f4f8e4a vim-patch:8.1.1769: 'shellslash' is also used for completion
Problem:    'shellslash' is also used for completion.
Solution:   Add the 'completeslash' option. (Yasuhiro Matsumoto, closes vim/vim#3612)
ac3150d385
2020-10-26 15:20:12 -05:00
Jan Edmund Lazo
a868cd920a
vim-patch:8.2.1901: variable completion does not work in command line window
Problem:    Variable completion does not work in command line window.
Solution:   Use the "prevwin". (closes vim/vim#7198)
4ff2f2fb6b

N/A patches for version.c:

vim-patch:8.2.1899: crash in out-of-memory situation

Problem:    Crash in out-of-memory situation.
Solution:   Bail out if shell_name is NULL. (Dominique Pellé, closes vim/vim#7196)
67def64a4e
2020-10-25 12:48:37 -04:00
Jan Edmund Lazo
2bfe2018d6
vim-patch:8.2.0007: popup menu positioned wrong with folding in two tabs
Problem:    Popup menu positioned wrong with folding in two tabs.
Solution:   Update the cursor line height. (closes vim/vim#5353)
09dd2bb336
2020-10-08 19:04:51 -04:00
Blaž Hrastnik
c477b19bdc vim-patch:8.2.0084: complete item "user_data" can only be a string
Problem:    Complete item "user_data" can only be a string.
Solution:   Accept any type of variable. (closes vim/vim#5412)
0892832bb6
2020-04-29 11:15:49 +09:00
Jan Edmund Lazo
5ede2766c8
vim-patch:8.2.0158: triggering CompleteDone earlier is not backwards compatible
Problem:    Triggering CompleteDone earlier is not backwards compatible.
            (Daniel Hahler)
Solution:   Add CompleteDonePre instead.
3f169ce17e
2020-01-26 21:50:37 -05:00
Jan Edmund Lazo
ad35cbca76
vim-patch:8.2.0123: complete_info() does not work when CompleteDone is triggered
Problem:    complete_info() does not work when CompleteDone is triggered.
Solution:   Trigger CompleteDone before clearing the info.
17e04781f2
2020-01-17 23:46:00 -05:00
Jan Edmund Lazo
3d0c3148fb
vim-patch:8.1.1139: no test for what is fixed in patch 8.1.0716
Problem:    No test for what is fixed in patch 8.1.0716.
Solution:   Add a test. (Yasuhiro Matsumoto, closes vim/vim#3797)
9845f36aa6
2020-01-17 23:18:25 -05:00
Jan Edmund Lazo
9a9bb9186a
vim-patch:8.1.0716: get warning message when 'completefunc' returns nothing
Problem:    Get warning message when 'completefunc' returns nothing.
Solution:   Allow for returning v:none to suppress the warning message.
            (Yasuhiro Matsumoto, closes vim/vim#3789)
cee9bc2e3d
2020-01-17 23:09:32 -05:00
Jan Edmund Lazo
7a0a2eb310
vim-patch:8.1.1732: completion in cmdwin does not work for buffer-local commands
Problem:    Completion in cmdwin does not work for buffer-local commands.
Solution:   Use the right buffer. (closes vim/vim#4711)
f03e328348
2019-11-24 23:37:10 -05:00
cangscop
dedcd3ad1e vim-patch:8.1.0053 use typval_T in the caller of call_vim_function
Problem:	unreliable types for complete function arguments
Solution:	fix argument type for functions w/ unreliable type conversion(Ozaki Kiichi)
vim/vim#2993
2019-07-28 00:19:41 +02:00
Jan Edmund Lazo
ed2d651b50 vim-patch:8.0.1482: using feedkeys() does not work to test completion
Problem:    Using feedkeys() does not work to test Insert mode completion.
            (Lifepillar)
Solution:   Do not check for typed keys when executing :normal or feedkeys().
            Fix thesaurus completion not working when 'complete' is empty.
02ae9b4a93
2019-06-24 00:09:28 -04:00
Jan Edmund Lazo
9fe472c91b vim-patch:8.1.0258: not enough testing for the CompleteDone event
Problem:    Not enough testing for the CompleteDone event.
Solution:   Add a test. (closes vim/vim#3297)
af559d2c9f
2018-11-17 08:20:22 -05:00
Jan Edmund Lazo
eaf8e57cf9 vim-patch:8.0.1242: function argument with only dash is seen as number zero
Problem:    Function argument with only dash is seen as number zero. (Wang
            Shidong)
Solution:   See a dash as a string. (Christian Brabandt)
ffd99f729b
2018-08-22 13:06:04 -04:00
Shougo
00665d3c70 vim-patch:8.0.1493: completion items cannot be annotated (#8003)
Problem:    Completion items cannot be annotated.
Solution:   Add a "user_data" entry to the completion item. (Ben Jackson,
            coses vim/vim#2608, closes vim/vim#2508)

9b56a57cda
2018-02-18 23:56:59 +01:00
Justin M. Keyes
c68d89521f vim-patch:8.0.1271: still too many old style tests
Problem:    Still too many old style tests.
Solution:   Convert a few more tests to new style. (Yegappan Lakshmanan,
            closes vim/vim#2290)

fb094e14c1
2018-02-12 00:48:30 +01:00
Justin M. Keyes
9b6ed6c71c vim-patch:8.0.1224: still interference between test functions
Problem:    Still interference between test functions.
Solution:   Clear autocommands. Wipe all buffers.  Fix tests that depend on a
            specific start context.

cf1ba35fc2
2018-02-11 19:03:27 +01:00
Justin M. Keyes
2de447b60c vim-patch:8.0.1221: still too many old style tests
Problem:    Still too many old style tests.
Solution:   Convert a few more tests to new style. (Yegappan Lakshmanan,
            closes vim/vim#2256)

15993ce921
2018-02-11 15:29:19 +01:00