Commit Graph

5444 Commits

Author SHA1 Message Date
zeertzjq
ae7db749b5 test: move most title tests to a separate file
This avoids running title tests twice unnecessarily.

(cherry picked from commit b6199f667b)
2023-05-11 02:58:36 +00:00
zeertzjq
e019371554 fix(api): don't change title when setting buffer in a window
(cherry picked from commit f2d97a3842)
2023-05-11 02:38:43 +00:00
zeertzjq
4e0cfe3805 fix(highlight): apply 'winblend' to NormalNC
(cherry picked from commit e33790d0f6)
2023-05-10 15:50:26 +00:00
zeertzjq
06bee06ee5 fix(redo): make redo of Lua mappings in op-pending mode work
(cherry picked from commit 5e9ef7b95b)
2023-05-10 09:51:31 +00:00
Christian Clason
17bdaeb79e vim-patch:9.0.1464: strace filetype detection is expensive
Problem:    Strace filetype detection is expensive.
Solution:   Match with a cheap pattern first. (Federico Mengozzi,
            closes vim/vim#12220)

6e5a9f9482

Co-authored-by: Federico Mengozzi <19249682+fedemengo@users.noreply.github.com>
(cherry picked from commit 9808866d57)
2023-05-10 07:05:51 +00:00
Luuk van Baal
59ee42d05e fix(tui): grid_clear properly clears the screen
Problem:    When setting a shell size smaller than the containing
            terminal window through `:winsize` or `:set lines/columns`
            the screen is not properly cleared.
Solution:   Clear the tui dimensions rather than the grid dimensions.
(cherry picked from commit 197827321a)
2023-05-09 19:29:14 +00:00
github-actions[bot]
1a104253df
[Backport release-0.9] fix(lsp): fix relative patterns for workspace/didChangeWatchedFiles (#23559)
fix(lsp): fix relative patterns for `workspace/didChangeWatchedFiles`

(cherry picked from commit 10f102a3a3)

Co-authored-by: Jon Huhn <huhnjon@gmail.com>
2023-05-09 18:23:22 +02:00
zeertzjq
152c07249e fix(statusline): bail out properly on negative row
(cherry picked from commit 89274f9221)
2023-05-08 08:25:22 +00:00
zeertzjq
bdb7c180b7 test: add more tests for :Man section extraction
(cherry picked from commit 3001d86aea)
2023-05-08 08:09:54 +00:00
zeertzjq
592e4459fa
Merge pull request #23503 from neovim/backport-23415-to-release-0.9
[Backport release-0.9] fix(tui): redraw on SIGWINCH even if size didn't change
2023-05-06 18:00:22 +08:00
github-actions[bot]
1b09bcef52
[Backport release-0.9] fix(treesitter): redraw added/removed injections properly (#23408)
fix(treesitter): redraw added/removed injections properly

When injections are added or removed make sure to:
- invoke 'changedtree' callbacks for when new trees are added.
- invoke 'changedtree' callbacks for when trees are invalidated
- redraw regions when languagetree children are removed

(cherry picked from commit b68157834a)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-05-06 11:55:51 +02:00
zeertzjq
c464df84f7 fix(tui): redraw on SIGWINCH even if size didn't change
(cherry picked from commit 0f1b511f23)
2023-05-06 09:48:54 +00:00
zeertzjq
7c48810397
Merge pull request #23457 from neovim/backport-23456-to-release-0.9
[Backport release-0.9] fix(mouse): fix popup menu position check with winbar
2023-05-03 11:10:56 +08:00
mliszcz
106695d47e test(lsp_spec): fix unstable tests for set_defaults
In the `test_rpc_server` procedure, both `on_setup` and `on_init`
callbacks can run concurrently in some scenarios. This caused some CI
failures in tests for the LSP set_defaults feature.

This commit attempts to fix this by merging those two callbacks in the
impacted tests.

See: https://github.com/neovim/neovim/actions/runs/4553550710/attempts/1
(cherry picked from commit c2f5159987)
2023-05-03 02:43:23 +00:00
zeertzjq
56e0b425ea fix(mouse): fix popup menu position check with winbar
(cherry picked from commit e37fb2515d)
2023-05-03 02:29:39 +00:00
zeertzjq
61351adee8 fix(pum): don't position too far with resized parent grid
(cherry picked from commit 1fa6482faf)
2023-05-02 22:18:12 +00:00
zeertzjq
5fbe8409b5 fix(pum): fix missing scrollbar with 'rightleft'
(cherry picked from commit 3d1a9eeb1b)
2023-05-02 17:13:23 +00:00
zeertzjq
bbf600b7b5 fix(pum): fix missing rightmost column with 'rightleft'
(cherry picked from commit 97ac7e10c6)
2023-05-02 15:55:42 +00:00
zeertzjq
5267e7b07a fix(mouse): fix popup_setpos position check with ext_multigrid
(cherry picked from commit 50f6609032)
2023-05-02 07:25:59 +00:00
zeertzjq
20f5f4e916 fix(normal): make "g$" work properly with resized grid
(cherry picked from commit 088cdf69e3)
2023-05-02 04:28:44 +00:00
zeertzjq
5b158b9375 fix(drawline): make cursorlineopt=screenline work with resized grid
(cherry picked from commit 37b73cf14b)
2023-05-02 04:28:43 +00:00
zeertzjq
c693df02b3 fix(float): make bufpos work properly with resized parent grid
(cherry picked from commit 03e8b5fc91)
2023-05-02 04:28:43 +00:00
zeertzjq
11a0fc9644 vim-patch:9.0.1493: popup menu position wrong in window with toolbar
Problem:    Popup menu position wrong in window with toolbar.
Solution:   Take the window toolbar into account when positioning the popup
            menu. (closes vim/vim#12308)

4e1ca0d9a6

Fixed in the previous commit. Test only.

(cherry picked from commit aca226d728)
2023-05-02 03:59:44 +00:00
zeertzjq
756b74758d fix(pum): make :popup position correctly with float border
(cherry picked from commit fbaa278773)
2023-05-02 03:59:44 +00:00
zeertzjq
f5cf033314 fix(pum): position properly with ext_multigrid
(cherry picked from commit 239d19d908)
2023-05-02 03:46:37 +00:00
zeertzjq
5c30930fec fix(pum): show right-click menu above cmdline area
(cherry picked from commit 1d7172e925)
2023-05-02 03:36:07 +00:00
zeertzjq
b8b1221e58 vim-patch:9.0.1476: lines put in non-current window are not displayed
Problem:    Lines put in non-current window are not displayed. (Marius
            Gedminas)
Solution:   Don't increment the topline when inserting just above it.
            (closes vim/vim#12212)

e7f05a8780

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 60f21d96c6)
2023-05-02 03:21:00 +00:00
zeertzjq
b8d0a2d2b2 fix(spell): extmark with spell=false should disable spell
(cherry picked from commit 6d47d77449)
2023-05-01 04:31:14 +00:00
zeertzjq
d926f92ba1 vim-patch:9.0.1494: crash when recovering from corrupted swap file
Problem:    Crash when recovering from corrupted swap file.
Solution:   Bail out when the line index looks wrong. (closes vim/vim#12276)

bf1b713202

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit 21136d49dd)
2023-04-27 22:28:12 +00:00
zeertzjq
d366a1f8ed vim-patch:9.0.1491: wrong scrolling with ls=0 and :botright split
Problem:    Wrong scrolling with ls=0 and :botright split.
Solution:   Add statusline before calling frame_new_height(). (closes vim/vim#12299)

fbf2071ac9
(cherry picked from commit fa38c7ce4d)
2023-04-27 01:07:50 +00:00
Munif Tanjim
c236e674ce test: scheduled callback shouldn't trigger ModeChanged repeatedly
(cherry picked from commit a35bca2112)
2023-04-26 16:24:00 +00:00
zeertzjq
0874a14dcf vim-patch:9.0.1490: the ModeChanged event may be triggered too often
Problem:    The ModeChanged event may be triggered too often.
Solution:   Only trigger ModeChanged when no operator is pending.
            (closes vim/vim#12298)

73916bac5a
(cherry picked from commit e0d6703a6a)
2023-04-26 16:24:00 +00:00
Luuk van Baal
f24449d35c fix(statusline): also allow right click when 'mousemodel' is "popup*"
Problem:    The 'statusline'-format ui elements do not receive right
            click events when "mousemodel" is "popup*"
Solution:   Do not draw popupmenu and handle click event instead.
(cherry picked from commit 6b5b6e5e07)
2023-04-25 03:05:22 +00:00
John Drouhard
d6deffad57 test(lsp): fix unstable tests for semantic tokens
add screen:expect() calls after insert() to make sure the screen has
been drawn before we assert the state of the semantic tokens table

(cherry picked from commit e97b6536bb)
2023-04-23 02:02:04 +00:00
Dhruv Manilawala
39ae0a0b7a fix(api): avoid assertion when autocmd group id is 0
(cherry picked from commit 3a35d7c0e8)
2023-04-23 01:23:48 +00:00
zeertzjq
e937b9a9c7 vim-patch:9.0.1477: crash when recovering from corrupted swap file
Problem:    Crash when recovering from corrupted swap file.
Solution:   Check for a valid page count. (closes vim/vim#12275)

b67ba03d3e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit dcb6b5c62d)
2023-04-23 00:24:29 +00:00
Justin M. Keyes
2363d44d5a fix(lua): vim.split may trim inner empty items
Problem:
`vim.split('a:::', ':', {trimempty=true})` trims inner empty items.
Regression from 9c49c10470

Solution:
Set `empty_start=false` when first non-empty item is found.
close #23212

(cherry picked from commit 622b1ae38a)
2023-04-21 12:05:39 +00:00
Andreas Schneider
30cfd28257 fix(usercmd): fix buffer overflow in uc_list()
Build with: -Wp,-D_FORTIFY_SOURCE=3 -O1 and gcc 13.

*** buffer overflow detected ***: terminated

(gdb) bt
  #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
  #1  0x00007f3eb8b93c03 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
  #2  0x00007f3eb8b42aee in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
  #3  0x00007f3eb8b2b87f in __GI_abort () at abort.c:79
  #4  0x00007f3eb8b2c60f in __libc_message (fmt=fmt@entry=0x7f3eb8ca72e6 "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:150
  #5  0x00007f3eb8c27b29 in __GI___fortify_fail (msg=msg@entry=0x7f3eb8ca728c "buffer overflow detected") at fortify_fail.c:24
  #6  0x00007f3eb8c26364 in __GI___chk_fail () at chk_fail.c:28
  #7  0x00007f3eb8c25f45 in ___snprintf_chk (s=s@entry=0x55b8c7c096a5 <IObuff+5> "t' item", maxlen=maxlen@entry=1025, flag=flag@entry=2, slen=slen@entry=1020, format=format@entry=0x55b8c7b872a6 "%ldc") at snprintf_chk.c:29
  #8  0x000055b8c7aea59f in snprintf (__fmt=0x55b8c7b872a6 "%ldc", __n=1025, __s=0x55b8c7c096a5 <IObuff+5> "t' item") at /usr/include/bits/stdio2.h:54
  #9  uc_list (name=name@entry=0x55b8c8351788 "Explore", name_len=name_len@entry=7) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/usercmd.c:534
  #10 0x000055b8c7aeb8a0 in ex_command (eap=0x7fffdc350e60) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/usercmd.c:1009
  #11 0x000055b8c7972537 in execute_cmd0 (retv=retv@entry=0x7fffdc350e54, eap=eap@entry=0x7fffdc350e60, errormsg=errormsg@entry=0x7fffdc350e58, preview=preview@entry=false) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:1620
  #12 0x000055b8c7975c55 in do_one_cmd (cmdlinep=cmdlinep@entry=0x7fffdc3510b8, flags=flags@entry=0, cstack=cstack@entry=0x7fffdc351140, fgetline=fgetline@entry=0x55b8c79882b8 <getexline>, cookie=cookie@entry=0x0) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:2279
  #13 0x000055b8c79767fe in do_cmdline (cmdline=<optimized out>, fgetline=0x55b8c79882b8 <getexline>, cookie=0x0, flags=0) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/ex_docmd.c:578
  #14 0x000055b8c7a17463 in nv_colon (cap=0x7fffdc351780) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:3228
  #15 0x000055b8c7a11b35 in normal_execute (state=0x7fffdc351700, key=<optimized out>) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:1196
  #16 0x000055b8c7ab0994 in state_enter (s=0x7fffdc351700) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/state.c:99
  #17 0x000055b8c7a0ef68 in normal_enter (cmdwin=false, noexmode=false) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/normal.c:497
  #18 0x000055b8c78a0640 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/main.c:641
2023-04-21 19:25:37 +08:00
Luuk van Baal
a5d8024b24 fix(column): rebuild status column when sign column is invalid
(cherry picked from commit 44d4f03573)
2023-04-21 10:46:50 +00:00
Luuk van Baal
2d3c825ada test(column): statuscolumn is rebuild when signs are (un)placed
(cherry picked from commit d799456a6b)
2023-04-21 10:46:50 +00:00
github-actions[bot]
a41930bcf0
[Backport release-0.9] fix(watchfiles): skip Created events when poll starts (#23197)
fix(watchfiles): skip Created events when poll starts

(cherry picked from commit 8ca1bae217)

Co-authored-by: Jon Huhn <huhnjon@gmail.com>
2023-04-19 16:55:06 +02:00
zeertzjq
30581744e4 test(terminal/channel_spec): fix screen test immediate success
Check for the [No Name] after wiping the buffer.

(cherry picked from commit 954fe75eab)
2023-04-19 04:10:23 +00:00
github-actions[bot]
535d8553c4
[Backport release-0.9] fix(loader): reset hashes when running the loader (#23181)
fix(loader): only keep hashes for the current loop iteration

(cherry picked from commit e12cfa567f)

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-04-18 17:08:45 +02:00
Luuk van Baal
54f930f4e3 fix(api): extmark highlight groups not always included in details
Problem:    Erroneous for loop condition.
Solution:   Remove for loop condition.
(cherry picked from commit 5d97d61eab)
2023-04-18 13:08:35 +00:00
Sean Dewar
470aa2dbf9 fix(ruler): show ruler of curwin with no statusline in cmdline
Problem: After neovim/neovim@846a056, only the ruler for current floating or
last window without a statusline is drawn in the cmdline. This means that if the
current window is not one of these, but has no statusline, its ruler will not be
drawn anymore.

Solution: Make `showmode()` draw the ruler of the current window or the last
window in the cmdline if it has no statusline. This also maintains the
previously restored floating window case (`float->w_status_height` should be 0).

This behaviour should again match Vim, but without the overdraw it seems to do
to achieve the same effect; it calls `showmode()` to draw the ruler for the last
window without a statusline, then may draw over it in `showruler()` (which is
now `show_cursor_info_later()` in Nvim) to show the ruler for the current
window..? It's very confusing.

Also update the logic in `win_redr_ruler()` to mirror the check done in
`showmode()`, so that the ruler doesn't potentially draw over the long
ins-completion mode message in some cases.

(cherry picked from commit 65dd3c1180)
2023-04-18 09:02:02 +00:00
Sean Dewar
ba198bd7cc vim-patch:9.0.1461: ruler not drawn correctly when using 'rulerformat'
Problem:    Ruler not drawn correctly when using 'rulerformat'.
Solution:   Adjust formatting depending on whether the ruler is drawn in the
            statusline or the command line. (Sean Dewar, closes vim/vim#12246)

fc8a601c32

This issue was made apparent after neovim/neovim@0f1e2b6, as `showmode()` calls
`win_redr_ruler()` with `curwin` now if it's floating, rather than the last
window if there's no statusline (which usually already shares its right side
with that of the editor).

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
(cherry picked from commit 7095f8ff9d)
2023-04-18 09:02:02 +00:00
Luuk van Baal
54c6dfa009 fix(mouse): cmdline click registered as statuscolumn
(cherry picked from commit dea3774def)
2023-04-18 00:01:09 +00:00
zeertzjq
fc545cb008 vim-patch:9.0.1460: insufficient testing for getcmdcompltype()
Problem:    Insufficient testing for getcmdcompltype().
Solution:   Add a few more test cases. (closes vim/vim#12268)

961b2e54bd
(cherry picked from commit 56472e5262)
2023-04-17 15:27:23 +00:00
Raphael
79ee63bc36 fix(lua): inspect_pos respect bufnr when get syntax info
(cherry picked from commit ee4d1f9c52)
2023-04-16 09:50:49 +00:00
quintik
fee9452b77 test(winbar_spec): properly update winbar when 'showcmdloc' is "statusline"
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
(cherry picked from commit 80f6d55521)
2023-04-13 23:00:23 +00:00