Commit Graph

23829 Commits

Author SHA1 Message Date
Mathias Fußenegger
af204dd0f1
feat(lsp): run handler in coroutine to support async response (#21026)
To illustrate a use-case this also changes `window/showMessageRequest`
to use `vim.ui.select`
2022-11-19 10:48:49 +01:00
zeertzjq
0958dccc6d
vim-patch:8.2.5130: edit test for mode message fails when using valgrind (#21118)
Problem:    Edit test for mode message fails when using valgrind.
Solution:   Use WaitForAssert().  Run beep test later.

c5382b667a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-19 16:39:30 +08:00
zeertzjq
c011747b5f
vim-patch:8.2.5148: invalid memory access when using expression on command line (#21113)
Problem:    Invalid memory access when using an expression on the command line.
Solution:   Make sure the position does not go negative.

6046aded8d

N/A patches for version.c:

vim-patch:8.2.5149: cannot build without the +eval feature

Problem:    Cannot build without the +eval feature. (Tony Mechelynck)
Solution:   Add #ifdefs.

6689df024b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-19 14:12:45 +08:00
zeertzjq
92e51d7e4b
vim-patch:8.2.5167: get(Fn, 'name') on funcref returns special byte code (#21112)
Problem:    get(Fn, 'name') on funcref returns special byte code.
Solution:   Use the printable name.

1ae8c262df

Cherry-pick printable_func_name() from patch 8.2.0149.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-19 12:47:44 +08:00
zeertzjq
f2b30b4d62
vim-patch:8.2.0260: several lines of code are duplicated (#21108)
Problem:    Several lines of code are duplicated.
Solution:   Move duplicated code to a function. (Yegappan Lakshmanan,
            closes vim/vim#5330)

f4140488c7

Using sizeof seems better than ARRAY_SIZE for vim_snprintf().
2022-11-19 10:57:06 +08:00
XDream8
db407010fa
feat(clipboard): added wayclip support (#21091) 2022-11-18 08:39:56 -07:00
zeertzjq
2360c98456
Merge pull request #21104 from zeertzjq/vim-8.2.0469
vim-patch:8.2.{0450,0469}
2022-11-18 22:44:01 +08:00
zeertzjq
a4114f16bf vim-patch:8.2.0469: Vim9: no error for missing ] after list
Problem:    Vim9: no error for missing ] after list.
Solution:   Add error message. Add more tests.

ee619e5bc0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-18 22:30:49 +08:00
zeertzjq
fdeb20ddde vim-patch:8.2.0450: not enough testing for restricted mode and function calls
Problem:    Not enough testing for restricted mode and function calls.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5847)

7d941ee032
2022-11-18 22:30:47 +08:00
zeertzjq
88d0d7ad10
Merge pull request #21103 from zeertzjq/vim-8.2.4553
vim-patch:8.2.{4553,4562}: linear tag search is not optimal
2022-11-18 21:00:21 +08:00
zeertzjq
346c96a33f vim-patch:8.2.4562: linear tag search is not optimal
Problem:    Linear tag search is not optimal.
Solution:   Improve linear tag search performance. (Yegappan Lakshmanan,
            closes vim/vim#9944)

b29b96806f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 20:35:20 +08:00
zeertzjq
6a5fbabe48 vim-patch:8.2.4553: linear tag search is a bit slow
Problem:    Linear tag search is a bit slow.
Solution:   Remove a vim_ftell() call. (Yegappan Lakshmanan, closes vim/vim#9937)

8b530b3158

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 20:05:00 +08:00
zeertzjq
cf759c7429
Merge pull request #21102 from zeertzjq/vim-8.2.4512
vim-patch:8.2.{4512,4518,4538,4543,4544}: find_tags_in_file() function is too long
2022-11-18 20:01:09 +08:00
zeertzjq
30e6cc405f vim-patch:8.2.4544: Coverity warnings for not using returned value
Problem:    Coverity warnings for not using returned value.
Solution:   Assign to vim_ignored.

dbf8094b17

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-18 19:41:54 +08:00
zeertzjq
b2345ddbf3 vim-patch:8.2.4543: Coverity warning for refactored tag search code
Problem:    Coverity warning for refactored tag search code.
Solution:   Avoid the warnings.  Update comments.  Add one more test case.
            (Yegappan Lakshmanan, closes vim/vim#9928)

20fb28b1dc

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 19:41:54 +08:00
zeertzjq
136112a869 vim-patch:8.2.4538: the find_tags_in_file() function is too long
Problem:    The find_tags_in_file() function is too long.
Solution:   Refactor into smaller functions. (Yegappan Lakshmanan,
            closes vim/vim#9920)

bf40e90dfe

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 19:41:54 +08:00
zeertzjq
e41469a5b5 vim-patch:8.2.4518: the binary tag search feature is always enabled
Problem:    The binary tag search feature is always enabled.
Solution:   Remove the #ifdefs.  Add a few more tests. (Yegappan Lakshmanan,
            closes vim/vim#9893)

655b734ee8

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 19:41:54 +08:00
zeertzjq
6f08ea0131 vim-patch:8.2.4512: the find_tags_in_file() function is much too long
Problem:    The find_tags_in_file() function is much too long.
Solution:   Refactor into multiple smaller functions. (Yegappan Lakshmanan,
            closes vim/vim#9892)

df1bbea436

Cherry-pick Test_tag_file_encoding() changes from patch 8.2.1432.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 19:41:53 +08:00
zeertzjq
f70963f838
Merge pull request #21101 from zeertzjq/vim-8.2.4494
vim-patch:8.2.{4494,4496}: find_tags() function is too long
2022-11-18 15:24:39 +08:00
zeertzjq
41c85ac2ef vim-patch:8.2.4496: Coverity gives warnings after tags code refactoring
Problem:    Coverity gives warnings after tags code refactoring.
Solution:   Avoid the warnings. (Yegappan Lakshmanan, closes vim/vim#9882)

fe9112e630
2022-11-18 14:59:18 +08:00
zeertzjq
245035d6db vim-patch:8.2.4494: the find_tags() function is much too long
Problem:    The find_tags() function is much too long.
Solution:   Refactor the function. (Yegappan Lakshmanan, closes vim/vim#9869)

2f87a99b6e

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-18 14:59:18 +08:00
zeertzjq
282cbc2350
vim-patch:8.2.3776: when a tags file line is long a tag may not be found (#21099)
Problem:    When a tags file line is long a tag may not be found.
Solution:   When increasing the buffer size read the same line again.

f8e9eb8e17

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-18 11:16:11 +08:00
Sizhe Zhao
ba04fffe98
feat(l10n): update zh_CN translations (#21085) 2022-11-18 08:43:56 +08:00
zeertzjq
790d12b95f
fix(ex_cmds): fix a mistake in the porting of Vim patch 8.1.0306 (#21096) 2022-11-18 08:14:17 +08:00
Matthew Gramigna
523b1943c3
vim-patch:9.0.0897: Clinical Quality Language files are not recognized (#21094)
Problem:    Clinical Quality Language files are not recognized.
Solution:   Add the "*.cql" pattern. (Matthew Gramigna, closes vim/vim#11452)

12babe45a3

Co-authored-by: mgramigna <mgramigna@mitre.org>
2022-11-18 00:39:31 +01:00
zeertzjq
510429fc5c
vim-patch:8.2.1497: CursorHold test is flaky (#21095)
Problem:    CursorHold test is flaky. (Jakub Kądziołka)
Solution:   Use WaitForAssert() (closes vim/vim#6754)

17f67547f3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-18 06:47:51 +08:00
bfredl
7b158e766b
Merge pull request #21078 from dundargoc/refactor/remove-wint
refactor: remove __STDC_ISO_10646__ check
2022-11-17 21:20:11 +01:00
zeertzjq
1f6d36c2c4
Merge pull request #21090 from zeertzjq/vim-8.2.2945
vim-patch:8.2.{2945,2952,2960,2973,2981,3080,3103,3440,3498},9.0.0895: recover tests
2022-11-17 23:53:58 +08:00
Gregory Anders
32cba4cee6
Merge pull request #20956 from gpanders/lua-readsecure
feat: implement vim.secure.read() and use it for 'exrc'
2022-11-17 08:47:41 -07:00
zeertzjq
4b7aafc2f4 fix(memline): use long instead of linenr_T for db_line_count 2022-11-17 23:30:56 +08:00
zeertzjq
7139035bfd vim-patch:9.0.0895: file renamed twice in test, missing feature check
Problem:    File renamed twice in test; missing feature check.
Solution:   Remove a rename() call.  Add check for cryptv feature.
            (closes vim/vim#11564)

780154bf7a

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2022-11-17 23:30:56 +08:00
Gregory Anders
6d9c3d903e refactor: deprecate 'secure' option
Now that 'exrc' files must be explicitly marked trusted there is no need
to constrain what can be done in them.
2022-11-17 08:23:41 -07:00
Gregory Anders
294910a1ff feat(exrc): use vim.secure.read() for 'exrc' option 2022-11-17 08:23:41 -07:00
Gregory Anders
f1922e78a1 feat: add vim.secure.read()
This function accepts a path to a file and prompts the user if the file
is trusted. If the user confirms that the file is trusted, the contents
of the file are returned. The user's decision is stored in a trust
database at $XDG_STATE_HOME/nvim/trust. When this function is invoked
with a path that is already marked as trusted in the trust database, the
user is not prompted for a response.
2022-11-17 08:23:41 -07:00
dundargoc
51a48d482e refactor: remove __STDC_ISO_10646__ check
We can always assume wchar_t values are unicode codepoints for the
systems we support, so this check isn't necessary.
2022-11-17 16:12:34 +01:00
zeertzjq
c269b8dcae vim-patch:8.2.3498: recover test may fail on some systems
Problem:    Recover test may fail on some systems.
Solution:   Adjust the little endian and 64 bit detection. (James McCoy,
            closes vim/vim#8941)

37f341d723

Co-authored-by: James McCoy <jamessan@jamessan.com>
2022-11-17 23:03:31 +08:00
zeertzjq
d8fc390bd0 vim-patch:8.2.3440: recover test fails if there is an old swap file
Problem:    Recover test fails if there is an old swap file.
Solution:   Delete old swap files.

f2a8bafa4b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 23:02:59 +08:00
zeertzjq
acfc3d54c6 vim-patch:8.2.3103: swap test may fail on some systems
Problem:    Swap test may fail on some systems when jobs take longer to exit.
Solution:   Use different file names.

f33cae6050

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 23:02:26 +08:00
zeertzjq
c1c2c7b316 vim-patch:8.2.3080: recover test fails on 32bit systems
Problem:    Recover test fails on 32bit systems. (Ondřej Súkup)
Solution:   Detect 32/64 bit systems. (Yegappan Lakshmanan, closes vim/vim#8485,
            closes vim/vim#8479)

576cb75ceb

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 23:01:09 +08:00
zeertzjq
fa17dc1e1b vim-patch:8.2.2981: recovery test is not run on big-endian systems
Problem:    Recovery test is not run on big-endian systems.
Solution:   Make it work on big-endian systems. (James McCoy, closes vim/vim#8368)

6654ca702c

Co-authored-by: James McCoy <jamessan@jamessan.com>
2022-11-17 23:00:43 +08:00
zeertzjq
f12a45c45e vim-patch:8.2.2973: fix for recovery and diff mode not tested
Problem:    Fix for recovery and diff mode not tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8352)

3044324e8d

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 22:59:33 +08:00
zeertzjq
a8f54a94c1 vim-patch:8.2.2960: swap file recovery not sufficiently tested
Problem:    Swap file recovery not sufficiently tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8339)

8cf02e5cf8

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 22:56:39 +08:00
zeertzjq
442a7e89b8 vim-patch:8.2.2952: recover test fails on big endian systems
Problem:    Recover test fails on big endian systems.
Solution:   Disable the failing test on big endian systems. (Yegappan
            Lakshmanan, closes vim/vim#8335)

99285550a9

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 22:53:24 +08:00
zeertzjq
3f75f25f9c vim-patch:8.2.2945: some buffer related code is not tested
Problem:    Some buffer related code is not tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#8320)

59b262362f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-17 22:45:14 +08:00
zeertzjq
9736605672
Merge pull request #21089 from zeertzjq/vim-8.2.2586
vim-patch:8.2.{2586,2587,2589}: process id may be invalid
2022-11-17 22:38:39 +08:00
zeertzjq
a77be32cf9 test: add a Lua test for swap file created before boot
Change the file modification time instead of uptime.
2022-11-17 22:17:48 +08:00
zeertzjq
5176ed88f6 vim-patch:8.2.2589: recover test hangs in the GUI
Problem:    Recover test hangs in the GUI.
Solution:   Add g:skipped_reason to skip a _nocatch_ test.

776b954622

Now always skip the test as test_override() is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 20:34:37 +08:00
zeertzjq
1ab08e23b3 vim-patch:8.2.2587: recover test fails on FreeBSD
Problem:    Recover test fails on FreeBSD.
Solution:   Check for Linux.

6635ae1437

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 20:34:37 +08:00
zeertzjq
ec5c1c35c2 vim-patch:8.2.2586: process id may be invalid
Problem:    Process id may be invalid.
Solution:   Use sysinfo.uptime to check for recent reboot. (suggested by Hugo
            van der Sanden, closes vim/vim#7947)

f52f0606ed

test_override() is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 20:34:33 +08:00
zeertzjq
0a4c5cd2b2
Merge pull request #21087 from zeertzjq/vim-8.2.1970
vim-patch:8.2.{1970,2016,2019,2026,2044,3041,3042}: check if process of swap file is still running
2022-11-17 19:38:57 +08:00