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.
* 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>
Problem: "verbose pwd" shows confusing info when :lcd does not change
directory.
Solution: Clear last_chdir_reason also when the directory does not change.
(closesvim/vim#9160)
64be6aa3a5
This only ports the tests, as this is already Nvim's behavior.
Problem: getcwd() is unclear about how 'autochdir' is used.
Solution: Update the help for getcwd(). Without any arguments always return
the actual current directory. (closesvim/vim#9142)
851c7a699a
Problem: ":verbose pwd" does not mention 'autochdir' was applied.
Solution: Remember the last chdir was done by 'autochdir'. (issue vim/vim#9142)
0526815c15
Problem: Problem with :cd when editing file in non-existent directory. (Yee
Cheng Chin)
Solution: Prepend the current directory to get the full path. (closesvim/vim#8903)
c6376c7984
Problem: Arglist test does not clear the argument list consistently.
Solution: Call Reset_arglist(). (Shougo Matsushita, closesvim/vim#9154)
3cad470385
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.
Problem: Directory is wrong after executing "lcd" with win_execute().
Solution: Correct the directory when going back to the original window.
(closesvim/vim#9132)
7f13b24ab6
Problem: No event is triggered when closing a window.
Solution: Add the WinClosed event. (Naohiro Ono, closesvim/vim#9110)
23beefed73
Nvim has already implemented this feature, so this only changes tests
and docs.
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)
Problem: 'listchars' should be window-local.
Solution: Make 'listchars' global-local. (Yegappan Lakshmanan, Marco Hinz,
closesvim/vim#5206, closesvim/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.
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.