Problem: LineNrAbove and LineNrBelow background wrong on wrapped lines.
Solution: Update number column also for wrapped part of a line.
(zeertzjq)
closes: vim/vim#13974ebfd856cfd
Cherry-pick test_number.vim changes from patch 9.0.0626.
Problem: `tui->space_buf` may be smaller than the width of the TUI or widest
grid, causing an overflow when calling `tui_grid_clear` if `print_spaces` is
called from `clear_region` (clears the TUI's screen since #23428).
Solution: resize `space_buf` to be wide enough to fit the TUI or widest grid.
Didn't bother shrinking the allocation if the max widths decrease.
Problem: insert completion not correct when adding new leader
Solution: Reset compl_curr_match to compl_shown_match
(glepnir)
closes: vim/vim#13957cbb46b4398
Problem: There is no test case for vim.lsp.tagfunc; so CI was unable to
catch the infinite loop bug (#27325).
Solution: Add test cases for vim.lsp.tagfunc().
Problem:
Processing non-fast events during SystemObj:wait() may cause two pieces
of code to interfere with each other, and is different from jobwait().
Solution:
Don't process non-fast events during SystemObj:wait().
Problem: Erroring when both {range} and {code} are supplied to
:lua is inconvenient and may break mappings.
Solution: Don't error, ignore {range} and execute {code} when both
are supplied.
- Consistently use the variable CMAKE_BUILD_TYPE to select build type.
- Remove broken `doc_html` target.
- Remove swap files created by oldtest when cleaning.
- Only rerun `lintdoc` if any documentation files has changed.
Problem: Crash when using gettabwinvar() with invalid arguments. (Yilin
Yang)
Solution: Use "curtab" if "tp" is NULL. (closesvim/vim#5475)
ee93b737aa
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Segfault with CompleteChanged autocommand
(markonm )
Solution: Test match->cp_prev for being NULL before accessing it
closes: vim/vim#13929fef6630166
Co-authored-by: Christian Brabandt <cb@256bit.org>
The "priority" field of extmarks can be used to set priorities of
extmarks which dictates which highlight group a range will actually have
when there are multiple extmarks applied. However, when multiple
extmarks have the same priority, the only way to enforce an actual
priority is through the order in which the extmarks are set.
It is not always possible or desirable to set extmarks in a specific
order, however, so we add a new "subpriority" field that explicitly
enforces the ordering of extmarks that have the same priority.
For now this will be used only to enforce priority of treesitter
highlights. A single node in a treesitter tree may match multiple
captures, in which case that node will have multiple extmarks set. The
order in which captures are returned from the treesitter API is not
_necessarily_ in the same order they are defined in a query file, so we
use the new subpriority field to force that ordering.
For now subpriorites are not documented and are not meant to be used by
external code, and it only applies to ephemeral extmarks. We indicate
the "private" nature of subpriorities by prefixing the field name with
an "_".
Problem:
- Navigation is not always symmetric: pressing Ctrl+o n times followed
by Ctrl+i n times does not always gets me back to where I started.
- Invalid buffers are not skipped by Ctrl+i/o, I have to press Ctrl+i/o
multiple times to get to the next/previous buffer.
Solution:
- Remove all entries of a buffer from the jump list when deleting it.
- Don't add a new entry to the jump list if the next buffer to be
displayed is already in the jump list.
Closes#25365
Problem: Recorded register cannot be translated using keytrans() when
it involves character search (iddqd505)
Solution: Record a K_IGNORE instead of a K_NOP (zeertzjq)
related: vim/vim#13916closes: vim/vim#13925bf321806bf
Summary: Separate the lint job (`make lintdoc`) to validate runtime/doc,
it is no longer as a part of functionaltest (help_spec).
Build (cmake) and CI:
- `make lintdoc`: validate vimdoc files and test-generate HTML docs.
CI will run this as a part of the "docs" workflow.
- `scripts/lintdoc.lua` is added as an entry point (executable script)
for validating vimdoc files.
scripts/gen_help_html.lua:
- Move the tests for validating docs and generating HTMLs from
`help_spec.lua` to `gen_help_html`. Added:
- `gen_help_html.run_validate()`.
- `gen_help_html.test_gen()`.
- Do not hard-code `help_dir` to `build/runtime/doc`, but resolve from
`$VIMRUNTIME`. Therefore, the `make lintdoc` job will check doc files
on `./runtime/doc`, not on `./build/runtime/doc`.
- Add type annotations for gen_help_html.
Problems:
1. The test case for querying truecolor support did not check which
capabilities were queried
2. The test case for querying truecolor support checked `&termguicolors`
in the Nvim test runner, not the child Nvim in the the embedded
terminal
3. The test case for querying truecolor support did not actually respond
to the XTGETTCAP requests. `'termguicolors'` is still enabled even
without responding to this query because libvterm understands and
responds to the DECRQSS request, but it is still good to respond to
the query explicitly instead of depending on hidden libvterm behavior
4. No test case exists at all for OSC 52
Solution:
Fix all of the problems listed above.
Problem: E95 is possible if a buffer called "[Command Line]" already
exists when opening the cmdwin. This can also happen if the
cmdwin's buffer could not be deleted when closing.
Solution: Un-name the cmdwin buffer, and give it a special name instead,
similar to what's done for quickfix buffers and for unnamed
prompt and scratch buffers. As a result, BufFilePre/Post are
no longer fired when opening the cmdwin. Add a "command" key
to the dictionary returned by getbufinfo() to differentiate
the cmdwin buffer instead. (Sean Dewar)
Cherry-pick test_normal changes from v9.0.0954.
1fb4103206
Problem: Autocmds triggered from opening the cmdwin (in win_split and
do_ecmd) can cause issues such as E199, as the current checks
are insufficient.
Solution: Commands executed from the cmdwin apply to the old curwin/buf,
so they should be kept in a "suspended" state; abort if
they've changed. Also abort if cmdwin/buf was tampered with,
and check that curwin is correct. Try to clean up the cmdwin
buffer (only if hidden and non-current to simplify things; the
same approach is used when closing cmdwin normally), and add a
beep. (Sean Dewar)
Rename the old Test_cmdwin_interrupted() like in the patch (can be moved to
test_cmdwin.vim when v9.0.0027 is ported).
Move the error message to `e_active_window_or_buffer_changed_or_deleted`.
43b395ec2e
Problem: Things that temporarily change/restore curwin/buf (e.g:
win_execute, some autocmds) may break assumptions that
curwin/buf is the cmdwin when "cmdwin_type != 0", causing
issues.
Solution: Expose the cmdwin's real win/buf and check that instead. Also
try to ensure these variables are NULL if "cmdwin_type == 0",
allowing them to be used directly in most cases without
checking cmdwin_type. (Sean Dewar)
Reset and save `cmdwin_old_curwin` in a similar fashion.
Apply suitable changes for API functions and add Lua tests.
988f74311c
Problem: Marks moved by undo may be lost to "b_signcols.count".
Solution: Count signs for each undo object separately instead of
once for the entire undo.
Problem: Cannot map Super Keys in GTK UI
(Casey Tucker)
Solution: Enable Super Key mappings in GTK using <D-Key>
(Casey Tucker)
As a developer who works in both Mac and Linux using the same keyboard,
it can be frustrating having to remember different key combinations or
having to rely on system utilities to remap keys.
This change allows `<D-z>` `<D-x>` `<D-c>` `<D-v>` etc. to be recognized
by the `map` commands, along with the `<D-S-...>` shifted variants.
```vimrc
if has('gui_gtk')
nnoremap <D-z> u
nnoremap <D-S-Z> <C-r>
vnoremap <D-x> "+d
vnoremap <D-c> "+y
cnoremap <D-v> <C-R>+
inoremap <D-v> <C-o>"+gP
nnoremap <D-v> "+P
vnoremap <D-v> "-d"+P
nnoremap <D-s> :w<CR>
inoremap <D-s> <C-o>:w<CR>
nnoremap <D-w> :q<CR>
nnoremap <D-q> :qa<CR>
nnoremap <D-t> :tabe<CR>
nnoremap <D-S-T> :vs#<CR><C-w>T
nnoremap <D-a> ggVG
vnoremap <D-a> <ESC>ggVG
inoremap <D-a> <ESC>ggVG
nnoremap <D-f> /
nnoremap <D-g> n
nnoremap <D-S-G> N
vnoremap <D-x> "+x
endif
```
closes: vim/vim#1269892e90a1e10
Co-authored-by: Casey Tucker <dctucker@hotmail.com>
Problem: Incorrect number of trailing spaces inserted for multibyte
characters when pasting a blockwise register in blockwise visual
mode (VanaIgr)
Solution: Skip over trailing UTF-8 bytes when computing the number of trailing
spaces (VanaIgr)
When pasting in blockwise visual mode, and the register type is <CTRL-V>, Vim
aligns the text after the replaced area by inserting spaces after pasted
lines that are shorter than the longest line. When a shorter line contains
multibyte characters, each trailing UTF-8 byte's width is counted in addition
to the width of the character itself. Each trailing byte counts as being 4
cells wide (since it would be displayed as <xx>).
closes: vim/vim#139096638ec8afa
Co-authored-by: VanaIgr <vanaigranov@gmail.com>
Problem: 'linebreak' may still apply to leading whitespace
(VanaIgr)
Solution: Compare pointers instead of virtual columns.
(zeertzjq)
related: #27180closes: vim/vim#13915703f9bc943
Co-authored-by: VanaIgr <vanaigranov@gmail.com>
Problem: Some core syntax highlight groups are cleared with intention to
always be shown without additional highlighting. This doesn't always
work as intended, especially with fallback mechanism of @-groups.
Example: `Statement`/`Keyword` group shown in help code blocks
(`@markup.raw`) is shown as bold (from `Statement`) cyan (from
`@markup.raw`) instead of bold grey.
Solution: Explicitly use normal grey foreground in syntax groups where
it was previously implicitly assumed.