Commit Graph

23843 Commits

Author SHA1 Message Date
dundargoc
5f7560b8da
build(editorconfig): set indent_size to 4 for python files (#21135) 2022-11-21 06:53:29 -07:00
Raphael
2bb244af31
feat(lsp): support set title in lsp relate floatwindow (#21110) 2022-11-21 11:06:14 +01:00
beardedsakimonkey
126ef65e5b
feat(diagnostic): add suffix option to virt_text config (#21140)
This introduces a `suffix` option to the `virt_text` config in
`vim.diagnostic.config()`. The suffix can either be a string which is appended
to the diagnostic message or a function returning such. The function receives a
`diagnostic` argument, which is the diagnostic table of the last diagnostic (the
one whose message is rendered as virt text).
2022-11-20 16:57:36 -07:00
beardedsakimonkey
fbce9f421a
feat(diagnostic): add suffix option to open_float() (#21130)
Closes #18687

This introduces a `suffix` option to `vim.diagnostic.open_float()` (and
consequently `vim.diagnostic.config()`) that appends some text to each
diagnostic in the float.

It accepts the same types as `prefix`. For multiline diagnostics, the suffix is
only appended to the last line. By default, the suffix will render the
diagnostic error code, if any.
2022-11-20 13:09:35 -07:00
zeertzjq
565442ec42
Merge pull request #21136 from zeertzjq/vim-9.0.0913
vim-patch:9.0.{partial:0913,0915}: only change in current window triggers the WinScrolled event
2022-11-20 22:00:13 +08:00
zeertzjq
d6bd9c7733 test: add a test for #18222 2022-11-20 21:38:29 +08:00
zeertzjq
91c192922d vim-patch:9.0.0915: WinScrolled may trigger immediately when defined
Problem:    WinScrolled may trigger immediately when defined.
Solution:   Initialize the fields in all windows. (closes vim/vim#11582)

2996773276

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-20 21:24:22 +08:00
zeertzjq
035d41ac5e vim-patch:partial:9.0.0913: only change in current window triggers the WinScrolled event
Problem:    Only a change in the current window triggers the WinScrolled
            event.
Solution:   Trigger WinScrolled if any window scrolled or changed size.
            (issue vim/vim#11576)

0a60f79fd0

Skip locking of window layout and E1312.
Copy the latest version of all WinScrolled tests from Vim.
Note: patch 9.0.0915 is needed for the Lua tests to pass.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-20 21:11:37 +08:00
dundargoc
822eabc5e1
docs(support): update tested versions (#21126) 2022-11-20 18:42:30 +08:00
dundargoc
cb27c09930
test: use isCI to simplify CI detection (#21134) 2022-11-20 18:26:21 +08:00
Raphael
6e8ed5abaa
perf(diagnostic): use api variable and improve validate (#21111)
* fix(diagnostic): use api variable and improve validate

* fix: fix test case
2022-11-19 06:41:47 -07:00
Jakub Łuczyński
4650af38f0
test: fix failing tui_spec.lua tests (#21117)
* refactor(test): use exec_lua

* fix(test): fix failing tui_spec tests

test is failing when path of tty-test does not fit cmdline
2022-11-19 20:46:04 +08:00
Grzegorz Rozdzialik
cfdf5e6f37
fix(lsp): ignore hover and signatureHelp responses on buffer change (#21121)
Language servers can take some time to respond to the
`textDocument/hover` and `textDocument/signatureHelp` messages. During
that time, the user could have already moved to another buffer. The
popup was always shown in the current buffer, which could be a different
one than the buffer for which the request was sent.

This was particularly annoying when moving to a buffer with a `BufLeave`
autocmd, as that autocmd was triggered when the hover popup was shown
for the original buffer.

Ignoring the response from these 2 messages if they are for a buffer
that is not the current one leads to less noise. The popup will only be
shown for the buffer for which it was requested.

A more robust solution could involve cancelling the hover/signatureHelp
request if the buffer changes so the language server can free its
resources. It could be implemented in the future.
2022-11-19 12:27:00 +01:00
Sean Dewar
7c57f06b63
vim-patch:partial:d13166e788fc (#21109)
Update runtime files

d13166e788

- Skip E1309-1311 (not ported).
- Skip `:echowindow` changes (not ported).
- Skip termdebug winbar doc changes (not fully ported).
- Port missing `g:termdebug_config.{wide,use_prompt}` changes from v8.2.5010.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-19 10:31:51 +00:00
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