Commit Graph

5598 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
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
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
luukvbaal
6809d3377c vim-patch:9.0.1599: Cursor not adjusted when 'splitkeep' is not "cursor"
Problem:    Cursor not adjusted when near top or bottom of window and
            'splitkeep' is not "cursor".
Solution:   Move boundary checks to outer cursor move functions, inner
            functions should only return valid cursor positions. (Luuk van
            Baal, closes vim/vim#12480)

a109f39ef5
2023-10-04 06:29:47 +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
zeertzjq
d5c16d1bfe vim-patch:9.0.1956: Custom completion skips orig cmdline if it invokes glob()
Problem:  Custom cmdline completion skips original cmdline when pressing
          Ctrl-P at first match if completion function invokes glob().
Solution: Move orig_save into struct expand_T.

closes: vim/vim#13216

28a23602e8
2023-09-30 07:01:41 +08: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
James McCoy
9efc6f7c4d fix(unittests): ignore __s128 and __u128 types in ffi
Linux added these types to their userspace headers in [6.5], which
causes unit tests to fail like

```
-------- Running tests from test/unit/api/private_helpers_spec.lua
RUN       vim_to_object converts true: 17.00 ms ERR
test/unit/helpers.lua:748: test/unit/helpers.lua:732: (string) '
test/unit/helpers.lua:264: ';' expected near '__s128' at line 194'
exit code: 256

stack traceback:
	test/unit/helpers.lua:748: in function 'itp_parent'
	test/unit/helpers.lua:784: in function <test/unit/helpers.lua:774>
```

Since we don't use these types, they can be ignored to avoid LuaJIT's C
parser choking on them.

[6.5]: 224d80c584

(cherry picked from commit 0df0e1198b)
2023-09-29 02:36:35 +00:00
zeertzjq
2b2a20f4ea vim-patch:8.2.3467: CursorHoldI event interferes with "CTRL-G U"
Problem:    CursorHoldI event interferes with "CTRL-G U". (Naohiro Ono)
Solution:   Restore the flag for "CTRL-G U" after triggering CursorHoldI.
            (closes vim/vim#8937)

5a9357d0bf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit a5445f5435)
2023-09-27 11:01:26 +00:00