Commit Graph

5874 Commits

Author SHA1 Message Date
zeertzjq
4ee9e58056
feat(tui): query extended underline support using DECRQSS (#28052) 2024-03-28 07:39:36 +08:00
bfredl
997bef54aa
Merge pull request #28057 from bfredl/nosethl_2
refactor(tests): use global defaults instead of set_default_attr_ids (2)
2024-03-27 22:25:28 +01:00
bfredl
b556bd1a53 refactor(tests): use global defaults instead of set_default_attr_ids (2) 2024-03-27 12:32:53 +01:00
Lewis Russell
7d97150084 fix(treesitter): return correct match table in iter_captures() 2024-03-27 10:39:46 +00:00
bfredl
c4e1930851
Merge pull request #28025 from luukvbaal/introfloat
fix(intro): still show intro message with floating window
2024-03-27 11:10:13 +01:00
Luuk van Baal
21360523cd fix(intro): still show intro message with floating window
Stop drawing the intro only after a split is opened.
2024-03-27 10:28:59 +01:00
bfredl
635fa2c51c
Merge pull request #28046 from bfredl/nosethl_1
refactor(tests): use new global defaults instead of set_default_attr_ids
2024-03-27 09:53:16 +01:00
zeertzjq
00e9c69551
test(tui_spec): fix flaky test for isolated "stop paste" (#28053)
In rare cases there may be multiple chunks of phase 2 because of timing.
2024-03-27 11:22:20 +08:00
bfredl
35f2bb05a5 refactor(tests): use new global defaults instead of set_default_attr_ids
This will be done in batches.
2024-03-26 21:28:05 +01:00
zeertzjq
0c0be09eab
test(lsp): fix flaky basic_finish test again (#28041)
Problem:
LSP basic_finish test modified in #27899 is flaky again after #28030.

Solution:
Run on_setup() immediately after setup using a before_init callback.
2024-03-26 21:11:32 +08:00
Lewis Russell
00e71d3da3 refactor(lsp): simplify client tracking
- Remove:
    - uninitialized_clients
    - active_clients
    - all_buffer_active_clients
- Add:
    - all_clients

- Use `lsp.get_clients()` to get buffer clients.
2024-03-25 22:21:08 +00:00
vanaigr
14839c5d18
fix(edit): backspace adds extra spaces for inline virtual text (#28005)
Problem:  Backspace adds extra spaces for inline virtual text.
Solution: Ignore virtual text and wrapping when backspacing.
2024-03-26 05:12:56 +08:00
Lewis Russell
a7bbda121d fix(test): typing 2024-03-25 21:09:57 +00:00
Lewis Russell
934f38682a Revert "refactor(lsp): simplify client tracking"
This reverts commit 3f238b39cf.
2024-03-25 20:16:42 +00:00
Lewis Russell
3f238b39cf refactor(lsp): simplify client tracking
- Remove:
    - uninitialized_clients
    - active_clients
    - all_buffer_active_clients
- Add:
    - all_clients

- Use `lsp.get_clients()` to get buffer clients.
2024-03-25 18:02:38 +00:00
Jongwook Choi
ca239ecd07 test(treesitter): separate out query-related tests into query_spec
Move test cases that are more about treesitter query API rather than
parser API or LanguageTree out of "treesitter/parser_spec", and collect
them in another test suite "treesitter/query_spec".
2024-03-24 11:11:34 -04:00
Jongwook Choi
921aa52b8f test(treesitter): improve the style of treesitter/parser_spec
General refactoring, including:

- Improve whitespace and indentation
- Prefix captures with `@`
- Add more comments on `iter_capture()` tests
- Move `test_query` up closer to the fixture source string

No behavioral changes are made.
2024-03-23 23:57:41 -04:00
Calvin Bochulak
ca6dbf3558
fix(vim.iter): use correct cmp function when truncating tail in take (#27998) 2024-03-23 16:46:54 -05:00
bfredl
3d9c028a4c
Merge pull request #27980 from bfredl/noignore
refactor(tests): all screen tests should use highlights
2024-03-23 20:01:21 +01:00
bfredl
0c59771e31 refactor(tests): all screen tests should use highlights
This is the first installment of a multi-PR series significantly
refactoring how highlights are being specified.

The end goal is to have a base set of 20 ish most common highlights,
and then specific files only need to add more groups to that as needed.

As a complicating factor, we also want to migrate to the new default
color scheme eventually. But by sharing a base set, that future PR
will hopefully be a lot smaller since a lot of tests will be migrated
just simply by updating the base set in place.

As a first step, fix the anti-pattern than Screen defaults to ignoring
highlights. Highlights are integral part of the screen state, not
something "extra" which we only test "sometimes". For now, we still
allow opt-out via the intentionally ugly

  screen._default_attr_ids = nil

The end goal is to get rid of all of these eventually (which will be
easier as part of the color scheme migration)
2024-03-23 13:44:35 +01:00
zeertzjq
2955c921ce
fix(filetype): use unexpanded file name (#27931)
When the edited file is a symlink, the unexpanded file name is needed to
to achieve the same behavior as the autocommand pattern matching in Vim.
Neither args.file nor args.match are guaranteed to be unexpanded, so use
bufname() instead.
2024-03-23 11:46:23 +08:00
zeertzjq
dc110cba3c
Merge pull request #26970 from famiu/refactor/options/set_option_direct
refactor(options): remove `set_string_option_direct()`
2024-03-22 09:14:42 +08:00
zeertzjq
dabc44d15c vim-patch:9.1.0195: memleak with ex_drop, NULL dereference
Problem:  memleak with ex_drop(), NULL dereference
          (zeertzjq)
Solution: revert back to ex_rewind(), use curbuf instead of buf

fixes: vim/vim#14246
closes: vim/vim#14251

85a769d466

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-22 06:04:37 +08:00
zeertzjq
271879dd49 vim-patch:9.1.0192: drop: don't rewind when editing the same file
Problem:  :drop tries to :rewind the argumentlist, which results in E37
          (after v9.1.0046)
Solution: instead of calling ex_rewind(), call open_buffer() only when
          re-using the initial empty buffer

fixes: vim/vim#14219
closes: vim/vim#14220

978178823b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-22 06:04:37 +08:00
bfredl
8921d56053 fix(rpc): do not crash when no input is consumed
fixes #23781

Co-authored-by: glacambre <code@lacamb.re>
2024-03-21 15:52:28 +01:00
Famiu Haque
58cc66ee1f
test(options): add test for 'modified' 2024-03-21 19:40:13 +06:00
luukvbaal
c72d877c33
fix(cmdline): wrong 'incsearch' highlighting after :redraw (#27947)
Problem:  Calling :redraw from a timer callback clears 'incsearch' highlighting.
Solution: Re-apply 'incsearch' highlighting if the screen was updated.
2024-03-20 21:59:04 +08:00
Justin M. Keyes
7549845e8d
Merge #27930 nvim_create_buf fixes 2024-03-20 06:15:38 -07:00
zeertzjq
9765efb40f
test(ui/messages_spec): unskip msg_puts_printf test on Unix CI (#27941)
It no longer fails on Unix CI.
2024-03-20 08:02:50 +08:00
Sean Dewar
6091df6b7a
fix(api): nvim_create_buf assert fails if autocmds set &swapfile
Problem: assertion failure in nvim_create_buf if buflist_new autocommands open
a swapfile when "scratch" is set.

Solution: block autocommands when setting up the buffer; fire them later
instead.

Note that, unlike buflist_new, I don't check if autocommands aborted script
processing; the buffer is already created and configured at that point, so might
as well return the handle anyway.

Rather than repeat try_{start,end} and {un}block_autocmds for each relevant
operation, just do it at the start and near the end. This means that, if
TermResponse fires from unblock_autocmds for whatever reason, it can see the
buffer in an already configured state if we didn't bail due to an error (plus
it's probably a bit cleaner this way).
2024-03-19 16:13:52 +00:00
Sean Dewar
d5c23d72a5
fix(api): nvim_create_buf leaks memory if buffer is loaded early
Problem: memory leak in nvim_create_buf if buflist_new autocommands load the
new buffer early.

Solution: do not open a memfile in that case.
2024-03-19 15:43:08 +00:00
zeertzjq
16a416cb3c
fix(terminal): don't pass incomplete UTF-8 sequence to libvterm (#27922) 2024-03-19 16:56:51 +08:00
Christian Clason
987dff6713 feat(treesitter): update Vimdoc parser and queries to v2.4.0 2024-03-19 09:41:16 +01:00
zeertzjq
d744876723
test(terminal/cursor_spec): unskip tests that pass on Windows (#27924)
Also:
- Make indent of test cases consistent.
- Unskip TUI rapid resize test with ASAN as reflow is now disabled.
2024-03-19 15:42:55 +08:00
zeertzjq
400ef8aaa0
test(terminal/buffer_spec): fix incorrect tests (#27923)
The first describe() block enters terminal mode in before_each(), so
feed_command() at the start of a test case writes it to the terminal
instead of executing it.
2024-03-19 12:44:14 +08:00
zeertzjq
e3bd04f2af
fix(pager): handle consecutive newlines properly (#27913) 2024-03-18 22:25:55 +08:00
zeertzjq
5de0482d1a
test(lsp): fix flaky basic_finish test (#27899)
Problem:
As mentioned in #23002 on_setup and on_init are run concurrently.
However, in basic_finish tests on_setup must attach the client before
on_init finishes.  The other basic_finish test isn't flaky because it
makes an RPC request in on_init.

Solution:
Don't use on_setup in basic_finish tests.
2024-03-18 19:49:31 +08:00
En-En
e34c23b701
fix(tutor): set a value for ":syntax iskeyword" (#27833)
Problem: "NOTE"s, inline Vim script code, and links ending in digits may not be
highlighted correctly within the :Tutor.

Solution: set an explicit value for ":syntax iskeyword" that includes digits. Do
it after ":syntax include"s, so the included syntax/sh.vim doesn't mess with the
value.

Increase screen test width so all text within the conclusion section is visible.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2024-03-18 11:19:20 +00:00
zeertzjq
eabf9de1dc
fix(messages): allow more prompt in headless mode with UI (#27905)
Problem:  More prompt is not shown in headless mode even if there is a
          UI attached.
Solution: Don't skip more prompt when there is a UI active.
2024-03-18 10:34:27 +08:00
Lewis Russell
3b29b39e6d fix(treesitter): revert to using iter_captures in highlighter
Fixes #27895
2024-03-17 20:37:15 +00:00
Takuya Tokuda
77a9f3395b
fix(lsp): create codelens request parameters for each buffer (#27699) 2024-03-17 21:04:59 +01:00
zeertzjq
08986bb597
test: combining TermCursorNC with CursorLine/CursorColumn (#27898) 2024-03-17 18:09:29 +08:00
zeertzjq
091eb4c8c7
fix(mouse): click after eol with conceal and virtual text (#27897)
Problem:  Wrong cursor position when clicking after end of line with
          'virtualedit', conceal and virtual text.
Solution: Always fill linebuf_vcol[] for the columns to clear.
2024-03-17 17:54:18 +08:00
zeertzjq
54db75e995
refactor(drawline): integrate terminal hl with eol loop (#27893)
There is no test for using 'cursorline' in Normal mode in a terminal
buffer, so add a test and fix 'cursorcolumn' remaining when entering
Terminal mode.

Also move synIDattr() tests to ui/highlight_spec.lua.
2024-03-17 17:24:03 +08:00
zeertzjq
c52dfb6e84
fix(normal): don't check conceal when pressing 'r' (#27892)
Problem:  Cursor line is unconcealed when pressing 'r' in Normal mode
          when 'concealcursor' contains 'n' but not 'i'.
Solution: Don't check conceal when pressing 'r' in Normal mode.

Vim doesn't have this problem because it doesn't call redrawWinline() in
conceal_check_cursor_line() and instead sets a global variable.
2024-03-17 09:44:10 +08:00
zeertzjq
34b57508a7
fix(drawline): check filler_todo in place of removed draw_state (#27889)
The only place it matters is the conceal wcol check, but it can avoid
unnecessary computations at other places.
2024-03-17 05:43:14 +08:00
Caleb Marshall
542c910a1d fix(lsp): add missing LSP semantic token highlight links
Added the following LSP semantic token types to be linked to highlight
groups by default:

* @lsp.type.event
* @lsp.type.keyword
* @lsp.type.modifier
* @lsp.type.number
* @lsp.type.operator
* @lsp.type.regexp
* @lsp.type.string
2024-03-16 20:37:56 +08:00
bfredl
9c2fdfe6e7
Merge pull request #27877 from bfredl/pseudorandom
fix(intro): redrawing intro exposing pseudo-randomness
2024-03-16 09:32:52 +01:00
bfredl
d1a30221fc fix(intro): redrawing intro exposing pseudo-randomness
problem:  redrawing intro exposes pseudo-randomness
solution: remove pseudo-randomness
2024-03-16 08:40:45 +01:00
ite-usagi
4447cefa48
fix(l10n): update Japanese translations (#27856) 2024-03-16 14:50:52 +08:00