Commit Graph

4994 Commits

Author SHA1 Message Date
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
2f5ba9c543 fix(api): don't set coladd of mark
(cherry picked from commit a07a651ac0)
2023-12-19 00:01:25 +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
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
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
zeertzjq
e0d98bd25d fix(terminal): check terminal size at end of screen update 2023-10-04 07:29:24 +08:00
zeertzjq
749ff7a342 vim-patch:9.0.1772: Cursor may be adjusted in 'splitkeep'ed windows
Problem:    Cursor is adjusted in window that did not change in size by
            'splitkeep'.
Solution:   Only check that cursor position is valid in a window that
            has changed in size.

closes: vim/vim#12509

16af913eee

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2023-10-04 06:30:24 +08:00
Leonardo Mello
a0da8c3e69 fix(path): accept special characters on Windows
(cherry picked from commit 33f97c1ed2)
2023-10-03 22:05:22 +00:00
nwounkn
e298c01cfb fix(ui): "resize -1" with cmdheight=0
Problem:
Crash from:

    set cmdheight=0 redrawdebug=invalid
    resize -1

Solution:
Do not invalidate first `p_ch` `msg_grid` rows in `update_screen` when
scrolling the screen down after displaying a message, because they may
be used later for drawing cmdline.
Fixes #22154
2023-09-30 07:01:41 +08:00
zeertzjq
00c3ffdb4b fix(api): handle NUL in nvim_err_write() and nvim_out_write()
(cherry picked from commit 49254ddebe)
2023-09-25 03:06:35 +00:00
zeertzjq
792b10d03e fix(exception): remember whether message is multiline
(cherry picked from commit bfd396d986)
2023-09-25 00:23:48 +00:00
zeertzjq
fd0ff7665c fix(float): fix some other crashes with :unhide or :all
(cherry picked from commit 462fbcb293)
2023-09-23 14:34:04 +00:00
zeertzjq
8063aa7cf6 fix(lua): show error message when failing to set variable
(cherry picked from commit 2c5d373ede)
2023-09-23 07:59:59 +00:00
zeertzjq
c16af962db fix(unhide): close floating windows first
(cherry picked from commit 61ded79115)
2023-09-23 06:43:18 +00:00
zeertzjq
a89c385f33 fix(statuscolumn): update number hl for each screen line
(cherry picked from commit b2332e0853)
2023-09-20 23:03:47 +00:00
zeertzjq
1b8132880d test(tui_spec): update cursor_address test for wrap flag
(cherry picked from commit 186895bca4)
2023-09-19 22:56:17 +00:00
Phelipe Teles
3a5b46e6bb fix(lua): not using global value in vim.opt_global 2023-09-17 06:44:43 +08:00
zeertzjq
aa04090e92 test(plugin/man_spec): use pesc() on actual_file in pattern
(cherry picked from commit 8f1e344339)
2023-09-16 22:08:11 +00:00
github-actions[bot]
cdb8c46253
[Backport release-0.9] fix: invoke changed_bytes when rewriting tabs (#25174)
fix: invoke changed_bytes when rewriting tabs

When tabstop and shiftwidth are not equal, tabs are inserted as individual
spaces and then rewritten as tab characters in a second pass. That second pass
did not call changed_bytes which resulted in events being omitted.

Fixes #25092

(cherry picked from commit 7476715765)

Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
2023-09-15 04:12:21 -07:00
zeertzjq
d1cce10702 fix(float): update position of anchored windows first
(cherry picked from commit 4ca0441e14)
2023-09-13 23:42:42 +00:00
zeertzjq
284c2e0124 fix(mouse): click on 'statuscolumn' with 'rightleft'
(cherry picked from commit 1fc29b920f)
2023-09-11 00:29:52 +00:00
zeertzjq
ed626d2f8f vim-patch:9.0.1840: [security] use-after-free in do_ecmd
Problem:  use-after-free in do_ecmd
Solution: Verify oldwin pointer after reset_VIsual()

e1dc9a6275

N/A patches for version.c:
vim-patch:9.0.1841: style: trailing whitespace in ex_cmds.c

Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 2ffd8d98fa)
2023-09-03 03:16:02 +00:00