Chapter 2: Fix missing "R" after 1e3e1ba067c79a when using register from insert
mode. While at it, consistently use upper case letter for CTRL-R in the
new-tutor.
related: vim/vim#18950757b42ab07
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Not enough tests for :setlocal omnifunc (after 9.1.1991).
Solution: Move the last :new after :setlocal. Also test with 'complete'
(zeertzjq).
closes: vim/vim#18958cedb1a3171
Problem: :setlocal changes effective global 'omnifunc' (Maxim Kim)
Solution: Don't change global callback when using :setlocal (zeertzjq).
fixes: vim/vim#18948closes: vim/vim#189513e82b0ebfe
Problem: gcc.vim interprets "make: *** [Makefile" in the error message
"make: *** [Makefile:2: all] Error 1" as a valid filename.
Solution: Add pattern to extract the filename correctly. Note that this
doesn't remove the dangling "]" from the output ("all]").
closes: vim/vim#18956bd5e882a91
Problem: The logic for generating backup file names is duplicated in
`buf_write_make_backup` and difficult to reuse.
Solution: Extract name generation logic into `buf_get_backup_name`.
Problem:
The q keymap is already set in open_floating_preview, so maparg('q') is not empty.
Solution:
Add a health.style check before setting the q keymap.
Problem: Invalid memory access in Ex mode with global command.
Solution: Make sure the cursor is on a valid line. (closesvim/vim#7238)
3b6d57f2ce
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: When fuzzy is enabled and the prefix is not empty,
items are not sorted by fuzzy score before calling fn.complete.
Solution: Use matchfuzzypos to get the scores and sort the items
by fuzzy score before calling fn.complete.
By simplifying the way range is supported, we can fix a couple issues as
well as making it less complex and more efficient:
* For non-range LSP servers, don't send requests on WinScrolled. The
semantic tokens module has been reworked to only send one active
request at a time, as it was before range support was added. If range
is not supported, then send_request() only fires if there's been a
change to the buffer's document version.
* Cache the server's support of range and delta requests when attaching
to a buffer to save the lookup on each request.
* Range requests always use the visible window, so just use that for the
`range` param when sending requests when range is supported by the
server. This reduces the API surface area of send_request().
* Debounce the WinScrolled autocmd requests in the same the way requests
are debounced when the buffer contents are changing. Should allow
scrolling via mouse wheel or holding down "j" or "k" work a bit
smoother.
The previous iteration of range support allowed multiple active requests
to be in progress simultaneously. However, a bug was preventing any but
the most recent request to actually apply to the client's highlighting
state so that complexity was unused. It was effectively only using one
active request at a time but was just using range requests on
WinScrolled events instead of a full (or delta) request when the
document version changed.
Problem: Vim9: class_name definition can be improved
Solution: Use string_T to store class_name, avoid using STRLEN() calls,
simplify code, remove unused definition of struct
oc_newmember_S (John Marriott)
Use struct string_T to store the field class_name in struct class_T,
which means we can just use the .length field in struct string_T
instead of measuring it.
In addition:
1. In eval.c use string_T to store class_name and s in function
class_tv2string().
2. In vim9type.c change some calls from ga_concat() to ga_concat_len()
where the length is known.
3. In vim9class.c remove unused struct definition oc_newmember_S.
Change some calls from ga_concat() to ga_concat_len() where the
length is known.
4. In scriptfile.c use string_T to store type_name, class_name and
es_name in function estack_sfile().
5. In function estack_sfile() simplify construction of the grow array ga
and change some calls from ga_concat() to ga_concat_len() when the
length is known.
closes: vim/vim#189252019321e0b
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem: vim9 no class identifiers in stack dumps
Solution: Prefix class members in stack traces with the class name
followed by a dot.
closes: vim/vim#12866closes: vim/vim#120780ffc17aa47
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
claims to be a "data-only" plugin, in fact it still provides some
user-facing commands because they haven't been upstreamed to Nvim.
Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
restart`, `:lsp start` and `:lsp stop` respectively.
Co-authored-by: glepnir <glephunter@gmail.com>
Problem:
CursorLine background check used global `normal_bg`, ignoring 'winhighlight'.
Solution:
Use `bg_attr` to get window-local Normal background instead.
Problem: tests: test suite may stop on error in gen_opt_test.vim
Solution: Use a different output file for log files (Muraoka Taro)
When running newtests, it may unexpectedly stop just before
test_options_all.
Cause: When generating the opt_test.vim file for test_options_all, the
failure is detected by the existence of test.log. Therefore, if a test
performed before test_options_all fails and test.log is created, it is
mistakenly thought that the generation of opt_tet.vim has failed, and
the test suite stops there.
So let's change the filename created when utils/gen_opt_test.vim fails
from test.log to gen_opt_test.log, so that it can be detected
independently from other test failures.
closes: vim/vim#1892835de719c0c
Co-authored-by: MURAOKA Taro <koron.kaoriya@gmail.com>
Problem:
:messages history include the "search hit BOTTOM, continuing at TOP" message,
which is noise.
Solution:
Set msg_hist_off before giving the warning and reset it after warning.
Call `vim.treesitter.language.add()` before `get_helptags` (which
triggers filetype=help). And do this in the main routine, instead of
each gen/validate task.
Refactor capability checks in Client:_supports_registration and
Client:supports_method to properly handle dynamicRegistration and unknown
methods. Now, dynamic capabilities are checked before assuming support for
unknown methods, ensuring more accurate LSP feature detection.
Problem: feed_command, nvim_buf_set_option, nvim_buf_get_number, and exc_exec
are marked as deprecated.
Solution: Remove them from the test units in api/buffer_spec, autocmd/focus_spec,
ui/input_spec, and editor/put_spec.
Some test units only used a few deprecated functions, so creating a separate PR
for each would be excessive. Therefore, several were combined into a single PR.
Problem:
`vim.system()` doesn't invoke a shell, while the Vimscript function
`system()` does.
Solution:
Revert the change from 35af766de6 and use `vim.fn.system()` again to
actually invoke a shell.
Problem:
The builtin terminfo defs don't include xterm-ghostty, so features like
`kTerm_set_underline_style` are missing when building without unibilium.
Solution:
- Add ghostty to `gen_terminfo.lua`.
- Note: The ncurses defs are somewhat different than what ghostty ships.
- Special-case ghostty in `terminfo_from_builtin`.
Problem: :helpclose incorrectly accepts a range and a count.
Solution: Remove EX_COUNT and EX_RANGE from the command definition.
(Doug Kearns)
closes: vim/vim#189174c141bae3b
Co-authored-by: Doug Kearns <dougkearns@gmail.com>