Commit Graph

25467 Commits

Author SHA1 Message Date
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
github-actions[bot]
f77b2740ee
[Backport release-0.9] docs(lsp): remove vim.lsp.sync (#23419)
docs(lsp): remove vim.lsp.sync

The module is used internally and not intended to be used by plugins or
users.

(cherry picked from commit 02d5a678fb)

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2023-05-01 11:51:30 +02:00
github-actions[bot]
98a90abca9
[Backport release-0.9] perf(lsp): process semantic tokens response in a coroutine that yields every 5ms (#23414)
perf(lsp): process semantic tokens response in a coroutine that yields every 5ms

(cherry picked from commit 46cd1d957c)

Co-authored-by: John Drouhard <john@drouhard.dev>
2023-05-01 07:27:44 +02:00
zeertzjq
fc2822a819
Merge pull request #23413 from neovim/backport-23400-to-release-0.9
[Backport release-0.9] fix(spell): extmark with spell=false should disable spell
2023-05-01 12:41:06 +08: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
e81b2eb94a
Merge pull request #23372 from neovim/backport-23371-to-release-0.9
[Backport release-0.9] vim-patch:8.2.3509: undo file is not synced
2023-04-28 21:24:15 +08:00
zeertzjq
5c2f442a74 vim-patch:8.2.3509: undo file is not synced
Problem:    Undo file is not synced. (Sami Farin)
Solution:   Sync the undo file if 'fsync' is set. (Christian Brabandt,
            closes vim/vim#8879, closes vim/vim#8920)

340dd0fbe4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
(cherry picked from commit ff5b103ac7)
2023-04-28 13:07:22 +00:00
zeertzjq
fb73bfd667
[Backport release-0.9] fix(tui): position cursor at bottom-left before stopping 2023-04-28 20:53:11 +08:00
zeertzjq
6a8d1bb90b fix(tui): position cursor at bottom-left before stopping
Fix #23361
2023-04-28 20:30:01 +08:00
zeertzjq
feb8134b43
Merge pull request #23359 from neovim/backport-23358-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1494: crash when recovering from corrupted swap file
2023-04-28 09:23:22 +08: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
66a196c951
Merge pull request #23334 from neovim/backport-23333-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1491: wrong scrolling with ls=0 and :botright split
2023-04-27 09:18:52 +08: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
zeertzjq
53d29a8b62
Merge pull request #23332 from neovim/backport-23305-to-release-0.9
[Backport release-0.9] refactor: remove unnecessary height change in frame_add_hsep()
2023-04-27 08:20:06 +08:00
zeertzjq
26aa39f80c refactor: remove unnecessary height change in frame_add_hsep()
This height change is wrong, and the height will be overwritten later by
another height change.

(cherry picked from commit 0a4ea7eb55)
2023-04-27 00:04:20 +00:00
zeertzjq
a8c62d3024
Merge pull request #23328 from neovim/backport-23288-to-release-0.9
[Backport release-0.9] fix(normal): fix repeated trigger modechanged for scheduled callback
2023-04-27 00:35:01 +08: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
zeertzjq
4bc50de152
fixup: remove trailing space 2023-04-25 14:05:57 +08:00
zeertzjq
a7578a873c
revert: "fix(ui_client): check return code of dup()"
This reverts commit c0845343b6.
2023-04-25 14:04:39 +08:00
zeertzjq
af6669cd35
Merge pull request #23304 from neovim/backport-23258-to-release-0.9
[Backport release-0.9] fix(statusline): also allow right click when 'mousemodel' is "popup*"
2023-04-25 11:18:42 +08: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
zeertzjq
0c8e2d128e
Merge pull request #23300 from neovim/backport-23296-to-release-0.9
[Backport release-0.9] fix(column): don't reset 'statuscolumn' width after it has been drawn
2023-04-24 22:36:40 +08:00
Luuk van Baal
f991ddd1ab fix(column): don't reset 'statuscolumn' width after it has been drawn
Problem:     'statuscolumn' width may be reset after it has been drawn
              when multiple windows contain the same buffer. This results
              in an offset for the drawn cursor position.
Solution:     Loop over all windows (twice) prior to drawing them to
              reset the 'statuscolumn' width and validate the sign
              column when necessary.
(cherry picked from commit 89f9921a9e)
2023-04-24 14:22:31 +00:00
zeertzjq
a977c8b5fe
Merge pull request #23299 from neovim/backport-23252-to-release-0.9
[Backport release-0.9] build: include all dependency directories when generating headers
2023-04-24 17:48:35 +08:00
dundargoc
f5bf29a0ad build: include all dependency directories when generating headers
This will add all interface include directories property from all
targets to main_lib. This may not be universally wanted, in which case
we can revisit/rework it.

Closes https://github.com/neovim/neovim/issues/23237.

(cherry picked from commit 096e91b988)
2023-04-24 07:48:11 +00:00
zeertzjq
deec5e6e2a
Merge pull request #23277 from neovim/backport-23267-to-release-0.9
[Backport release-0.9] test(lsp): fix unstable tests for semantic tokens
2023-04-23 10:21:09 +08: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
zeertzjq
d7b720f3d8
Merge pull request #23276 from neovim/backport-23210-to-release-0.9
[Backport release-0.9] fix(api): avoid assertion when autocmd group id is 0
2023-04-23 09:37:00 +08: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
f960f2621d
Merge pull request #23274 from neovim/backport-23273-to-release-0.9
[Backport release-0.9] vim-patch:9.0.1477: crash when recovering from corrupted swap file
2023-04-23 08:36:30 +08: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
c52085997b
Merge pull request #23248 from neovim/backport-23234-to-release-0.9
[Backport release-0.9] fix(lua): vim.split may trim inner empty items
2023-04-21 10:20:01 -04:00
Justin M. Keyes
127a483142 refactor(lua): simplify vim.gsplit impl
(cherry picked from commit 824766612d)
2023-04-21 12:05:39 +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
zeertzjq
5cb6c44e30
Merge pull request #23246 from zeertzjq/backport-23225-to-release-0.9
[Backport release-0.9] fix(usercmd): fix buffer overflow in uc_list()
2023-04-21 19:52:23 +08:00
dundargoc
df3982e704
feat(checkhealth): add shims for health functions (#23241)
This is for plugins wanting to support many versions of neovim.
2023-04-21 13:39:03 +02: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
zeertzjq
1085e91876
Merge pull request #23245 from neovim/backport-23239-to-release-0.9
[Backport release-0.9] Fix compiler warnings detected by gcc 13
2023-04-21 19:15:55 +08:00
Andreas Schneider
c0845343b6 fix(ui_client): check return code of dup()
gsrc/nvim/ui_client.c: In function ‘ui_client_start_server’:
gsrc/nvim/ui_client.c:68:5: warning: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   68 |     dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit 4d654472e6)
2023-04-21 11:06:22 +00:00
Andreas Schneider
a99d5d17d5 fix(statusline): fix uninitialized variable and possible overflow
In file included from /usr/include/string.h:535,
                 from gsrc/nvim/statusline.c:10:
In function ‘strcat’,
    inlined from ‘build_stl_str_hl’ at gsrc/nvim/statusline.c:1688:9:
/usr/include/bits/string_fortified.h:130:10: warning: ‘p’ may be used uninitialized [-Wmaybe-uninitialized]
  130 |   return __builtin___strcat_chk (__dest, __src, __glibc_objsize (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit 54f5602038)
2023-04-21 11:06:22 +00:00
Andreas Schneider
a77a8a9934 fix(linematch): initialize array
gsrc/nvim/linematch.c: In function ‘try_possible_paths’:
gsrc/nvim/linematch.c:204:35: warning: ‘from_vals’ may be used uninitialized [-Wmaybe-uninitialized]
  204 |       size_t unwrapped_idx_from = unwrap_indexes(from_vals, diff_len, ndiffs);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit f5530bf566)
2023-04-21 11:06:22 +00:00
Andreas Schneider
6b32fe96b0 fix(ex_getln): initialize pointer with NULL
In function ‘cmdpreview_open_win’,
    inlined from ‘cmdpreview_may_show’ at gsrc/nvim/ex_getln.c:2487:28:
gsrc/nvim/ex_getln.c:2251:16: warning: ‘cmdpreview_buf’ may be used uninitialized [-Wmaybe-uninitialized]
 2251 |   int result = do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, cmdpreview_buf->handle, 0);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(cherry picked from commit a114a21eff)
2023-04-21 11:06:22 +00:00
Andreas Schneider
6ba14ff182 fix(userfunc): fix possible out of bound access
In file included from /usr/include/string.h:535,
                 from gsrc/nvim/eval/userfunc.c:11:
In function ‘strcpy’,
    inlined from ‘cat_func_name’ at gsrc/nvim/eval/userfunc.c:662:5,
    inlined from ‘get_user_func_name’ at gsrc/nvim/eval/userfunc.c:2854:5:
/usr/include/bits/string_fortified.h:79:10: warning: ‘__builtin___strcpy_chk’ offset 0 from the object at ‘<unknown>’ is out of the bounds of referenced subobject ‘uf_name’ with ty
pe ‘char[]’ at offset 0 [-Warray-bounds=]
   79 |   return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gsrc/nvim/eval/typval.h:10,
                 from gsrc/nvim/buffer_defs.h:20,
                 from gsrc/nvim/autocmd.h:8,
                 from gsrc/nvim/eval/userfunc.c:15:
gsrc/nvim/eval/typval_defs.h: In function ‘get_user_func_name’:
gsrc/nvim/eval/typval_defs.h:342:8: note: subobject ‘uf_name’ declared here
  342 |   char uf_name[];    ///< Name of function (actual size equals name);
      |        ^~~~~~~

(cherry picked from commit 9802de9334)
2023-04-21 11:06:22 +00:00
Andreas Schneider
6bd73ed2d9 fix(drawline): initialize variable
src/nvim/drawline.c: In function ‘win_line’:
src/nvim/drawline.c:1418:16: warning: ‘charsize’ may be used uninitialized [-Wmaybe-uninitialized]
 1418 |       wlv.vcol -= charsize;
      |                ^~

(cherry picked from commit 2819718873)
2023-04-21 11:06:22 +00:00
Andreas Schneider
b91278c4fa fix(drawline): initialize variable
src/nvim/drawline.c: In function ‘draw_virt_text’:
src/nvim/drawline.c:298:28: warning: ‘col’ may be used uninitialized [-Wmaybe-uninitialized]
  298 |       state->eol_col = col + 1;
      |                        ~~~~^~~

(cherry picked from commit e9280a68f7)
2023-04-21 11:06:22 +00:00
Andreas Schneider
b2a43b5287 fix(api): avoid integer truncation
gsrc/nvim/api/vim.c: In function ‘nvim_eval_statusline’:
gsrc/nvim/api/vim.c:2268:55: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-tru
ncation=]
 2268 |         snprintf(user_group, sizeof(user_group), "User%d", sp->userhl);
      |                                                       ^~
gsrc/nvim/api/vim.c:2268:50: note: directive argument in the range [1, 2147483647]
 2268 |         snprintf(user_group, sizeof(user_group), "User%d", sp->userhl);
      |                                                  ^~~~~~~~
In file included from /usr/include/stdio.h:906,
                 from gsrc/nvim/api/vim.c:9:
In function ‘snprintf’,
    inlined from ‘nvim_eval_statusline’ at gsrc/nvim/api/vim.c:2268:9:
/usr/include/bits/stdio2.h:54:10: note: ‘__builtin___snprintf_chk’ output between 6 and 15 bytes into a destination of size 6
   54 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   55 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   56 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~

(cherry picked from commit ef7ae66eef)
2023-04-21 11:06:22 +00:00
zeertzjq
400bf2851a
Merge pull request #23244 from neovim/backport-23187-to-release-0.9
[Backport release-0.9] fix(column): rebuild status column when sign column is invalid
2023-04-21 18:59:31 +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