Commit Graph

19537 Commits

Author SHA1 Message Date
Gregory Anders
2abc799ffd fix(diagnostic): deepcopy diagnostics before clamping line numbers
The current 'clamp_line_numbers' implementation modifies diagnostics in
place, which can have adverse downstream side effects. Before clamping
line numbers, make a copy of the diagnostic. This commit also merges the
'clamp_line_numbers' method into a new 'get_diagnostics' local function
which also implements the more general "get" method. The public
'vim.diagnostic.get()' API now just uses this function (without
clamping). This has the added benefit that other internal API functions
that need to use get() no longer have to go through vim.validate.

Finally, reorganize the source code a bit by grouping all of the data
structures together near the top of the file.
2021-11-19 11:37:45 -07:00
James McCoy
9ec4417afc
Merge pull request #16066 from neovim/marvim/ci-version-update
version.c: update [skip ci]
2021-11-19 11:54:24 -05:00
James McCoy
7942fb7074
Merge pull request #16091 from neovim/marvim/api-doc-update/master
docs: regenerate
2021-11-19 11:53:53 -05:00
Christian Clason
a7ad509902
fix(eval): fixup for empty modifier in fnamemodify (#16368)
* fix(eval): fixup for empty modifier in fnamemodify

1dbbaf89bf
erroneously removed a check for empty modifier and a PVS fix. 
Restore that check and fix.

Fixes #16367

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2021-11-19 16:13:49 +01:00
zeertzjq
349b9ce9df vim-patch:8.2.3622: "verbose pwd" shows confusing info
Problem:    "verbose pwd" shows confusing info when :lcd does not change
            directory.
Solution:   Clear last_chdir_reason also when the directory does not change.
            (closes vim/vim#9160)
64be6aa3a5

This only ports the tests, as this is already Nvim's behavior.
2021-11-19 20:07:04 +08:00
zeertzjq
3d504f27a0 vim-patch:8.2.3618: getcwd() is unclear about how 'autochdir' is used
Problem:    getcwd() is unclear about how 'autochdir' is used.
Solution:   Update the help for getcwd().  Without any arguments always return
            the actual current directory. (closes vim/vim#9142)
851c7a699a
2021-11-19 20:07:04 +08:00
zeertzjq
54e9cce612 revert: partially revert #9894
Vim has a solution to #9892 with fewer side-effects in patch 8.2.3618
2021-11-19 20:07:04 +08:00
zeertzjq
4785cad8ee vim-patch:8.2.3617: ":verbose pwd" does not mention 'autochdir' was applied
Problem:    ":verbose pwd" does not mention 'autochdir' was applied.
Solution:   Remember the last chdir was done by 'autochdir'.  (issue vim/vim#9142)
0526815c15
2021-11-19 20:07:04 +08:00
zeertzjq
0f58ba10e2 vim-patch:8.2.3468: problem with :cd when editing file in non-existent directory
Problem:    Problem with :cd when editing file in non-existent directory. (Yee
            Cheng Chin)
Solution:   Prepend the current directory to get the full path. (closes vim/vim#8903)
c6376c7984
2021-11-19 20:07:04 +08:00
Shougo Matsushita
2c431943d6 fix: remove unneeded gzip check 2021-11-19 13:45:41 +09:00
Shougo Matsushita
e9819ca709 fix: error 2021-11-19 13:45:41 +09:00
Shougo Matsushita
c11cf6b415 test: save clipboard 2021-11-19 13:45:41 +09:00
Shougo Matsushita
9bcbb7f9d2 fix: shell problem 2021-11-19 13:45:41 +09:00
Shougo Matsushita
cf4af351a6 fix: fix GZIP error 2021-11-19 13:45:41 +09:00
Shougo Matsushita
18d7ec36f3 fix: remove unnecessary changes 2021-11-19 13:45:41 +09:00
Shougo Matsushita
a11cec08e5 fix: for reviews 2021-11-19 13:45:41 +09:00
Shougo Matsushita
dd63d93931 fix: disable clipboard when test registers 2021-11-19 13:45:40 +09:00
Shougo Matsushita
77c2edcacb fix: remove previous executed directories to execute tests locally 2021-11-19 13:45:40 +09:00
Shougo Matsushita
4cb8a399c7 fix: add cd for local execution 2021-11-19 13:45:40 +09:00
Shougo Matsushita
133d79a358 vim-patch:8.2.3616: arglist test does not clear the argument list consistently
Problem:    Arglist test does not clear the argument list consistently.
Solution:   Call Reset_arglist(). (Shougo Matsushita, closes vim/vim#9154)
3cad470385
2021-11-19 13:45:29 +09:00
marvim
b43b6efa34 version.c: update [skip ci] 2021-11-19 03:07:56 +00:00
marvim
2d340a3746 docs: regenerate 2021-11-18 21:50:55 +00:00
Michael Lingelbach
f71be1f87b
fix(lsp): improve incremental sync robustness (#16358)
closes https://github.com/neovim/neovim/issues/16352

* improve handling of multi-byte deletions
2021-11-18 16:49:46 -05:00
Mathias Fußenegger
d249e18bbf
fix(uri): use valid EmmyLua annotations (#16359)
See:

- https://emmylua.github.io/annotations/param.html
- https://emmylua.github.io/annotations/return.html
2021-11-18 21:12:21 +01:00
James McCoy
722647dd8c
Merge pull request #16356 from clason/bump-luarocks
build(deps): bump luarocks to 3.8.0
2021-11-18 14:41:14 -05:00
Gregory Anders
5e46f649e2
fix(diagnostic): don't use nil col if missing from qflist (#16357)
If the quickfixlist item doesn't contain a column it is reported as 0.
Rather than using a nil value in such a case (which breaks diagnostics
elsewhere), just keep the 0 value.
2021-11-18 12:27:46 -07:00
Gregory Anders
a42a9accab
Merge pull request #16355 from mjlbach/fix/docgen-again 2021-11-18 11:31:31 -07:00
Gregory Anders
8081a30ca8 docs: mark tagfunc.lua methods as private 2021-11-18 11:30:09 -07:00
Michael Lingelbach
0746f0021f fix(docgen): add tagfunc.lua 2021-11-18 11:30:09 -07:00
Christian Clason
cab542c0f9 build(deps): bump luarocks to 3.8.0 2021-11-18 18:55:36 +01:00
Michael Lingelbach
f940e7a5b9
feat(lsp): add tagfunc (#16103) 2021-11-18 12:26:26 -05:00
zeertzjq
36538417f0
vim-patch:01164a6546b4 (#16335)
missing changes to src/nvim/po/check.vim from 01164a6546 (diff-ed3e88d59856bb5b62b2a394fb8c7293cd5794531e0718c0aa2d3d768d7973d1)
2021-11-17 21:28:20 -05:00
zeertzjq
1f68a21d66
vim-patch:8.2.3593: directory is wrong after executing "lcd" with win_execute() (#16314)
Problem:    Directory is wrong after executing "lcd" with win_execute().
Solution:   Correct the directory when going back to the original window.
            (closes vim/vim#9132)
7f13b24ab6
2021-11-17 21:18:55 -05:00
zeertzjq
dba3590a0e
vim-patch:8.2.3591: no event is triggered when closing a window (#16306)
Problem:    No event is triggered when closing a window.
Solution:   Add the WinClosed event. (Naohiro Ono, closes vim/vim#9110)
23beefed73

Nvim has already implemented this feature, so this only changes tests
and docs.
2021-11-17 21:11:09 -05:00
zeertzjq
5ff972cafe
vim-patch:8.2.3522: cannot use \x and \u when setting 'listchars' (#16049)
Problem:    Cannot use \x and \u when setting 'listchars'.
Solution:   Support hex and unicode in hex form. (closes vim/vim#9006)
93ff6720fe
2021-11-17 20:55:59 -05:00
Michael Lingelbach
eb3d59126e
fix(lsp): change signature of buf_highlight_references (#16345)
the prior signature did not assume an active language client
this function can now be used directly by passing an offset encoding
defaults to utf-16 (standard for LSP)
2021-11-17 21:14:45 +01:00
Christian Clason
c0efe49e78
vim-patch:519cc559b08b (#16340)
Update runtime files
519cc559b0
2021-11-17 10:02:59 +01:00
zeertzjq
145fc69df9 vim-patch:8.2.3588: break statement is never reached
Problem:    Break statement is never reached.
Solution:   Rely on return value of set_chars_option() not changing.
            (closes vim/vim#9103)
606efc7df4
2021-11-17 07:11:46 +08:00
zeertzjq
8dbe47a4bc vim-patch:8.2.3572: memory leak when closing window and using "multispace"
Problem:    Memory leak when closing window and using "multispace" in
            'listchars'.
Solution:   Free the memory. (closes vim/vim#9071)
7a33ebfc5b
2021-11-17 07:11:46 +08:00
zeertzjq
5ed2a5cf9c vim-patch:8.2.2520: missing tests for 'listchars'
Problem:    Missing tests for 'listchars'.
Solution:   Add a few more checks. (Yegappan Lakshmanan, closes vim/vim#7854)
04ea7e9049
2021-11-17 07:11:46 +08:00
zeertzjq
7528bcec42 fix(options): using :set fillchars should clear local value 2021-11-17 07:11:46 +08:00
zeertzjq
8c24e1462c vim-patch:8.2.2518: 'listchars' should be window-local
Problem:    'listchars' should be window-local.
Solution:   Make 'listchars' global-local. (Yegappan Lakshmanan, Marco Hinz,
            closes vim/vim#5206, closes vim/vim#7850)
eed9d46293

Nvim already has this feature, but it implements :set listchars the same
as :setglobal listchars, which is incorrect. Vim's implementation of
:set listchars is correct: using :set listchars clears local value.
2021-11-17 07:11:40 +08:00
dundargoc
eba317d7a9
refactor: reduce number of explicit char casts (#16077)
* refactor: reduce number of explicit char casts
2021-11-16 20:27:59 +01:00
Christian Clason
99211b008c
vim-patch:8.2.3604: not all sudoers files are recognized (#16338)
Problem:    Not all sudoers files are recognized.
Solution:   Add a file pattern. (Doug Kearns, closes vim/vim#1192)
c143fa0778
2021-11-16 18:34:39 +01:00
Christian Clason
b5eab2a98a
vim-patch:8.2.3603: fish filetype not recognized (#16337)
Problem:    Fish filetype not recognized.
Solution:   Add a file pattern and match script line. (Doug Kearns)
b1b163efd7
2021-11-16 18:26:03 +01:00
Gregory Anders
8fb09bc512
Merge pull request #16328 from gpanders/diagnostic-prefix-hi 2021-11-16 08:48:26 -07:00
Gregory Anders
98af683e0f
refactor(diagnostic): make bufnr arguments consistent (#16323)
Make the bufnr argument have similar semantics across API functions;
namely, a nil value means "all buffers" while 0 means "current buffer".
This increases the flexibility of the API by allowing functions such as
enable() and disable() to apply globally or per-namespace, rather than
only on a specific buffer.
2021-11-16 08:47:49 -07:00
Christian Clason
890f8cd750
Merge pull request #16330 from clason/vim-8.2.3598
vim-patch:8.2.3598,3599,3600: some filetypes are not recognized
2021-11-16 13:38:07 +01:00
Christian Clason
75959d04c4 vim-patch:8.2.3600: filetype test fails
Problem:    Filetype test fails.
Solution:   Add missint change.
314b773abb
2021-11-16 13:04:14 +01:00
Christian Clason
b20429c8a5 vim-patch:8.2.3599: not all gdbinit files are recognized
Problem:    Not all gdbinit files are recognized.
Solution:   Add "gdbinit". (Doug Kearns)
782b4bbc16
2021-11-16 12:40:50 +01:00