Commit Graph

5606 Commits

Author SHA1 Message Date
zeertzjq
bf4b805516 fix(edit): don't go to Terminal mode when stopping Insert mode (#27033) 2024-01-19 11:13:39 +08:00
zeertzjq
51f8668cbd vim-patch:8.1.1968: crash when using nested map() (#27029)
Problem:    Crash when using nested map().
Solution:   Clear the pointer in prepare_vimvar(). (Ozaki Kiichi,
            closes vim/vim#4890, closes vim/vim#4891)

27da7de7c5

Cherry-pick Test_filter_map_nested() from patch 8.1.1964.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit a34451982f)
2024-01-16 01:33:16 +00:00
zeertzjq
9d31b58861 fix(pum): handle right-click menu repositioning with multigrid (#26975)
(cherry picked from commit a7550a20e0)
2024-01-10 04:57:29 +00:00
James McCoy
94deea8da0
fix(test/tui_spec): pass the expected NULL-sentinel to execl()
Since execl() is a variadic function, it requries a NULL-terminal to
indicate the end of its argument list, c.f. exec(3)

> The first argument, by convention, should point to the filename
> associated with the file being executed.  The list of arguments *must*
> be terminated by a null pointer

This fixes the failure seen on aarch64 and i386, due to garbage data
being considered part of the variadic arguments.

(cherry picked from commit 8861ad83fd)
2024-01-06 09:45:05 -05:00
zeertzjq
97eed79846 fix(terminal): check if mouse on statusline/tabline/winbar/vsep (#26892)
(cherry picked from commit e09adfdcff)
2024-01-05 03:00:12 +00:00
dundargoc
3a535ff496 feat(vim.deprecate): only issue warning if neovim version is high enough
As specified by MAINTAIN.md, features should be soft deprecated at first
(meaning no warnings) to give people a chance to adjust. The problem
with this approach is that deprecating a feature becomes harder than
usual as during the soft deprecation period you need to remember not to
issue a warning, and during the hard deprecation period you need to
remember to start issuing a warning.

This behavior is only enforced if the `plugin` parameter is `nil` as
plugins may not want this specific behavior.

(cherry picked from commit 0a598c13b1)
2024-01-03 13:28:47 +01:00
Christian Clason
9bce28ab79 test(functional): remove faulty pending check
Problem: `functional/vimscript/api_functions_spec` skips a test if the
runtime files are not generated, but this check was broken in a
refactor.

Solution: Since runtime files are now generated for all test targets, do
not skip this test.

(cherry picked from commit 2df8a81e21)
2023-12-30 19:07:21 +01:00
dundargoc
33bbde1bc6 build: add more runtime files to test dependencies
Equivalent to some of the changes in
bf0be0f63e.
2023-12-30 18:07:47 +01:00
zeertzjq
d414938163 fix(mappings): fix mapset() not replacing map with backslash
(cherry picked from commit 5ac9b4cddf)
2023-12-23 07:31:01 +00:00
zeertzjq
ea748157e1 fix(options): setting 'scroll' with resized grid 2023-12-20 22:15:52 +08:00
zeertzjq
20bd03f166 test: make text-only snapshots work 2023-12-20 22:15:52 +08:00
zeertzjq
c2249f6abf test: allow avoiding repeated screen lines in expected states
Allow a "*count" suffix in a screen line to repeat the screen line for
"count" times.

The change is made to Screen:expect() and Screen:get_snapshot() instead
of Screen:render() so that screen expectations generated using code can
still work and test failures can still be readable.

A snapshot is now also printed on failure so that there is no need to
run the test again with Screen:snapshot_util().
2023-12-20 22:15:51 +08:00
zeertzjq
e25cce5f71 vim-patch:9.0.2178: reg_executing() wrong for :normal with range
Problem:  reg_executing() returns wrong result in :normal with range
          when 'showcmd' is set (after 8.2.4705).
Solution: Reset "pending_end_reg_executing" when executing a register.

closes: vim/vim#13707

615202bd0e
(cherry picked from commit 2d1143f285)
2023-12-19 21:27:37 +00:00
zeertzjq
2f5ba9c543 fix(api): don't set coladd of mark
(cherry picked from commit a07a651ac0)
2023-12-19 00:01:25 +00:00
zeertzjq
9caec77fae vim-patch:9.0.2159: screenpos() may crash with neg. column
Problem:  screenpos() may crash with neg. column
Solution: validate and correct column

closes: vim/vim#13669

ec54af4e26
(cherry picked from commit 6052fac625)
2023-12-12 22:18:11 +00:00
zeertzjq
f4642d4c81 test(inccommand_spec): actually trigger 'inccommand' preview
(cherry picked from commit 93011add10)
2023-12-07 08:39:48 +00:00
zeertzjq
1d9ef90115 test: fix dependencies between test cases
Discovered using --shuffle argument of busted.

(cherry picked from commit f273a5a529)
2023-12-07 07:38:08 +00:00
zeertzjq
0fdbb0ea73 fix(inccommand): save and restore '[ and '] marks
Undoing a change moves '[ and '] marks, so it is necessary to save and
restore them.

(cherry picked from commit 8002176c24)
2023-12-07 04:04:20 +00:00
zeertzjq
26016ab47a vim-patch:9.0.2151: 'breakindent' is not drawn after diff filler lines
Problem:  'breakindent' is not drawn after diff filler lines.
Solution: Correct check for whether 'breakindent' should be drawn.

closes: vim/vim#13624

588f20dece
2023-12-06 07:24:20 +08:00
Jaehwang Jung
6e05f8afff fix(change): update fold after on_bytes
Problem:
With vim.treesitter.foldexpr, `o`-ing two lines above a folded region
opens the fold. This does not happen with legacy foldexprs. For example,
make a markdown file with the following text (without indentation),
enable treesitter fold, and follow the instruction in the text.

    put cursor on this line and type zoo<Esc>
    initially folded, revealed by zo
    # then this fold will be opened
    initially folded, revealed by o<Esc>

Analysis:
* `o` updates folds first (done in `changed_lines`), evaluating
  foldexpr, and then invokes `on_bytes` (done in `extmark_splice`).
* Treesitter fold allocates the foldinfo for added lines (`add_range`)
  on `on_bytes`.
* Therefore, when treesitter foldexpr is invoked while running `o`, it
  sees outdated foldinfo.

Solution:
`extmark_splice`, and then `changed_lines`. This seems to be the
standard order in other places, e.g., `nvim_buf_set_lines`.
2023-12-06 07:19:11 +08:00
github-actions[bot]
8a4464cd14
[Backport release-0.9] fix: vim.treesitter.get_node() now correctly takes opts.lang (#26382)
[Backport release-0.9] fix(treesitter): allow passing lang to get_node()
2023-12-04 10:03:55 +01:00
zeertzjq
2fed9d83bc fix(api): use a conditional stack for nvim_cmd
(cherry picked from commit c0b9bdc4a3)
2023-12-01 05:56:24 +00:00
zeertzjq
18ae9cb35f test: :terminal when 'shell' uses backslashes 2023-11-30 08:00:09 +08:00
zeertzjq
22270ae8e9
test(ex_terminal_spec): unskip tests that work on Windows (#26311) 2023-11-30 07:28:32 +08:00
James McCoy
66edb17b13 fix(oldtest): always use a 64-bit int for swapfile block number
09d4133 changed blocknr_T from long to int64_t, so pe_bnum is now always 64-bit.  This was an incompatible change in the swapfile format for 32-bit systems, but there have been no complaints in the past 9 years so just adjust the test.

(cherry picked from commit a1ded1b113)
2023-11-25 12:14:19 +00:00
Luuk van Baal
a27e683ca5 fix(mouse): avoid dragging when clicking next to popupmenu
(cherry picked from commit bce65ee429)
2023-11-24 23:10:41 +00:00
Luuk van Baal
2640ad0057 fix(mouse): avoid dragging after click label popupmenu callback
(cherry picked from commit c9be619f28)
2023-11-24 01:16:09 +00:00
zeertzjq
3ed71c250c vim-patch:9.0.0598: using negative array index with negative width window
Problem:    Using negative array index with negative width window.
Solution:   Make sure the window width does not become negative.

8279af514c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-23 15:58:19 +08:00
zeertzjq
cc8837db46 vim-patch:9.0.0492: cmdwin test fails on MS-Windows
Problem:    Cmdwin test fails on MS-Windows.
Solution:   Skip test on MS-Windows.

312af65d1a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-23 15:58:14 +08:00
zeertzjq
d6f3b7bec7 vim-patch:9.0.0490: using freed memory with cmdwin and BufEnter autocmd
Problem:    Using freed memory with cmdwin and BufEnter autocmd.
Solution:   Make sure pointer to b_p_iminsert is still valid.

1c3dd8ddcb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-23 15:58:09 +08:00
zeertzjq
c0855bfe8a vim-patch:9.0.0249: no test for what 9.0.0234 fixes
Problem:    No test for what 9.0.0234 fixes.
Solution:   Add a test. (issue vim/vim#10950)

3a7ad904d2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-23 15:58:01 +08:00
zeertzjq
72b709fff9 vim-patch:9.0.0218: reading before the start of the line
Problem:    Reading before the start of the line.
Solution:   When displaying "$" check the column is not negative.

e98c88c44c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-23 15:57:51 +08:00
zeertzjq
a9ea563b44 vim-patch:9.0.0064: confusing error when using "q:" in command line window
Problem:    Confusing error when using "q:" in command line window.
Solution:   Check for the situation and give a better error message.
            (closes vim/vim#10756)

c963ec31a0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-23 15:57:39 +08:00
Justin M. Keyes
2a467acc86
fix(defaults): set 'fsync' #26039
backport #26034

Problem:
'nofsync' may lose data if the system has a hard shutdown. #9888

Solution:
Change default to 'fsync'. This may be revisited in the future when
'nofsync' can be made safer.

Co-authored-by: Ploum <1233155+ploum@users.noreply.github.com>
2023-11-14 03:34:59 -08:00
zeertzjq
954696dda8 fix(highlight): apply 'winblend' to float border 2023-11-11 15:21:30 +08:00
altermo
1413f3a971 fix(lua): correct return value for on_key with no arguments
(cherry picked from commit 3edc8417f0)
2023-11-07 00:33:58 +00:00
zeertzjq
5b87e58c5a fix(terminal): keep focus when scrolling number column of another window
(cherry picked from commit ca0a603bce)
2023-10-31 07:23:40 +00:00
zeertzjq
edbe109762 fix(terminal): don't lose focus on <MouseMove>
(cherry picked from commit e96b3133ef)
2023-10-31 04:06:24 +00:00
zeertzjq
faa0b1028a fix(terminal): avoid Insert mode in Terminal buffer
(cherry picked from commit 9a73cac99c)
2023-10-29 01:32:22 +00:00
zeertzjq
bd2a15121d fix(terminal): assign channel to terminal earlier 2023-10-25 10:02:16 +08:00
zeertzjq
45b0e6d589 fix(marks): handle switching buffer properly
(cherry picked from commit 1f00390016)
2023-10-24 08:10:55 +00:00
zeertzjq
08a9834859 ci(cirrus): don't run lua/help_spec
(cherry picked from commit 7a0ab4f333)
2023-10-20 23:22:06 +00:00
zeertzjq
13f3bef685 fix(move): check the correct buffer
(cherry picked from commit 56ffab5522)
2023-10-18 02:35:16 +00:00
zeertzjq
2fbd9f7cd4 test(autocmd/termxx_spec): fix flakiness
(cherry picked from commit e1020a63f7)
2023-10-17 23:19:52 +00:00
github-actions[bot]
87bfa82bdf
[Backport release-0.9] feat(highlight): Allow hyphens (-) in highlight group names (#25661)
feat(highlight): allow hyphens (-) in highlight group names

Fixes: https://github.com/neovim/neovim/issues/23184
(cherry picked from commit f37916b93b)

Co-authored-by: Gregory Anders <greg@gpanders.com>
2023-10-15 14:21:54 -05:00
zeertzjq
f06daa91ed test(terminal/channel_spec): fix flakiness
(cherry picked from commit 89c0adb252)
2023-10-14 22:39:01 +00:00
nwounkn
b90dd608a9 fix(ui): empty line before the next message after :silent command
Problem:
  The next command after `silent !{cmd}` or `silent lua print('str')`
  prints an empty line before printing a message, because these commands
  set `msg_didout = true` despite not printing any messages.

Solution:
  Set `msg_didout = true` only if `msg_silent == 0`
2023-10-14 15:02:46 +08:00
zeertzjq
9ee75f4781 fix(lsp): handle NUL bytes in popup text
Fix #25610

(cherry picked from commit 762a9e138b)
2023-10-12 07:40:01 +00:00
Christian Clason
837f64f98a
[backport release-0.9] backport #25464 (#25560)
feat(lsp): fallback to code-action command on resolve failure
2023-10-09 16:39:30 +02:00
ii14
eddead1cad fix(autocmd): api functions accepting garbage after event name
"VimEnter foo" was accepted as a valid event name for "VimEnter".
Events delimited with commas, eg. "VimEnter,BufRead", were also
accepted, even though only the first event was actually parsed.

(cherry picked from commit 1397016259)
2023-10-09 12:18:43 +02:00