Problem: Not always using GA_CONCAT_LITERAL with string literals.
(after: v9.2.0031)
Solution: Use the GA_CONCAT_LITERAL, instead of ga_concat_len.
(John Marriott)
closes: vim/vim#19468fc90d8087a
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem: Inefficient use of ga_concat()
Solution: Use ga_concat_len() when the length is already known to avoid
use of strlen() (John Marriott).
closes: vim/vim#19422ed202035b1
Co-authored-by: John Marriott <basilisk@internode.on.net>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Problem:
TUI does not support several standard SGR text attributes:
- dim/faint (SGR 2)
- blink (SGR 5)
- conceal (SGR 8)
- overline (SGR 53)
This means that when a program running in the embedded terminal emits
one of these escape codes, we drop it and don't surface it to the
outer terminal.
Solution:
- Add support for those attributes.
- Also add corresponding flags to `nvim_set_hl` opts, so users can set
these attributes in highlight groups.
- refactor(highlight): widen `HlAttrFlags` from `int16_t` to `int32_t`
Widen the `rgb_ae_attr` and `cterm_ae_attr` fields in HlAttrs from
int16_t to int32_t to make room for new highlight attribute flags,
since there was only one spare bit left.
- The C flag is named HL_CONCEALED to avoid colliding with the
existing HL_CONCEAL in syntax.h (which is a syntax group flag, not
an SGR attribute).
- Also note that libvterm doesn't currently support the dim and overline
attributes, so e.g. `printf '\e[2mThis should be dim\n'` and `printf
'\e[53mThis should have an overline\n'` are still not rendered
correctly when run from the embedded terminal.
Problem: filetype: sh filetype used for env files
Solution: Detect *.env and .env.* files as env filetype,
detect .envrc and .envrc.* as sh filetype,
include a simple env syntax script (DuckAfire)
Previously, .env files were handled by the shell syntax. While
functional, this limited the ability to support specific .env
implementations, such as CodeIgniter4 which allows dots in keys
(e.g., "foo.bar=0").
The new dedicated 'env' filetype and syntax script improves legibility
and prevents highlighting from breaking when encountering spaces.
Currently, the syntax does not support indentation; fields, variables,
and comments must start at the beginning of the line.
closes: vim/vim#19260d0fa375629
Co-authored-by: DuckAfire <155199080+duckafire@users.noreply.github.com>
The Progress syntax file gained `set expandtab` in 4c3f536f4 (updated
for version 7.0d01, 2006-04-11). The Progress language itself doesn't
distinguish between tabs and spaces for indentation, so this seems like
something that should be left to user preference; but the setting is
accompanied by the comment "The Progress editor doesn't cope with tabs
very well", so there may be reason to keep it.
However, using `set` means that any new buffers created after editing a
Progress file will also have `expandtab` turned on, which is likely
contrary to a user's expectations. We should use `setlocal` instead to
avoid this.
closes: vim/vim#19458342ae5f8aa
Co-authored-by: Daniel Smith <daniel@rdnlsmith.com>
Problem: completion: hang with line completion and fuzzy (Jesse Pavel)
Solution: Only check the line number when wrapping around the file
(Hirohito Higashi).
fixes: vim/vim#19434closes: vim/vim#19443d8648f7279
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Problem: When 'autocomplete' fires before compl_leader is initialized,
the prefix filter is bypassed. This allows non-prefix matches
(e.g. from fuzzy omnifuncs) to be shown in the popup menu and
incorrectly preinserted.
Solution: In get_leader_for_startcol(), if compl_leader.string is NULL,
fall back to using compl_orig_text as a filter for matches
starting at or after the completion column (Hirohito Higashi).
When 'autocomplete' first fires, compl_leader is NULL because
ins_compl_start() has not set it yet. This caused the prefix filter in
ins_compl_build_pum(), find_next_completion_match() and
find_common_prefix() to be bypassed, allowing non-prefix fuzzy omnifunc
matches to appear in the PUM and be preinserted.
Extend get_leader_for_startcol() to fall back to compl_orig_text when
compl_leader.string is NULL: if the match's cpt source startcol is less
than compl_col the match includes pre-compl_col text, so return
&compl_leader (NULL string) to signal "pass through"; otherwise return
&compl_orig_text so callers filter by the original text. The compl_col
<= 0 guard is kept only for the prepend-text path to avoid it
interfering with the NULL-leader fallback when compl_col is zero.
With this change all callers of get_leader_for_startcol() automatically
receive the correct filter string without additional helpers.
Also update Test_autocomplete_trigger Test 9 to reflect the new
behavior: 'faberge' is no longer shown when completing 'foo' because
it does not start with the current prefix.
Add Test_autocomplete_preinsert_null_leader() to verify that only
prefix-matching candidates appear in the PUM and are preinserted.
fixes: vim/vim#19328closes: vim/vim#19447a04ae0210b
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This is a better way to prevent parallel tests from interfering with
each other, as there are many ways files can be created and deleted in
tests, so enforcing different file names is hard.
Using $TMPDIR can also work in most cases, but 'backipskip' etc. have
special defaults for $TMPDIR.
Symlink runtime/, src/, test/ and README.md to Xtest_xdg dir to make
tests more convenient (and symlinking test/ is required for busted).
Also, use README.md instead of test/README.md in the Ex mode inccommand
test, as test/README.md no longer contains 'N' char.
Problem: matchadd() conceal may use unrelated syntax cchar.
Solution: Only use syntax cchar when syntax_flags has HL_CONCEAL
(zeertzjq).
closes: vim/vim#19459d01f234ec1
Problem: UIs put ins-completion "scanning" messages one after another,
which are meant to overwrite the previous message.
Solution: Ensure the msg_show "replace_last" parameter is set.
Problem: Fake LSP server does not timeout or respond to SIGTERM as it
does not run the event loop.
Solution: Instead of io.read(), use stdioopen()'s on_stdin callback to
accumulate input and use vim.wait() to wait for input.
Also, in the test suite, don't stop a session when it's not running, as
calling uv.stop() outside uv.run() will instead cause the next uv.run()
to stop immediately, which cancels the next RPC request.
Problem: If buffer has attached LSP servers and none of them supports
`textDocument/documentLink` method, typing `gx` results in a warning
about that.
Solution: Explicitly check that at least one server supports the target
method before making the LSP request.
Problem: Reading files with lines approaching MAXCOL length crashes
with segfault due to colnr_T overflow.
Solution: The split check 'linerest >= MAXCOL' fired too late because
linerest could grow by up to 'size' bytes before the next
check. Change threshold to 'linerest >= MAXCOL - size' to
ensure the line passed to ml_append() stays within colnr_T
range.
Note: supported by AI claude
fixes: vim/vim#17935
closes: vim/vim#18953
closes: vim/vim#193326cc291da06
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: ml_append_int() crashes when appending lines near MAXCOL
length due to signed integer overflow in space_needed
calculation.
Solution: Change 'space_needed' from int to long to handle the
'len + INDEX_SIZE' computation without overflow. Update
db_free comparison casts from (int) to (long) to match.
Note: supported by AI claude
related: vim/vim#17935
related: vim/vim#18953
related: vim/vim#193320ece393844
Co-authored-by: Christian Brabandt <cb@256bit.org>
When running out of memory in a libuv callback, try_to_free_memory()
will call mf_release_all(). In this case, mf_sync() cannot call
os_breakcheck() as it'll run the libuv loop recursively, so check
main_loop.recursive to prevent that.
Also fix another possible problem that a terminal buffer may have a
swapfile when encountering an OOM in e.g. terminal_alloc().
Problem: `install_deps.sh` tries to install `ninja` on macOS, but it is
installed on the runners by default, triggering warnings (and wasting
time) on CI.
Solution: Don't `brew install ninja`.
This was added before there was a dedicated language server for
tree-sitter queries. Now that https://github.com/ribru17/ts_query_ls
exists, this is a better option in every regard (and up to now
required manually disabling the builtin linter to avoid duplicate
diagnostics and performance issues).
- Rename ".nvimlog" to "nvim.log"
- doesn't need to be "hidden"/dotfile
- ".log" extension helps with filetype detection
- Also rename "nvim/log" => "nvim/nvim.log"