This prevents Nvim TUI running in tests from thinking it's inside tmux.
Another solution is make :terminal unset $TMUX instead, but I'm not sure
if that'll break some other use cases.
Problem: Bulking message lines to write in a single API call is
complicated and still not correct w.r.t. overwriting
highlights.
Solution: Write each chunk pattern separately with it's highlight
such that it will be spliced correctly for message chunks
that contain a carriage return. Go with correctness over
performance until this proves to be too inefficient.
Also add an identifying name to the various extui buffers.
Problem: Can't use getpos('v') in OptionSet when using setbufvar().
Solution: Don't reset Visual selection when switching to the same
buffer (zeertzjq).
closes: vim/vim#173735717ee33db
Problem: Using tracked message column as column in cleared buffer.
Solution: Ensure column does not exceed current line length.
Further work to ensure carriage return and cmdline block mode
work properly.
Problem: "99 searchcount ought to be enough for anyone."
Solution: Increase `SEARCH_STAT_DEF_MAX_COUNT` to 999, which I'm sure
will suffice for the next twenty years.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Problem: Consecutive "msg_show" events stemming from an `:echon`
command are supposed to be appended without a newline, this
information is not encoded in the "msg_show" event.
Solution: Add an "append" parameter to the "msg_show" event that is set
to true to indicate the message should not start on a new line.
Considered alternative: Emit a newline for the common case instead at the
start of a new message. That way UIs can more closely follow the logic
as it is implemented for the message grid currently. This would be a
breaking change. The "append" parameter seems OK.
Problem: When scrolling (the text) down with 'smoothscroll', filler
lines are revealed before the text skipped with `w_skipcol`.
Solution: Check `w_skipcol` before filler lines.
Problem: tests: no test for mapping with special keys in session file.
Solution: Add a special keys to an existing test. Also test with UTF-8
characters containing 0x80 or 0x9b bytes (zeertzjq).
closes: vim/vim#173609ff1e598e8
Problem: wrong link to Chapter 2 in vim-01-beginner.tutor
Solution: Fix the link to Chapter 2, add test for links in tutor files
(Phạm Bình An)
In order to write the test, I exposed the function `s:GlobTutorials` as
`tutor#GlobTutorials` and make it also accept a `locale` argument.
closes: vim/vim#17356e8302da74a
Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Problem: multi-byte mappings not properly stored in session file
Solution: unescape the mapping before writing out the mapping, prefer
single-byte mapping name if possible (Miguel Barro)
closes: vim/vim#173555b07aff2f6
Co-authored-by: GuyBrush <miguel.barro@live.com>
Problem:
Some LSPs cause the following completion error (reformatted slightly):
Error executing vim.schedule lua callback:
.../runtime/lua/vim/lsp/completion.lua:373
attempt to index field 'range' (a nil value)
This is because an internal function assumes edits are either missing
or of type `TextEdit`, but there's a third [possibility][0] that's not
handled: the `InsertReplaceEdit`.
This was previously reported in at least two issues:
- https://github.com/neovim/neovim/issues/33142
- https://github.com/neovim/neovim/issues/33224
Solution:
Don't assume the edit is a `TextEdit`. This implicitly handles
`InsertReplaceEdit`s.
Also, add a test case for this, which previously caused an error.
[0]: 2c07428966/runtime/lua/vim/lsp/_meta/protocol.lua (L1099)
Problem:
Because the buffer in the window may change before the request is completed, foldclose() might be executed on the wrong buffer.
Solution:
Avoid that.
Copy whatever was made to work for generated headers:
(1) we need to consider all cmake targets not just main_lib
(2) we need to add the sysroot for macOS
The old implementation of repeated_read_cmd would attempt to run the
command multiple times to handle racyness of async output. Code
like this should not be written. Instead, use the libuv event
loop to read until the process has exited and the pipe has been closed.
This causes some previous discarded errors to be propagated. Fix these
as well.
This is a diabolical anti-pattern and is hiding errors which exist
currently in unittests. Also we want to see _where_ in the process
stderr was emitted, stashing it away at the end erases important
context.
|vim.glob.to_lpeg()| uses a new LPeg-based implementation (Peglob) that
provides ~50% speedup for complex patterns. The implementation restores
support for nested braces and follows LSP 3.17 specification with
additional constraints for improved correctness and resistance to
backtracking edge cases.
- Fixed syntax highlighting for ksh93 namespace variables starting
with '${.'
- Added support for the alarm, eloop, fds, mkservice, pids, poll and
sha2sum builtins (which are indeed ksh93 builtins, albeit whether or
not they are available depends on the ksh release and the compiled
SHOPT options).
- Added support for the many Unix commands provided by ksh93's libcmd
as builtin commands (since these are general commands, scripts for
other shells like bash will also highlight these).
- The dumps for the sh_0{2,5,6,8,9}.sh were recreated due to this
change affecting commands those scripts call (e.g. 'wc').
- Enabled ${parameter/pattern/string} and friends for ksh syntax.
- Enabled case modification for ksh. See also:
https://github.com/ksh93/ksh/commit/c1762e03
- Enabled ;;& support for ksh. See also:
https://github.com/ksh93/ksh/commit/fc89d20a
- Added many special ksh variables using 93u+m's data/variables.c
as a reference.
If vim can't figure out which ksh release is in play using e.g.
the hashbang path, in such a case a generic default that enables
everything and the kitchen sink will be used. Otherwise, features will
be disabled if it's absolutely known a certain feature will not be
present. Examples:
- ERRNO is ksh88 specific, so that is locked to ksh88.
- Only 93u+m (assumed for generic) has SRANDOM, and only 93u+m
and 93v- have case modification support.
- 93u+ and 93v- have VPATH and CSWIDTH variables (the latter
is vestigal, but still present in the hardcoded variable table).
- 93v- and ksh2020 have (buggy and near unusable) implementations
of compgen and complete.
- Only mksh provides function substitutions, i.e. ${|command;}.
This took the better part of my day to implement. It seems to work well
enough though. (Also had to regenerate the dumps again while testing
it, as now there are dup scripts with mere hashbang differences, used
solely for testing syntax highlighting differences.)
closes: vim/vim#17348b0691b46bd
Co-authored-by: Johnothan King <johnothanking@protonmail.com>
Problem: A "search_cmd" message alters the message state (since 8e8f4523),
unnecessarily affecting logic for messages that follow.
Solution: Reset the appropriate variables after a "search_cmd" message.
Don't show "search_cmd" message with zero 'cmdheight'.
Problem:
- Lesson 7.3 (Cmdline Completion) teaches an important way to discover
Nvim features. I think users should learn it before they start
configuring Nvim
- Nvim can be configured in Lua as well, but lesson 7.2 (Configuring
Nvim) only mentions init.vim. And I think Nvim is promoting Lua more
Solution:
- Move lesson 7.2 to be after lesson 7.3
- Lesson 7.2 should teach about init.lua
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
The root_markers field can now contain a table of tables (as of
https://github.com/neovim/neovim/pull/33485) and :checkhealth will show
an error in that case since Lua cannot concatenate a table of tables.
Ensure that tables contain strings before concatenating and if not, fall
back to using vim.inspect().