Problem: When preparing the parameters for a code actions LSP request,
the code set `context.diagnostics` when processing the first LSP client,
and then reused those `context.diagnostics` for subsequent LSP clients.
This meant that the second and next LSP clients got diagnostics that
did not originate from them, and they did not get the diagnostics that
they sent.
Solution: Avoid setting `context.diagnostics` (which is referenced by
all clients). Instead, set `params.context.diagnostics` directly, which
is specific to a single client.
Fixes#30001
Caused by #29501
According to `CaseFolding-15.1.0.txt`, full casefolding should be
preferred over simple casefolding as it's considered to be more correct.
Since utf8proc already provides full casefolding it makes sense to
switch to it. This will also remove a lot of unnecessary build code.
Temporary exceptions are made for two sets characters:
- `ß` will still be considered `ß` (instead of `ss`) as using a full
casefolding requires interfering with upstream spell files in some
form.
- `İ` will still be considered `İ` (instead of `i̇`) as using full
casefolding requires making a value judgement on the "correct"
behavior. There are two, equally valid case-insensetive comparison for
this character according to unicode. It is essentially up to the
implementor to decide which conversion is correct. For this reason it
might make sense to allow users to decide which conversion should be
done as an added option to `casemap` in a future PR.
Problem: Code related to findfile() is spread out.
Solution: Put findfile() related code into a new source file. (Yegappan
Lakshmanan, closesvim/vim#3934)
5fd0f5052f
Keep functions related to wildcard expansion in path.c, as in Vim they
are now spread out among multiple files, which isn't really ideal.
Problem: tests: zip test still resets 'shellslash' option
Solution: Remove resetting the 'shellslash' option, the zip
plugin should now be able to handle this options
closes: vim/vim#1543491efcd115e
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: RestoreOpts() plugin called too often
Solution: use :defer to have the RestoreOpts() function
called when the function returns automatically
afea6b9468
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: the zip plugin duplicates a lot of code for displaying
warnings/errors
Solution: refactor common code into a generic Mess() function
8d52926857
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: zip plugin has no way to set/restore option values
Solution: Add the SetSaneOpts() and RestoreOpts() functions,
so options that cause issues are set to sane values
and restored back to their initial values later on.
(this affects the 'shellslash' option on windows, which also
changes how the shellescape() function works)
19636be55e
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: zip plugin tests for fnameescape() function
Solution: Remove the check, fnameescape() has been available since
7.1.299, it should nowadays always be available
33836d38b8
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: zip plugin uses :echo which does not store messages
Solution: use :echomsg instead of :echo so that messages are stored in
the message history
120c0dd815
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: zip plugin contains a lot of comments from the decho plugin
Solution: Clean up and remove un-used comments
a63f66e953
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: the zip plugin is not tested.
Solution: include tests (Damien)
closes: vim/vim#15411d7af21e746
Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
Problem: filecopy() may return wrong value when readlink() fails.
Solution: Set ret to -1 so that 0 is returned when readlink() fails.
(zeertzjq)
closes: vim/vim#15438da090f95df
In Vim a lot of filesystem functions have been moved to filepath.c.
However, some of these functions actually deal with file contents, and
Nvim's filesystem-related functions are spread out in a different way.
Therefore, it's better to use a different file for these functions.
Problem: Cannot browse zipfiles with the unzip program found
on FreeBSD.
Solution: Adjust command arguments.
Unzip found on FreeBSD complain about missing argument with the
zipinfo modifier '-Z -1'. Joining arguments seems to work
for both implementations.
Also change `:sil!` to `:sil` so that error messages are properly
reported (per review of Christian Brabandt).
related: vim/vim#15411f0e9b72c8f
Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
* do not capitalize after a double colon when introducing a list
* Capitalize a header line
closes: vim/vim#15433217d3c17c6
Co-authored-by: Christian Brabandt <cb@256bit.org>
Since #29315 we are also preprocessing header files in order to find
functions which need prototype declarations. gcc emits a spurious
"warning: #pragma once in main file" even when when you are just
using `gcc -E` which causes a bit of noise in compiler output.
As a workaround, surpress all warnings for this step, this should be pretty
much harmless as we will still get preprocessor warnings when doing
actual compilation `gcc -c` later.
reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89808
This also makes shada reading slightly faster due to avoiding
some copying and allocation.
Use keysets to drive decoding of msgpack maps for shada entries.
Problem:
- Current lua indentexpr does not indent for '(' ')'.
- Missing indent test for lua.
Solution:
- Match '(', ')' in `function GetLuaIndentIntern`.
- Add an indent test for lua.
closes: vim/vim#15364c0f7505ede
Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Problem: After 6f1cbfc9ab fnameescape()
is no longer called on the name of the file to be extracted.
However, while spaces indeed don't need to be escaped, unzip
treats '[' as a wildcard character, so it need to be escaped.
Solution: Escape '[' on both MS-Windows and Unix.
From the docs it seems '*' and '?' also need escaping, but they seem to
actually work without escaping.
fixes: neovim/neovim#29977closes: vim/vim#15427c5bdd66558
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Magenta background Todo is too bright and might interfere with DiffText.
Make it less strong, without background, bold.
closes: vim/vim#154236228481b8e
Co-authored-by: Maxim Kim <habamax@gmail.com>
Problem: some patterns are used as a replacement for several explicit
extension matches (like '%.[Ss][Yy][Ss]$', '%.php%d$', etc.).
They usually correspond to Vim's "ignore case" regexes (like
'*.sys\c') and "convenience" patterns to not define many of them (like
'*.php\d').
As matching extension directly is faster and more explicit, it should
be preferred.
Solution: move all such patterns to direct extension match.
Problem: some patterns are used as a replacement for one-two explicit
file matches (like '^[mM]akefile$'). As matching file name directly is
faster and more explicit, it should be preferred.
Solution: move those patterns to direct file name match.
NOTE: this is not strictly backwards compatible, because exact file
name matching is done *before* pattern matching. If user has
conflicting `vim.filetype.add()` call with high priority (like with
`pattern='file$'` and `priority=100`), after this change it will be
ignored (i.e. 'makefile' will match exactly).
Judging by converted cases, it seems reasonable to prefer exact
matches there.
Problem: [security] double-free in dialog_changed()
(SuyueGuo)
Solution: Only clear pointer b_sfname pointer, if it is different
than the b_ffname pointer. Don't try to free b_fname,
set it to NULL instead.
fixes: vim/vim#15403
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-46pw-v7qw-xc2fb29f4abcd4
Co-authored-by: Christian Brabandt <cb@256bit.org>
- common_function() has always been in evalfunc.c in Vim
- return_register() has always been in evalfunc.c in Vim
- get_user_input() was moved to ex_getln.c in Vim 8.1.1957
- tv_get_lnum_buf() was moved to typval.c in Vim 8.2.0847
Problem: filetype: goaccess config file not recognized
Solution: detect 'goaccess.conf' as goaccess filetype, also
include a basic syntax and ftplugin (Adam Monsen)
Add syntax highlighting for GoAccess configuration file.
GoAccess is a real-time web log analyzer and interactive viewer that
runs in a terminal in *nix systems or through your browser.
GoAccess home page: https://goaccess.iocloses: vim/vim#154140aa65b48fb
Co-authored-by: Adam Monsen <haircut@gmail.com>
Make `:Sexplore` / `:Hexplore` / `:Vexplore` commands honor the user
`&split{right,below}` settings (or netrw-specific `g:netrw_alt{o,v}`)
instead of hardcoding a split direction. Similarly, update banged
variants of the two latter commands to follow the inverted preference.
closes: vim/vim#15417c527d90fae
Co-authored-by: Ivan Shapovalov <intelfx@intelfx.name>
Problem:
Tests have lots of exec_lua calls which input blocks of code
provided as unformatted strings.
Solution:
Teach exec_lua how to handle functions.
When the cursor is moved we terminate any active OSC 8 sequences to
prevent the sequence from inadvertently spanning regions it is not meant
to span. However, if we do not also reset the TUI's active attr id
(print_attr_id) then the TUI does not "know" that it's current attribute
set has changed. When cursor_goto is called to wrap a line, the TUI does
not recompute the attributes so the OSC 8 sequence is not restarted
again.
When we terminate an OSC 8 sequence before moving the cursor, also reset
the active attr id so that the attributes are recomputed for URLs.