Commit Graph

23862 Commits

Author SHA1 Message Date
Paul Schyska
b26cf45fec
build(nix): update nixpkgs
Update flake and drop now superfluous libvterm-neovim override
2022-11-24 00:29:12 +01:00
zeertzjq
d25889ab76
Merge pull request #21163 from zeertzjq/vim-9.0.0925
vim-patch:9.0.{0925,0926,0927}
2022-11-23 20:40:46 +08:00
zeertzjq
27fceca501 refactor: maybe suppress a PVS warning 2022-11-23 20:03:06 +08:00
zeertzjq
65d95fa415 vim-patch:9.0.0926: Coverity warns for not using return value of dict_add()
Problem:    Coverity warns for not using return value of dict_add().
Solution:   When dict_add() fails then don't call hash_remove().

bc222152d8

N/A patches for version.c:

vim-patch:9.0.0927: Coverity warns for using a NULL pointer

Problem:    Coverity warns for using a NULL pointer.
Solution:   Check for memory allocaion failure.

96cbbe29de

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-23 19:59:43 +08:00
zeertzjq
e339376cca vim-patch:9.0.0925: two conditions are always false
Problem:    Two conditions are always false.
Solution:   Remove the conditions.  Update return value types to make clear
            what could be returned. (closes vim/vim#11593)

df3c0eb41e
2022-11-23 19:59:38 +08:00
zeertzjq
f1b88ced07
fix(options): fix local 'sidescrolloff' doesn't work for mouse (#21162)
Missing part of Vim patch 8.1.0864.
2022-11-23 12:14:16 +08:00
zeertzjq
4571ba4d0a
vim-patch:partial:9.0.0917: the WinScrolled autocommand event is not enough (#21161)
Problem:    The WinScrolled autocommand event is not enough.
Solution:   Add WinResized and provide information about what changed.
            (closes vim/vim#11576)

35fc61cb5b

Omit "func_name" comment in tv_dict_extend(): Vim9 script only.
Skip layout locking and E1312.
Skip list_alloc_with_items() and list_set_item().

Since this overrides remaining changes in patch 9.0.0913, that patch can
now be marked as fully ported:

vim-patch:9.0.0913: only change in current window triggers the WinScrolled event

N/A patches for version.c:

vim-patch:9.0.0919: build failure with tiny features

Problem:    Build failure with tiny features.
Solution:   Adjust #ifdef's.

9c5b7cb4cf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-23 09:54:48 +08:00
Christian Clason
d41e93d5a8
vim-patch:9.0.0922: Mermaid files are not recognized (#21160)
Problem:    Mermaid files are not recognized.
Solution:   Add patterns for Mermaid. (Crag MacEachern)

364438d1e8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 23:28:49 +01:00
Christian Clason
915891f28c
build(deps): update viml parser and queries (#21158) 2022-11-22 21:25:51 +01:00
bfredl
cd386b2c72
Merge pull request #20151 from dundargoc/refactor/char_u/13
refactor: replace char_u with char 13: remove `STRLEN` part 3
2022-11-22 11:02:24 +01:00
dundargoc
5eb5f49488
test: simplify platform detection (#21020)
Extend the capabilities of is_os to detect more platforms such as
freebsd and openbsd. Also remove `iswin()` helper function as it can be
replaced by `is_os("win")`.
2022-11-22 08:13:30 +08:00
dundargoc
7c10774860
refactor: remove old TODO comments that aren't relevant anymore (#21144) 2022-11-22 08:09:33 +08:00
dundargoc
0cbc23d3cc
fix: pvs warnings (#21145)
* fix(PVS/V009): start file with special comment

* fix(PVS/V501): identical sub-expressions for comparison

* fix(PVS/V560): part of conditional expression is always true/false

* fix(PVS/V593): review expression of type A = B < C

* fix(PVS/V614): potentially uninitialized variable used
2022-11-22 08:07:45 +08:00
zeertzjq
edd0de9821
Merge pull request #21149 from zeertzjq/vim-9.0.0916
vim-patch:8.2.{2435,2479},9.0.0916
2022-11-22 07:55:08 +08:00
zeertzjq
9b76875235 vim-patch:9.0.0916: getbufline() is inefficient for getting a single line
Problem:    getbufline() is inefficient for getting a single line.
Solution:   Add getbufoneline().

ce30ccc06a

Cherry-pick part of usr_41.txt from patch 8.1.1628.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 07:21:26 +08:00
zeertzjq
5836c89ed0 vim-patch:8.2.2479: set/getbufline test fails without the job feature
Problem:    set/getbufline test fails without the job feature.
Solution:   Check whether the job feature is supported. (Dominique Pellé,
            closes vim/vim#7790)

00385114db

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 07:11:50 +08:00
zeertzjq
ef5dfe6c65 vim-patch:8.2.2435: setline() gives an error for some types
Problem:    setline() gives an error for some types.
Solution:   Allow any type, convert each item to a string.

3445320839

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-22 07:11:50 +08:00
Mathias Fußenegger
904d0056d5
fix(diagnostic): correct type annotations; add Diagnostic type (#21120)
Some functions didn't include the `nil` case in the return type
annotation. This corrects those and also adds a Diagnostic class
definition for the diagnostic.get return type
2022-11-21 22:02:18 +01:00
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
Dundar Göc
40f3f75867 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2022-11-19 16:27:10 +01: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