From 6f123dd44e2e4bacc824ce5b0fe90f60f3fc0891 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 23 Feb 2023 15:47:24 +0100 Subject: [PATCH 01/17] Update License to SPDX expressions https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1 --- neovim.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neovim.spec b/neovim.spec index b33d395..d4e2b5d 100644 --- a/neovim.spec +++ b/neovim.spec @@ -42,7 +42,7 @@ Name: neovim Version: 0.8.3 Release: 1%{?dist} -License: ASL 2.0 +License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility Url: https://neovim.io From d02335e1d276c1e1677ab45f46a0d19902d13235 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 2 Mar 2023 20:46:58 +0100 Subject: [PATCH 02/17] Update spec-template https://fedoraproject.org/wiki/Changes/Rpmautospec_by_Default --- spec-template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec-template b/spec-template index 56340d4..30e6437 100644 --- a/spec-template +++ b/spec-template @@ -1,6 +1,6 @@ Name: Version: -Release: 1%{?dist} +Release: %{autorelease} Summary: License: @@ -35,3 +35,4 @@ Requires: %changelog +%{autochangelog} From b6dd2abffd2a73b4331c3280cbbae73aa93252e0 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 5 Mar 2023 21:55:19 +0100 Subject: [PATCH 03/17] New build for SPDX expression --- neovim.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/neovim.spec b/neovim.spec index d4e2b5d..43a617b 100644 --- a/neovim.spec +++ b/neovim.spec @@ -40,7 +40,7 @@ Name: neovim Version: 0.8.3 -Release: 1%{?dist} +Release: 2%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -1892,6 +1892,10 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Sun Mar 05 2023 Andreas Schneider - 0.8.3-2 +- Update License to SPDX expression +- Update spec template for auto(release|changelog) + * Thu Feb 02 2023 Andreas Schneider - 0.8.3-1 - Update to version 0.8.3 * https://github.com/neovim/neovim/releases/tag/v0.8.3 From 5e437c395fec582092390fab281d160c4c019b44 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sat, 25 Mar 2023 20:49:40 +0100 Subject: [PATCH 04/17] Fix snprintf buffer overflow resolves: rhbz#2165805 --- 22780.patch | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++ neovim.spec | 7 ++- 2 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 22780.patch diff --git a/22780.patch b/22780.patch new file mode 100644 index 0000000..d90b9ae --- /dev/null +++ b/22780.patch @@ -0,0 +1,158 @@ +From a4640cc51fda6b5688c9b79c2d4d7d19e6d758a3 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Sat, 25 Mar 2023 11:26:36 +0100 +Subject: [PATCH] fix: snprintf buffer overflow detected by -D_FORTIFY_SOURCE=3 + +Thread no. 1 (24 frames) + #8 snprintf at /usr/include/bits/stdio2.h:54 + #9 set_cmdarg at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/eval.c:7044 + #10 apply_autocmds_group at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/autocmd.c:1843 + #11 apply_autocmds_exarg at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/autocmd.c:1549 + #12 readfile at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:617 + #13 buf_reload at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:5038 + #14 buf_check_timestamp at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:4952 + #15 check_timestamps at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:4678 + #16 ex_checktime at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_cmds2.c:765 + #17 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1620 + #18 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275 + #19 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584 + #20 ex_execute at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/eval.c:7727 + #21 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1620 + #22 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275 + #23 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584 + #24 do_ucmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/usercmd.c:1661 + #25 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1612 + #26 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275 + #27 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584 + #28 nv_colon at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:4058 + #29 normal_execute at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:1172 + #30 state_enter at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/state.c:88 + #31 normal_enter at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:471 + +Signed-off-by: Andreas Schneider +--- + src/nvim/eval.c | 73 +++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 55 insertions(+), 18 deletions(-) + +diff --git a/src/nvim/eval.c b/src/nvim/eval.c +index cd76d1108..c652d9507 100644 +--- a/src/nvim/eval.c ++++ b/src/nvim/eval.c +@@ -6999,20 +6999,18 @@ char *set_cmdarg(exarg_T *eap, char *oldarg) + { + char *oldval = vimvars[VV_CMDARG].vv_str; + if (eap == NULL) { +- xfree(oldval); +- vimvars[VV_CMDARG].vv_str = oldarg; +- return NULL; ++ goto error; + } + + size_t len = 0; + if (eap->force_bin == FORCE_BIN) { +- len = 6; ++ len += 6; // " ++bin" + } else if (eap->force_bin == FORCE_NOBIN) { +- len = 8; ++ len += 8; // " ++nobin" + } + + if (eap->read_edit) { +- len += 7; ++ len += 7; // " ++edit" + } + + if (eap->force_ff != 0) { +@@ -7027,38 +7025,77 @@ char *set_cmdarg(exarg_T *eap, char *oldarg) + + const size_t newval_len = len + 1; + char *newval = xmalloc(newval_len); ++ size_t xlen = 0; ++ int rc = 0; + + if (eap->force_bin == FORCE_BIN) { +- snprintf(newval, newval_len, " ++bin"); ++ rc = snprintf(newval, newval_len, " ++bin"); + } else if (eap->force_bin == FORCE_NOBIN) { +- snprintf(newval, newval_len, " ++nobin"); ++ rc = snprintf(newval, newval_len, " ++nobin"); + } else { + *newval = NUL; + } ++ if (rc < 0) { ++ goto error; ++ } ++ xlen += (size_t)rc; + + if (eap->read_edit) { +- STRCAT(newval, " ++edit"); ++ rc = snprintf(newval + xlen, newval_len - xlen, " ++edit"); ++ if (rc < 0) { ++ goto error; ++ } ++ xlen += (size_t)rc; + } + + if (eap->force_ff != 0) { +- snprintf(newval + strlen(newval), newval_len, " ++ff=%s", +- eap->force_ff == 'u' ? "unix" : +- eap->force_ff == 'd' ? "dos" : "mac"); ++ rc = snprintf(newval + xlen, ++ newval_len - xlen, ++ " ++ff=%s", ++ eap->force_ff == 'u' ? "unix" ++ : eap->force_ff == 'd' ? "dos" : "mac"); ++ if (rc < 0) { ++ goto error; ++ } ++ xlen += (size_t)rc; + } + if (eap->force_enc != 0) { +- snprintf(newval + strlen(newval), newval_len, " ++enc=%s", +- eap->cmd + eap->force_enc); ++ rc = snprintf(newval + (xlen), newval_len - xlen, " ++enc=%s", eap->cmd + eap->force_enc); ++ if (rc < 0) { ++ goto error; ++ } ++ xlen += (size_t)rc; + } ++ + if (eap->bad_char == BAD_KEEP) { +- STRCPY(newval + strlen(newval), " ++bad=keep"); ++ rc = snprintf(newval + xlen, newval_len - xlen, " ++bad=keep"); ++ if (rc < 0) { ++ goto error; ++ } ++ xlen += (size_t)rc; + } else if (eap->bad_char == BAD_DROP) { +- STRCPY(newval + strlen(newval), " ++bad=drop"); ++ rc = snprintf(newval + xlen, newval_len - xlen, " ++bad=drop"); ++ if (rc < 0) { ++ goto error; ++ } ++ xlen += (size_t)rc; + } else if (eap->bad_char != 0) { +- snprintf(newval + strlen(newval), newval_len, " ++bad=%c", +- eap->bad_char); ++ rc = snprintf(newval + xlen, newval_len - xlen, " ++bad=%c", eap->bad_char); ++ if (rc < 0) { ++ goto error; ++ } ++ xlen += (size_t)rc; + } ++ ++ assert(xlen <= newval_len); ++ + vimvars[VV_CMDARG].vv_str = newval; + return oldval; ++ ++error: ++ xfree(oldval); ++ vimvars[VV_CMDARG].vv_str = oldarg; ++ return NULL; + } + + /// Check if variable "name[len]" is a local variable or an argument. +-- +2.39.2 + diff --git a/neovim.spec b/neovim.spec index 43a617b..61bd937 100644 --- a/neovim.spec +++ b/neovim.spec @@ -40,7 +40,7 @@ Name: neovim Version: 0.8.3 -Release: 2%{?dist} +Release: 3%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -51,6 +51,7 @@ Source1: sysinit.vim Source2: spec-template Patch0: neovim-fix-fortify-source.patch +Patch1: https://github.com/neovim/neovim/pull/22780.patch Patch1000: neovim-lua-bit32.patch @@ -112,6 +113,7 @@ parts of Vim, without compromise, and more. %prep %setup -q %patch0 -p1 +%patch1 -p1 %if %{without luajit} %patch1000 -p1 @@ -1892,6 +1894,9 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Sat Mar 25 2023 Andreas Schneider - 0.8.3-3 +- resolves: rhbz#2165805 - Fix snprintf buffer overflow + * Sun Mar 05 2023 Andreas Schneider - 0.8.3-2 - Update License to SPDX expression - Update spec template for auto(release|changelog) From 5258f585ef7d7e05458153e85d21b1ba9eb61df1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 27 Mar 2023 09:02:16 +0200 Subject: [PATCH 05/17] Fix snprintf buffer overflow with tags resolves: rhbz#2181836 --- 22729.patch | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ neovim.spec | 7 ++++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 22729.patch diff --git a/22729.patch b/22729.patch new file mode 100644 index 0000000..089ce08 --- /dev/null +++ b/22729.patch @@ -0,0 +1,52 @@ +From a917104263ac6dda15a9c9b7ab61e3378aec58a9 Mon Sep 17 00:00:00 2001 +From: koeleck <779769+koeleck@users.noreply.github.com> +Date: Sun, 19 Mar 2023 22:32:37 +0100 +Subject: [PATCH] fix: invalid buffer size argument to snprintf #22729 + +Problem: +Crash in findtags_add_match with FORTIFY_SOURCE=3. +Note: Fedora 38 packages are now built with -D_FORTIFY_SOURCE=3 by default. +1. Compile with overflow protection. +2. nvim --clean +3. :h +4. `*** overflow detected ***: terminated` + +The additional checks for the stated buffer size and the actual bounds +of the buffer do not match. See `___snprintf_chk` in the glibc sources: +https://sourceware.org/git/?p=glibc.git;a=blob;f=debug/snprintf_chk.c;h=59577de076c570b81307dd31c8c73e265808cf4c;hb=HEAD#l28 + +Solution: +Fix arithmetic error: The length of the previously written data is now +subtracted from the total size of the buffer, instead of added on top. + +close #22718 + +Backported by: Andreas Schneider +--- + src/nvim/tag.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/nvim/tag.c b/src/nvim/tag.c +index a8d8eebb0..501f31196 100644 +--- a/src/nvim/tag.c ++++ b/src/nvim/tag.c +@@ -2029,13 +2029,14 @@ parse_line: + // The format is {tagname}@{lang}NUL{heuristic}NUL + *tagp.tagname_end = NUL; + len = (size_t)(tagp.tagname_end - (char_u *)tagp.tagname); +- mfp = xmalloc(sizeof(char) + len + 10 + ML_EXTRA + 1); ++ size_t mfp_size = sizeof(char) + len + 10 + ML_EXTRA + 1; ++ mfp = xmalloc(mfp_size); + + p = (char_u *)mfp; + STRCPY(p, tagp.tagname); + p[len] = '@'; + STRCPY(p + len + 1, help_lang); +- snprintf((char *)p + len + 1 + ML_EXTRA, STRLEN(p) + len + 1 + ML_EXTRA, "%06d", ++ snprintf(p + len + 1 + ML_EXTRA, mfp_size - (len + 1 + ML_EXTRA), "%06d", + help_heuristic(tagp.tagname, + match_re ? matchoff : 0, !match_no_ic) + + help_pri); +-- +2.39.2 + diff --git a/neovim.spec b/neovim.spec index 61bd937..f858ec4 100644 --- a/neovim.spec +++ b/neovim.spec @@ -40,7 +40,7 @@ Name: neovim Version: 0.8.3 -Release: 3%{?dist} +Release: 4%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -52,6 +52,7 @@ Source2: spec-template Patch0: neovim-fix-fortify-source.patch Patch1: https://github.com/neovim/neovim/pull/22780.patch +Patch2: https://github.com/neovim/neovim/pull/22729.patch Patch1000: neovim-lua-bit32.patch @@ -114,6 +115,7 @@ parts of Vim, without compromise, and more. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %if %{without luajit} %patch1000 -p1 @@ -1894,6 +1896,9 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Mon Mar 27 2023 Andreas Schneider - 0.8.3-4 +- resolves: rhbz#2181836 - Fix snprintf buffer overflow with tags + * Sat Mar 25 2023 Andreas Schneider - 0.8.3-3 - resolves: rhbz#2165805 - Fix snprintf buffer overflow From 2065e404ab284e187e29cdf4c037af96f1bbe189 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 7 Apr 2023 18:11:47 +0200 Subject: [PATCH 06/17] Update to version 0.9.0 --- .gitignore | 1 + 22729.patch | 52 -------- 22780.patch | 158 ------------------------ neovim-fix-fortify-source.patch | 39 ------ neovim.spec | 208 ++++++++++++++++++++------------ sources | 2 +- 6 files changed, 136 insertions(+), 324 deletions(-) delete mode 100644 22729.patch delete mode 100644 22780.patch delete mode 100644 neovim-fix-fortify-source.patch diff --git a/.gitignore b/.gitignore index abbfa49..c273174 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ /neovim-0.8.1.tar.gz /neovim-0.8.2.tar.gz /neovim-0.8.3.tar.gz +/neovim-0.9.0.tar.gz diff --git a/22729.patch b/22729.patch deleted file mode 100644 index 089ce08..0000000 --- a/22729.patch +++ /dev/null @@ -1,52 +0,0 @@ -From a917104263ac6dda15a9c9b7ab61e3378aec58a9 Mon Sep 17 00:00:00 2001 -From: koeleck <779769+koeleck@users.noreply.github.com> -Date: Sun, 19 Mar 2023 22:32:37 +0100 -Subject: [PATCH] fix: invalid buffer size argument to snprintf #22729 - -Problem: -Crash in findtags_add_match with FORTIFY_SOURCE=3. -Note: Fedora 38 packages are now built with -D_FORTIFY_SOURCE=3 by default. -1. Compile with overflow protection. -2. nvim --clean -3. :h -4. `*** overflow detected ***: terminated` - -The additional checks for the stated buffer size and the actual bounds -of the buffer do not match. See `___snprintf_chk` in the glibc sources: -https://sourceware.org/git/?p=glibc.git;a=blob;f=debug/snprintf_chk.c;h=59577de076c570b81307dd31c8c73e265808cf4c;hb=HEAD#l28 - -Solution: -Fix arithmetic error: The length of the previously written data is now -subtracted from the total size of the buffer, instead of added on top. - -close #22718 - -Backported by: Andreas Schneider ---- - src/nvim/tag.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/nvim/tag.c b/src/nvim/tag.c -index a8d8eebb0..501f31196 100644 ---- a/src/nvim/tag.c -+++ b/src/nvim/tag.c -@@ -2029,13 +2029,14 @@ parse_line: - // The format is {tagname}@{lang}NUL{heuristic}NUL - *tagp.tagname_end = NUL; - len = (size_t)(tagp.tagname_end - (char_u *)tagp.tagname); -- mfp = xmalloc(sizeof(char) + len + 10 + ML_EXTRA + 1); -+ size_t mfp_size = sizeof(char) + len + 10 + ML_EXTRA + 1; -+ mfp = xmalloc(mfp_size); - - p = (char_u *)mfp; - STRCPY(p, tagp.tagname); - p[len] = '@'; - STRCPY(p + len + 1, help_lang); -- snprintf((char *)p + len + 1 + ML_EXTRA, STRLEN(p) + len + 1 + ML_EXTRA, "%06d", -+ snprintf(p + len + 1 + ML_EXTRA, mfp_size - (len + 1 + ML_EXTRA), "%06d", - help_heuristic(tagp.tagname, - match_re ? matchoff : 0, !match_no_ic) - + help_pri); --- -2.39.2 - diff --git a/22780.patch b/22780.patch deleted file mode 100644 index d90b9ae..0000000 --- a/22780.patch +++ /dev/null @@ -1,158 +0,0 @@ -From a4640cc51fda6b5688c9b79c2d4d7d19e6d758a3 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Sat, 25 Mar 2023 11:26:36 +0100 -Subject: [PATCH] fix: snprintf buffer overflow detected by -D_FORTIFY_SOURCE=3 - -Thread no. 1 (24 frames) - #8 snprintf at /usr/include/bits/stdio2.h:54 - #9 set_cmdarg at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/eval.c:7044 - #10 apply_autocmds_group at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/autocmd.c:1843 - #11 apply_autocmds_exarg at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/autocmd.c:1549 - #12 readfile at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:617 - #13 buf_reload at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:5038 - #14 buf_check_timestamp at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:4952 - #15 check_timestamps at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:4678 - #16 ex_checktime at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_cmds2.c:765 - #17 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1620 - #18 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275 - #19 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584 - #20 ex_execute at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/eval.c:7727 - #21 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1620 - #22 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275 - #23 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584 - #24 do_ucmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/usercmd.c:1661 - #25 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1612 - #26 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275 - #27 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584 - #28 nv_colon at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:4058 - #29 normal_execute at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:1172 - #30 state_enter at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/state.c:88 - #31 normal_enter at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:471 - -Signed-off-by: Andreas Schneider ---- - src/nvim/eval.c | 73 +++++++++++++++++++++++++++++++++++++------------ - 1 file changed, 55 insertions(+), 18 deletions(-) - -diff --git a/src/nvim/eval.c b/src/nvim/eval.c -index cd76d1108..c652d9507 100644 ---- a/src/nvim/eval.c -+++ b/src/nvim/eval.c -@@ -6999,20 +6999,18 @@ char *set_cmdarg(exarg_T *eap, char *oldarg) - { - char *oldval = vimvars[VV_CMDARG].vv_str; - if (eap == NULL) { -- xfree(oldval); -- vimvars[VV_CMDARG].vv_str = oldarg; -- return NULL; -+ goto error; - } - - size_t len = 0; - if (eap->force_bin == FORCE_BIN) { -- len = 6; -+ len += 6; // " ++bin" - } else if (eap->force_bin == FORCE_NOBIN) { -- len = 8; -+ len += 8; // " ++nobin" - } - - if (eap->read_edit) { -- len += 7; -+ len += 7; // " ++edit" - } - - if (eap->force_ff != 0) { -@@ -7027,38 +7025,77 @@ char *set_cmdarg(exarg_T *eap, char *oldarg) - - const size_t newval_len = len + 1; - char *newval = xmalloc(newval_len); -+ size_t xlen = 0; -+ int rc = 0; - - if (eap->force_bin == FORCE_BIN) { -- snprintf(newval, newval_len, " ++bin"); -+ rc = snprintf(newval, newval_len, " ++bin"); - } else if (eap->force_bin == FORCE_NOBIN) { -- snprintf(newval, newval_len, " ++nobin"); -+ rc = snprintf(newval, newval_len, " ++nobin"); - } else { - *newval = NUL; - } -+ if (rc < 0) { -+ goto error; -+ } -+ xlen += (size_t)rc; - - if (eap->read_edit) { -- STRCAT(newval, " ++edit"); -+ rc = snprintf(newval + xlen, newval_len - xlen, " ++edit"); -+ if (rc < 0) { -+ goto error; -+ } -+ xlen += (size_t)rc; - } - - if (eap->force_ff != 0) { -- snprintf(newval + strlen(newval), newval_len, " ++ff=%s", -- eap->force_ff == 'u' ? "unix" : -- eap->force_ff == 'd' ? "dos" : "mac"); -+ rc = snprintf(newval + xlen, -+ newval_len - xlen, -+ " ++ff=%s", -+ eap->force_ff == 'u' ? "unix" -+ : eap->force_ff == 'd' ? "dos" : "mac"); -+ if (rc < 0) { -+ goto error; -+ } -+ xlen += (size_t)rc; - } - if (eap->force_enc != 0) { -- snprintf(newval + strlen(newval), newval_len, " ++enc=%s", -- eap->cmd + eap->force_enc); -+ rc = snprintf(newval + (xlen), newval_len - xlen, " ++enc=%s", eap->cmd + eap->force_enc); -+ if (rc < 0) { -+ goto error; -+ } -+ xlen += (size_t)rc; - } -+ - if (eap->bad_char == BAD_KEEP) { -- STRCPY(newval + strlen(newval), " ++bad=keep"); -+ rc = snprintf(newval + xlen, newval_len - xlen, " ++bad=keep"); -+ if (rc < 0) { -+ goto error; -+ } -+ xlen += (size_t)rc; - } else if (eap->bad_char == BAD_DROP) { -- STRCPY(newval + strlen(newval), " ++bad=drop"); -+ rc = snprintf(newval + xlen, newval_len - xlen, " ++bad=drop"); -+ if (rc < 0) { -+ goto error; -+ } -+ xlen += (size_t)rc; - } else if (eap->bad_char != 0) { -- snprintf(newval + strlen(newval), newval_len, " ++bad=%c", -- eap->bad_char); -+ rc = snprintf(newval + xlen, newval_len - xlen, " ++bad=%c", eap->bad_char); -+ if (rc < 0) { -+ goto error; -+ } -+ xlen += (size_t)rc; - } -+ -+ assert(xlen <= newval_len); -+ - vimvars[VV_CMDARG].vv_str = newval; - return oldval; -+ -+error: -+ xfree(oldval); -+ vimvars[VV_CMDARG].vv_str = oldarg; -+ return NULL; - } - - /// Check if variable "name[len]" is a local variable or an argument. --- -2.39.2 - diff --git a/neovim-fix-fortify-source.patch b/neovim-fix-fortify-source.patch deleted file mode 100644 index 4d14058..0000000 --- a/neovim-fix-fortify-source.patch +++ /dev/null @@ -1,39 +0,0 @@ -Index: neovim-0.8.2/CMakeLists.txt -=================================================================== ---- neovim-0.8.2.orig/CMakeLists.txt 2022-12-29 17:12:10.000000000 +0100 -+++ neovim-0.8.2/CMakeLists.txt 2022-12-30 10:33:00.250094998 +0100 -@@ -203,34 +203,6 @@ if(${INIT_FLAGS_NAME}) - set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}") - endif() - --# Include because some toolchains define _FORTIFY_SOURCE=2 in --# internal header files, which should in turn be #included by . --check_c_source_compiles(" --#include -- --#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1 --#error \"_FORTIFY_SOURCE > 1\" --#endif --int --main(void) --{ -- return 0; --} --" HAS_ACCEPTABLE_FORTIFY) -- --if(NOT HAS_ACCEPTABLE_FORTIFY) -- message(STATUS "Unsupported _FORTIFY_SOURCE found, forcing _FORTIFY_SOURCE=1") -- # Extract possible prefix to _FORTIFY_SOURCE (e.g. -Wp,-D_FORTIFY_SOURCE). -- STRING(REGEX MATCH "[^\ ]+-D_FORTIFY_SOURCE" _FORTIFY_SOURCE_PREFIX "${CMAKE_C_FLAGS}") -- STRING(REPLACE "-D_FORTIFY_SOURCE" "" _FORTIFY_SOURCE_PREFIX "${_FORTIFY_SOURCE_PREFIX}" ) -- if(NOT _FORTIFY_SOURCE_PREFIX STREQUAL "") -- message(STATUS "Detected _FORTIFY_SOURCE Prefix=${_FORTIFY_SOURCE_PREFIX}") -- endif() -- # -U in add_definitions doesn't end up in the correct spot, so we add it to -- # the flags variable instead. -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_FORTIFY_SOURCE_PREFIX}-U_FORTIFY_SOURCE ${_FORTIFY_SOURCE_PREFIX}-D_FORTIFY_SOURCE=1") --endif() -- - # Remove --sort-common from linker flags, as this seems to cause bugs (see #2641, #3374). - # TODO: Figure out the root cause. - if(CMAKE_EXE_LINKER_FLAGS MATCHES "--sort-common" OR diff --git a/neovim.spec b/neovim.spec index f858ec4..b38935c 100644 --- a/neovim.spec +++ b/neovim.spec @@ -21,8 +21,8 @@ %endif %endif -%global luv_min_ver 1.42.0 -%global tree_sitter_min_ver 0.20.3 +%global luv_min_ver 1.43.0 +%global tree_sitter_min_ver 0.20.8 %if %{with luajit} %global luajit_version 2.1 @@ -39,8 +39,8 @@ %endif Name: neovim -Version: 0.8.3 -Release: 4%{?dist} +Version: 0.9.0 +Release: 1%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -50,10 +50,6 @@ Source0: https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{v Source1: sysinit.vim Source2: spec-template -Patch0: neovim-fix-fortify-source.patch -Patch1: https://github.com/neovim/neovim/pull/22780.patch -Patch2: https://github.com/neovim/neovim/pull/22729.patch - Patch1000: neovim-lua-bit32.patch BuildRequires: gcc-c++ @@ -113,9 +109,6 @@ parts of Vim, without compromise, and more. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 %if %{without luajit} %patch1000 -p1 @@ -129,9 +122,11 @@ USERNAME=koji -DPREFER_LUA=%{?with_luajit:OFF}%{!?with_luajit:ON} \ -DLUA_PRG=%{lua_prg} \ -DENABLE_JEMALLOC=%{?with_jemalloc:ON}%{!?with_jemalloc:OFF} \ - -DLIBLUV_INCLUDE_DIR=%{luv_include_dir} \ - -DLIBLUV_LIBRARY=%{luv_library} + -DLIBLUV_INCLUDE_DIR:PATH=%{luv_include_dir} \ + -DLIBLUV_LIBRARY:FILEPATH=%{luv_library} +# HACK: Replace -lluv with the correct path +sed -i 's#-lluv#%{luv_library}#' %{__cmake_builddir}/src/nvim/CMakeFiles/nvim.dir/link.txt %cmake_build %install @@ -168,7 +163,6 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %dir %{_datadir}/nvim/runtime %{_datadir}/nvim/runtime/bugreport.vim %{_datadir}/nvim/runtime/delmenu.vim -%{_datadir}/nvim/runtime/filetype.vim %{_datadir}/nvim/runtime/filetype.lua %{_datadir}/nvim/runtime/ftoff.vim %{_datadir}/nvim/runtime/ftplugin.vim @@ -179,15 +173,17 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/makemenu.vim %{_datadir}/nvim/runtime/menu.vim %{_datadir}/nvim/runtime/mswin.vim +%{_datadir}/nvim/runtime/neovim.ico %{_datadir}/nvim/runtime/optwin.vim -%{_datadir}/nvim/runtime/scripts.vim %{_datadir}/nvim/runtime/synmenu.vim %dir %{_datadir}/nvim/runtime/autoload +%{_datadir}/nvim/runtime/autoload/README.txt %{_datadir}/nvim/runtime/autoload/RstFold.vim %{_datadir}/nvim/runtime/autoload/ada.vim %{_datadir}/nvim/runtime/autoload/adacomplete.vim %{_datadir}/nvim/runtime/autoload/bitbake.vim +%{_datadir}/nvim/runtime/autoload/ccomplete.lua %{_datadir}/nvim/runtime/autoload/ccomplete.vim %{_datadir}/nvim/runtime/autoload/clojurecomplete.vim %{_datadir}/nvim/runtime/autoload/context.vim @@ -199,7 +195,6 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/autoload/gzip.vim %{_datadir}/nvim/runtime/autoload/haskellcomplete.vim %{_datadir}/nvim/runtime/autoload/health.vim -%{_datadir}/nvim/runtime/autoload/health/nvim.vim %{_datadir}/nvim/runtime/autoload/health/provider.vim %{_datadir}/nvim/runtime/autoload/htmlcomplete.vim %{_datadir}/nvim/runtime/autoload/javascriptcomplete.vim @@ -229,9 +224,6 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/autoload/xmlformat.vim %{_datadir}/nvim/runtime/autoload/zip.vim -%dir %{_datadir}/nvim/runtime/autoload/dist -%{_datadir}/nvim/runtime/autoload/dist/ft.vim - %dir %{_datadir}/nvim/runtime/autoload/provider %{_datadir}/nvim/runtime/autoload/provider/clipboard.vim %{_datadir}/nvim/runtime/autoload/provider/node.vim @@ -260,7 +252,11 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/autoload/xml/html40t.vim %{_datadir}/nvim/runtime/autoload/xml/html401f.vim +%dir %{_datadir}/nvim/runtime/autoload/zig +%{_datadir}/nvim/runtime/autoload/zig/fmt.vim + %dir %{_datadir}/nvim/runtime/colors +%{_datadir}/nvim/runtime/colors/README.txt %{_datadir}/nvim/runtime/colors/blue.vim %{_datadir}/nvim/runtime/colors/darkblue.vim %{_datadir}/nvim/runtime/colors/default.vim @@ -284,6 +280,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/colors/zellner.vim %dir %{_datadir}/nvim/runtime/compiler +%{_datadir}/nvim/runtime/compiler/README.txt %{_datadir}/nvim/runtime/compiler/ant.vim %{_datadir}/nvim/runtime/compiler/bcc.vim %{_datadir}/nvim/runtime/compiler/bdf.vim @@ -295,7 +292,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/compiler/csslint.vim %{_datadir}/nvim/runtime/compiler/cucumber.vim %{_datadir}/nvim/runtime/compiler/dart.vim -%{_datadir}/nvim/runtime/compiler/dart2js.vim +%{_datadir}/nvim/runtime/compiler/dart2js.vim %{_datadir}/nvim/runtime/compiler/dart2native.vim %{_datadir}/nvim/runtime/compiler/dartanalyser.vim %{_datadir}/nvim/runtime/compiler/dartdevc.vim @@ -303,6 +300,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/compiler/dartfmt.vim %{_datadir}/nvim/runtime/compiler/decada.vim %{_datadir}/nvim/runtime/compiler/dot.vim +%{_datadir}/nvim/runtime/compiler/dotnet.vim %{_datadir}/nvim/runtime/compiler/erlang.vim %{_datadir}/nvim/runtime/compiler/eruby.vim %{_datadir}/nvim/runtime/compiler/eslint.vim @@ -387,6 +385,10 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/compiler/xmlwf.vim %{_datadir}/nvim/runtime/compiler/xo.vim %{_datadir}/nvim/runtime/compiler/yamllint.vim +%{_datadir}/nvim/runtime/compiler/zig.vim +%{_datadir}/nvim/runtime/compiler/zig_build.vim +%{_datadir}/nvim/runtime/compiler/zig_build_exe.vim +%{_datadir}/nvim/runtime/compiler/zig_test.vim %{_datadir}/nvim/runtime/compiler/zsh.vim %dir %{_datadir}/nvim/runtime/doc @@ -404,6 +406,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/doc/diagnostic.txt %{_datadir}/nvim/runtime/doc/diff.txt %{_datadir}/nvim/runtime/doc/digraph.txt +%{_datadir}/nvim/runtime/doc/editorconfig.txt %{_datadir}/nvim/runtime/doc/editing.txt %{_datadir}/nvim/runtime/doc/eval.txt %{_datadir}/nvim/runtime/doc/filetype.txt @@ -417,7 +420,6 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/doc/hebrew.txt %{_datadir}/nvim/runtime/doc/help.txt %{_datadir}/nvim/runtime/doc/helphelp.txt -%{_datadir}/nvim/runtime/doc/if_cscop.txt %{_datadir}/nvim/runtime/doc/if_perl.txt %{_datadir}/nvim/runtime/doc/if_pyth.txt %{_datadir}/nvim/runtime/doc/if_ruby.txt @@ -437,6 +439,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/doc/message.txt %{_datadir}/nvim/runtime/doc/mlang.txt %{_datadir}/nvim/runtime/doc/motion.txt +%{_datadir}/nvim/runtime/doc/news.txt %{_datadir}/nvim/runtime/doc/nvim.txt %{_datadir}/nvim/runtime/doc/nvim_terminal_emulator.txt %{_datadir}/nvim/runtime/doc/options.txt @@ -450,7 +453,6 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/doc/pi_tar.txt %{_datadir}/nvim/runtime/doc/pi_tutor.txt %{_datadir}/nvim/runtime/doc/pi_zip.txt -%{_datadir}/nvim/runtime/doc/print.txt %{_datadir}/nvim/runtime/doc/provider.txt %{_datadir}/nvim/runtime/doc/quickfix.txt %{_datadir}/nvim/runtime/doc/quickref.txt @@ -465,6 +467,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/doc/spell.txt %{_datadir}/nvim/runtime/doc/starting.txt %{_datadir}/nvim/runtime/doc/syntax.txt +%{_datadir}/nvim/runtime/doc/support.txt %{_datadir}/nvim/runtime/doc/tabpage.txt %{_datadir}/nvim/runtime/doc/tags %{_datadir}/nvim/runtime/doc/tagsrch.txt @@ -516,6 +519,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %dir %{_datadir}/nvim/runtime/ftplugin %{_datadir}/nvim/runtime/ftplugin/8th.vim +%{_datadir}/nvim/runtime/ftplugin/README.txt %{_datadir}/nvim/runtime/ftplugin/a2ps.vim %{_datadir}/nvim/runtime/ftplugin/aap.vim %{_datadir}/nvim/runtime/ftplugin/abap.vim @@ -523,6 +527,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/ada.vim %{_datadir}/nvim/runtime/ftplugin/alsaconf.vim %{_datadir}/nvim/runtime/ftplugin/ant.vim +%{_datadir}/nvim/runtime/ftplugin/apache.vim %{_datadir}/nvim/runtime/ftplugin/arch.vim %{_datadir}/nvim/runtime/ftplugin/art.vim %{_datadir}/nvim/runtime/ftplugin/asm.vim @@ -536,8 +541,10 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/bst.vim %{_datadir}/nvim/runtime/ftplugin/btm.vim %{_datadir}/nvim/runtime/ftplugin/bzl.vim +%{_datadir}/nvim/runtime/ftplugin/c.lua %{_datadir}/nvim/runtime/ftplugin/c.vim %{_datadir}/nvim/runtime/ftplugin/calendar.vim +%{_datadir}/nvim/runtime/ftplugin/calender.lua %{_datadir}/nvim/runtime/ftplugin/cdrdaoconf.vim %{_datadir}/nvim/runtime/ftplugin/cfg.vim %{_datadir}/nvim/runtime/ftplugin/ch.vim @@ -558,6 +565,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/cs.vim %{_datadir}/nvim/runtime/ftplugin/csc.vim %{_datadir}/nvim/runtime/ftplugin/csh.vim +%{_datadir}/nvim/runtime/ftplugin/css.lua %{_datadir}/nvim/runtime/ftplugin/css.vim %{_datadir}/nvim/runtime/ftplugin/cucumber.vim %{_datadir}/nvim/runtime/ftplugin/cvsrc.vim @@ -587,6 +595,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/falcon.vim %{_datadir}/nvim/runtime/ftplugin/fennel.vim %{_datadir}/nvim/runtime/ftplugin/fetchmail.vim +%{_datadir}/nvim/runtime/ftplugin/fish.vim %{_datadir}/nvim/runtime/ftplugin/flexwiki.vim %{_datadir}/nvim/runtime/ftplugin/fortran.vim %{_datadir}/nvim/runtime/ftplugin/fpcmake.vim @@ -622,6 +631,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/htmldjango.vim %{_datadir}/nvim/runtime/ftplugin/i3config.vim %{_datadir}/nvim/runtime/ftplugin/icon.vim +%{_datadir}/nvim/runtime/ftplugin/indent.lua %{_datadir}/nvim/runtime/ftplugin/indent.vim %{_datadir}/nvim/runtime/ftplugin/initex.vim %{_datadir}/nvim/runtime/ftplugin/ishd.vim @@ -650,7 +660,6 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/logtalk.dict %{_datadir}/nvim/runtime/ftplugin/logtalk.vim %{_datadir}/nvim/runtime/ftplugin/lprolog.vim -%{_datadir}/nvim/runtime/ftplugin/lua.lua %{_datadir}/nvim/runtime/ftplugin/lua.vim %{_datadir}/nvim/runtime/ftplugin/lynx.vim %{_datadir}/nvim/runtime/ftplugin/m3build.vim @@ -665,12 +674,13 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/markdown.vim %{_datadir}/nvim/runtime/ftplugin/masm.vim %{_datadir}/nvim/runtime/ftplugin/matlab.vim +%{_datadir}/nvim/runtime/ftplugin/mermaid.vim %{_datadir}/nvim/runtime/ftplugin/meson.vim %{_datadir}/nvim/runtime/ftplugin/mf.vim %{_datadir}/nvim/runtime/ftplugin/mma.vim %{_datadir}/nvim/runtime/ftplugin/modconf.vim -%{_datadir}/nvim/runtime/ftplugin/modula2.vim -%{_datadir}/nvim/runtime/ftplugin/modula3.vim +%{_datadir}/nvim/runtime/ftplugin/modula2.vim +%{_datadir}/nvim/runtime/ftplugin/modula3.vim %{_datadir}/nvim/runtime/ftplugin/mp.vim %{_datadir}/nvim/runtime/ftplugin/mplayerconf.vim %{_datadir}/nvim/runtime/ftplugin/mrxvtrc.vim @@ -683,9 +693,11 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/nroff.vim %{_datadir}/nvim/runtime/ftplugin/nsis.vim %{_datadir}/nvim/runtime/ftplugin/objc.vim +%{_datadir}/nvim/runtime/ftplugin/obse.vim %{_datadir}/nvim/runtime/ftplugin/ocaml.vim %{_datadir}/nvim/runtime/ftplugin/occam.vim %{_datadir}/nvim/runtime/ftplugin/octave.vim +%{_datadir}/nvim/runtime/ftplugin/openvpn.vim %{_datadir}/nvim/runtime/ftplugin/pamconf.vim %{_datadir}/nvim/runtime/ftplugin/pascal.vim %{_datadir}/nvim/runtime/ftplugin/passwd.vim @@ -696,6 +708,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/pinfo.vim %{_datadir}/nvim/runtime/ftplugin/plaintex.vim %{_datadir}/nvim/runtime/ftplugin/pod.vim +%{_datadir}/nvim/runtime/ftplugin/poefilter.vim %{_datadir}/nvim/runtime/ftplugin/poke.vim %{_datadir}/nvim/runtime/ftplugin/postscr.vim %{_datadir}/nvim/runtime/ftplugin/procmail.vim @@ -708,6 +721,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/qb64.vim %{_datadir}/nvim/runtime/ftplugin/qf.vim %{_datadir}/nvim/runtime/ftplugin/quake.vim +%{_datadir}/nvim/runtime/ftplugin/quarto.vim %{_datadir}/nvim/runtime/ftplugin/query.lua %{_datadir}/nvim/runtime/ftplugin/r.vim %{_datadir}/nvim/runtime/ftplugin/racc.vim @@ -736,7 +750,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/sensors.vim %{_datadir}/nvim/runtime/ftplugin/services.vim %{_datadir}/nvim/runtime/ftplugin/setserial.vim -%{_datadir}/nvim/runtime/ftplugin/sexplib.vim +%{_datadir}/nvim/runtime/ftplugin/sexplib.vim %{_datadir}/nvim/runtime/ftplugin/sgml.vim %{_datadir}/nvim/runtime/ftplugin/sh.vim %{_datadir}/nvim/runtime/ftplugin/shada.vim @@ -747,6 +761,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/solution.vim %{_datadir}/nvim/runtime/ftplugin/spec.vim %{_datadir}/nvim/runtime/ftplugin/sql.vim +%{_datadir}/nvim/runtime/ftplugin/ssa.vim %{_datadir}/nvim/runtime/ftplugin/sshconfig.vim %{_datadir}/nvim/runtime/ftplugin/sudoers.vim %{_datadir}/nvim/runtime/ftplugin/svg.vim @@ -762,9 +777,9 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/terminfo.vim %{_datadir}/nvim/runtime/ftplugin/tex.vim %{_datadir}/nvim/runtime/ftplugin/text.vim -%{_datadir}/nvim/runtime/ftplugin/tidy.vim +%{_datadir}/nvim/runtime/ftplugin/tidy.vim %{_datadir}/nvim/runtime/ftplugin/tmux.vim -%{_datadir}/nvim/runtime/ftplugin/toml.vim +%{_datadir}/nvim/runtime/ftplugin/toml.vim %{_datadir}/nvim/runtime/ftplugin/treetop.vim %{_datadir}/nvim/runtime/ftplugin/tt2html.vim %{_datadir}/nvim/runtime/ftplugin/tutor.vim @@ -784,6 +799,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/wast.vim %{_datadir}/nvim/runtime/ftplugin/wget.vim %{_datadir}/nvim/runtime/ftplugin/wget2.vim +%{_datadir}/nvim/runtime/ftplugin/xdefaults.lua %{_datadir}/nvim/runtime/ftplugin/xdefaults.vim %{_datadir}/nvim/runtime/ftplugin/xf86conf.vim %{_datadir}/nvim/runtime/ftplugin/xhtml.vim @@ -794,10 +810,13 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/xsd.vim %{_datadir}/nvim/runtime/ftplugin/xslt.vim %{_datadir}/nvim/runtime/ftplugin/yaml.vim +%{_datadir}/nvim/runtime/ftplugin/zig.vim %{_datadir}/nvim/runtime/ftplugin/zimbu.vim %{_datadir}/nvim/runtime/ftplugin/zsh.vim %dir %{_datadir}/nvim/runtime/indent +%{_datadir}/nvim/runtime/indent/Makefile +%{_datadir}/nvim/runtime/indent/README.txt %{_datadir}/nvim/runtime/indent/aap.vim %{_datadir}/nvim/runtime/indent/ada.vim %{_datadir}/nvim/runtime/indent/ant.vim @@ -842,6 +861,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/indent/expect.vim %{_datadir}/nvim/runtime/indent/falcon.vim %{_datadir}/nvim/runtime/indent/fennel.vim +%{_datadir}/nvim/runtime/indent/fish.vim %{_datadir}/nvim/runtime/indent/fortran.vim %{_datadir}/nvim/runtime/indent/framescript.vim %{_datadir}/nvim/runtime/indent/freebasic.vim @@ -883,6 +903,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/indent/nginx.vim %{_datadir}/nvim/runtime/indent/nsis.vim %{_datadir}/nvim/runtime/indent/objc.vim +%{_datadir}/nvim/runtime/indent/obse.vim %{_datadir}/nvim/runtime/indent/ocaml.vim %{_datadir}/nvim/runtime/indent/occam.vim %{_datadir}/nvim/runtime/indent/pascal.vim @@ -895,6 +916,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/indent/pyrex.vim %{_datadir}/nvim/runtime/indent/python.vim %{_datadir}/nvim/runtime/indent/qb64.vim +%{_datadir}/nvim/runtime/indent/quarto.vim %{_datadir}/nvim/runtime/indent/query.lua %{_datadir}/nvim/runtime/indent/r.vim %{_datadir}/nvim/runtime/indent/racket.vim @@ -945,13 +967,38 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/indent/xslt.vim %{_datadir}/nvim/runtime/indent/yacc.vim %{_datadir}/nvim/runtime/indent/yaml.vim +%{_datadir}/nvim/runtime/indent/zig.vim %{_datadir}/nvim/runtime/indent/zimbu.vim %{_datadir}/nvim/runtime/indent/zsh.vim %dir %{_datadir}/nvim/runtime/indent/testdir/ +%{_datadir}/nvim/runtime/indent/testdir/README.txt +%{_datadir}/nvim/runtime/indent/testdir/bitbake.in +%{_datadir}/nvim/runtime/indent/testdir/bitbake.ok +%{_datadir}/nvim/runtime/indent/testdir/html.in +%{_datadir}/nvim/runtime/indent/testdir/html.ok +%{_datadir}/nvim/runtime/indent/testdir/krl.in +%{_datadir}/nvim/runtime/indent/testdir/krl.ok +%{_datadir}/nvim/runtime/indent/testdir/matlab.in +%{_datadir}/nvim/runtime/indent/testdir/matlab.ok +%{_datadir}/nvim/runtime/indent/testdir/python.in +%{_datadir}/nvim/runtime/indent/testdir/python.ok %{_datadir}/nvim/runtime/indent/testdir/runtest.vim +%{_datadir}/nvim/runtime/indent/testdir/sshconfig.in +%{_datadir}/nvim/runtime/indent/testdir/sshconfig.ok +%{_datadir}/nvim/runtime/indent/testdir/tcl.in +%{_datadir}/nvim/runtime/indent/testdir/tcl.ok +%{_datadir}/nvim/runtime/indent/testdir/vb.in +%{_datadir}/nvim/runtime/indent/testdir/vb.ok +%{_datadir}/nvim/runtime/indent/testdir/vim.in +%{_datadir}/nvim/runtime/indent/testdir/vim.ok +%{_datadir}/nvim/runtime/indent/testdir/xml.in +%{_datadir}/nvim/runtime/indent/testdir/xml.ok +%{_datadir}/nvim/runtime/indent/testdir/yaml.in +%{_datadir}/nvim/runtime/indent/testdir/yaml.ok %dir %{_datadir}/nvim/runtime/keymap +%{_datadir}/nvim/runtime/keymap/README.txt %{_datadir}/nvim/runtime/keymap/accents.vim %{_datadir}/nvim/runtime/keymap/arabic.vim %{_datadir}/nvim/runtime/keymap/arabic_utf-8.vim @@ -988,7 +1035,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/keymap/kana.vim %{_datadir}/nvim/runtime/keymap/kazakh-jcuken.vim %{_datadir}/nvim/runtime/keymap/korean-dubeolsik_utf-8.vim -%{_datadir}/nvim/runtime/keymap/korean.vim +%{_datadir}/nvim/runtime/keymap/korean.vim %{_datadir}/nvim/runtime/keymap/lithuanian-baltic.vim %{_datadir}/nvim/runtime/keymap/magyar_utf-8.vim %{_datadir}/nvim/runtime/keymap/mongolian_utf-8.vim @@ -1026,7 +1073,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/keymap/tamil_tscii.vim %{_datadir}/nvim/runtime/keymap/thaana-phonetic_utf-8.vim %{_datadir}/nvim/runtime/keymap/thaana.vim -%{_datadir}/nvim/runtime/keymap/turkish-f.vim +%{_datadir}/nvim/runtime/keymap/turkish-f.vim %{_datadir}/nvim/runtime/keymap/turkish-q.vim %{_datadir}/nvim/runtime/keymap/ukrainian-dvorak.vim %{_datadir}/nvim/runtime/keymap/ukrainian-jcuken.vim @@ -1035,17 +1082,20 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/keymap/vietnamese-vni_utf-8.vim %dir %{_datadir}/nvim/runtime/lua -%{_datadir}/nvim/runtime/lua/health.lua +%{_datadir}/nvim/runtime/lua/_vim9script.lua +%{_datadir}/nvim/runtime/lua/editorconfig.lua %{_datadir}/nvim/runtime/lua/man.lua -%dir %{_datadir}/nvim/runtime/lua/man -%{_datadir}/nvim/runtime/lua/man/health.lua +%dir %{_datadir}/nvim/runtime/lua/nvim +%{_datadir}/nvim/runtime/lua/nvim/health.lua %dir %{_datadir}/nvim/runtime/lua/vim %{_datadir}/nvim/runtime/lua/vim/F.lua %{_datadir}/nvim/runtime/lua/vim/_editor.lua %{_datadir}/nvim/runtime/lua/vim/_init_packages.lua +%{_datadir}/nvim/runtime/lua/vim/_inspector.lua %{_datadir}/nvim/runtime/lua/vim/_meta.lua +%{_datadir}/nvim/runtime/lua/vim/_watch.lua %{_datadir}/nvim/runtime/lua/vim/diagnostic.lua %{_datadir}/nvim/runtime/lua/vim/filetype.lua %{_datadir}/nvim/runtime/lua/vim/fs.lua @@ -1053,34 +1103,45 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/lua/vim/highlight.lua %{_datadir}/nvim/runtime/lua/vim/inspect.lua %{_datadir}/nvim/runtime/lua/vim/keymap.lua +%{_datadir}/nvim/runtime/lua/vim/loader.lua %{_datadir}/nvim/runtime/lua/vim/lsp.lua +%{_datadir}/nvim/runtime/lua/vim/secure.lua %{_datadir}/nvim/runtime/lua/vim/shared.lua %{_datadir}/nvim/runtime/lua/vim/treesitter.lua %{_datadir}/nvim/runtime/lua/vim/ui.lua %{_datadir}/nvim/runtime/lua/vim/uri.lua +%{_datadir}/nvim/runtime/lua/vim/version.lua %dir %{_datadir}/nvim/runtime/lua/vim/filetype/ %{_datadir}/nvim/runtime/lua/vim/filetype/detect.lua +%{_datadir}/nvim/runtime/lua/vim/filetype/options.lua %dir %{_datadir}/nvim/runtime/lua/vim/lsp/ %{_datadir}/nvim/runtime/lua/vim/lsp/_snippet.lua +%{_datadir}/nvim/runtime/lua/vim/lsp/_watchfiles.lua %{_datadir}/nvim/runtime/lua/vim/lsp/buf.lua -%{_datadir}/nvim/runtime/lua/vim/lsp/codelens.lua +%{_datadir}/nvim/runtime/lua/vim/lsp/codelens.lua %{_datadir}/nvim/runtime/lua/vim/lsp/diagnostic.lua -%{_datadir}/nvim/runtime/lua/vim/lsp/health.lua %{_datadir}/nvim/runtime/lua/vim/lsp/handlers.lua +%{_datadir}/nvim/runtime/lua/vim/lsp/health.lua %{_datadir}/nvim/runtime/lua/vim/lsp/log.lua %{_datadir}/nvim/runtime/lua/vim/lsp/protocol.lua %{_datadir}/nvim/runtime/lua/vim/lsp/rpc.lua +%{_datadir}/nvim/runtime/lua/vim/lsp/semantic_tokens.lua %{_datadir}/nvim/runtime/lua/vim/lsp/sync.lua %{_datadir}/nvim/runtime/lua/vim/lsp/tagfunc.lua -%{_datadir}/nvim/runtime/lua/vim/lsp/util.lua +%{_datadir}/nvim/runtime/lua/vim/lsp/types.lua +%{_datadir}/nvim/runtime/lua/vim/lsp/util.lua %dir %{_datadir}/nvim/runtime/lua/vim/treesitter/ +%{_datadir}/nvim/runtime/lua/vim/treesitter/_fold.lua +%{_datadir}/nvim/runtime/lua/vim/treesitter/_meta.lua +%{_datadir}/nvim/runtime/lua/vim/treesitter/_range.lua %{_datadir}/nvim/runtime/lua/vim/treesitter/health.lua %{_datadir}/nvim/runtime/lua/vim/treesitter/highlighter.lua %{_datadir}/nvim/runtime/lua/vim/treesitter/language.lua %{_datadir}/nvim/runtime/lua/vim/treesitter/languagetree.lua +%{_datadir}/nvim/runtime/lua/vim/treesitter/playground.lua %{_datadir}/nvim/runtime/lua/vim/treesitter/query.lua %dir %{_datadir}/nvim/runtime/macros @@ -1099,7 +1160,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %dir %{_datadir}/nvim/runtime/pack/dist/opt/cfilter %dir %{_datadir}/nvim/runtime/pack/dist/opt/cfilter/plugin -%{_datadir}/nvim/runtime/pack/dist/opt/cfilter/plugin/cfilter.vim +%{_datadir}/nvim/runtime/pack/dist/opt/cfilter/plugin/cfilter.lua %dir %{_datadir}/nvim/runtime/pack/dist/opt/justify %dir %{_datadir}/nvim/runtime/pack/dist/opt/justify/plugin @@ -1138,12 +1199,14 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/pack/dist/opt/vimball/doc/vimball.txt %dir %{_datadir}/nvim/runtime/plugin +%{_datadir}/nvim/runtime/plugin/editorconfig.lua %{_datadir}/nvim/runtime/plugin/gzip.vim %{_datadir}/nvim/runtime/plugin/health.vim %{_datadir}/nvim/runtime/plugin/man.lua %{_datadir}/nvim/runtime/plugin/matchit.vim %{_datadir}/nvim/runtime/plugin/matchparen.vim %{_datadir}/nvim/runtime/plugin/netrwPlugin.vim +%{_datadir}/nvim/runtime/plugin/nvim.lua %{_datadir}/nvim/runtime/plugin/rplugin.vim %{_datadir}/nvim/runtime/plugin/shada.vim %{_datadir}/nvim/runtime/plugin/spellfile.vim @@ -1152,56 +1215,30 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/plugin/tutor.vim %{_datadir}/nvim/runtime/plugin/zipPlugin.vim -%dir %{_datadir}/nvim/runtime/print -%{_datadir}/nvim/runtime/print/ascii.ps -%{_datadir}/nvim/runtime/print/cidfont.ps -%{_datadir}/nvim/runtime/print/cns_roman.ps -%{_datadir}/nvim/runtime/print/cp1250.ps -%{_datadir}/nvim/runtime/print/cp1251.ps -%{_datadir}/nvim/runtime/print/cp1252.ps -%{_datadir}/nvim/runtime/print/cp1253.ps -%{_datadir}/nvim/runtime/print/cp1254.ps -%{_datadir}/nvim/runtime/print/cp1255.ps -%{_datadir}/nvim/runtime/print/cp1257.ps -%{_datadir}/nvim/runtime/print/gb_roman.ps -%{_datadir}/nvim/runtime/print/hp-roman8.ps -%{_datadir}/nvim/runtime/print/iso-8859-10.ps -%{_datadir}/nvim/runtime/print/iso-8859-11.ps -%{_datadir}/nvim/runtime/print/iso-8859-13.ps -%{_datadir}/nvim/runtime/print/iso-8859-14.ps -%{_datadir}/nvim/runtime/print/iso-8859-15.ps -%{_datadir}/nvim/runtime/print/iso-8859-2.ps -%{_datadir}/nvim/runtime/print/iso-8859-3.ps -%{_datadir}/nvim/runtime/print/iso-8859-4.ps -%{_datadir}/nvim/runtime/print/iso-8859-5.ps -%{_datadir}/nvim/runtime/print/iso-8859-7.ps -%{_datadir}/nvim/runtime/print/iso-8859-8.ps -%{_datadir}/nvim/runtime/print/iso-8859-9.ps -%{_datadir}/nvim/runtime/print/jis_roman.ps -%{_datadir}/nvim/runtime/print/koi8-r.ps -%{_datadir}/nvim/runtime/print/koi8-u.ps -%{_datadir}/nvim/runtime/print/ks_roman.ps -%{_datadir}/nvim/runtime/print/latin1.ps -%{_datadir}/nvim/runtime/print/mac-roman.ps -%{_datadir}/nvim/runtime/print/prolog.ps - %dir %{_datadir}/nvim/runtime/queries/ %dir %{_datadir}/nvim/runtime/queries/c/ +%{_datadir}/nvim/runtime/queries/c/folds.scm %{_datadir}/nvim/runtime/queries/c/highlights.scm %{_datadir}/nvim/runtime/queries/c/injections.scm -%dir %{_datadir}/nvim/runtime/queries/help/ -%{_datadir}/nvim/runtime/queries/help/highlights.scm -%{_datadir}/nvim/runtime/queries/help/injections.scm - %dir %{_datadir}/nvim/runtime/queries/lua/ +%{_datadir}/nvim/runtime/queries/lua/folds.scm %{_datadir}/nvim/runtime/queries/lua/highlights.scm %{_datadir}/nvim/runtime/queries/lua/injections.scm +%dir %{_datadir}/nvim/runtime/queries/query/ +%{_datadir}/nvim/runtime/queries/query/folds.scm +%{_datadir}/nvim/runtime/queries/query/highlights.scm + %dir %{_datadir}/nvim/runtime/queries/vim/ +%{_datadir}/nvim/runtime/queries/vim/folds.scm %{_datadir}/nvim/runtime/queries/vim/highlights.scm %{_datadir}/nvim/runtime/queries/vim/injections.scm +%dir %{_datadir}/nvim/runtime/queries/vimdoc/ +%{_datadir}/nvim/runtime/queries/vimdoc/highlights.scm +%{_datadir}/nvim/runtime/queries/vimdoc/injections.scm + %dir %{_datadir}/nvim/runtime/spell %{_datadir}/nvim/runtime/spell/cleanadd.vim %{_datadir}/nvim/runtime/spell/en.utf-8.spl @@ -1209,6 +1246,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %dir %{_datadir}/nvim/runtime/syntax %{_datadir}/nvim/runtime/syntax/2html.vim %{_datadir}/nvim/runtime/syntax/8th.vim +%{_datadir}/nvim/runtime/syntax/README.txt %{_datadir}/nvim/runtime/syntax/a2ps.vim %{_datadir}/nvim/runtime/syntax/a65.vim %{_datadir}/nvim/runtime/syntax/aap.vim @@ -1366,6 +1404,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/dylanlid.vim %{_datadir}/nvim/runtime/syntax/ecd.vim %{_datadir}/nvim/runtime/syntax/edif.vim +%{_datadir}/nvim/runtime/syntax/editorconfig.vim %{_datadir}/nvim/runtime/syntax/eiffel.vim %{_datadir}/nvim/runtime/syntax/elf.vim %{_datadir}/nvim/runtime/syntax/elinks.vim @@ -1389,6 +1428,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/fdcc.vim %{_datadir}/nvim/runtime/syntax/fetchmail.vim %{_datadir}/nvim/runtime/syntax/fgl.vim +%{_datadir}/nvim/runtime/syntax/fish.vim %{_datadir}/nvim/runtime/syntax/flexwiki.vim %{_datadir}/nvim/runtime/syntax/focexec.vim %{_datadir}/nvim/runtime/syntax/form.vim @@ -1498,6 +1538,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/kwt.vim %{_datadir}/nvim/runtime/syntax/lace.vim %{_datadir}/nvim/runtime/syntax/latte.vim +%{_datadir}/nvim/runtime/syntax/lc.vim %{_datadir}/nvim/runtime/syntax/ld.vim %{_datadir}/nvim/runtime/syntax/ldapconf.vim %{_datadir}/nvim/runtime/syntax/ldif.vim @@ -1546,6 +1587,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/matlab.vim %{_datadir}/nvim/runtime/syntax/maxima.vim %{_datadir}/nvim/runtime/syntax/mel.vim +%{_datadir}/nvim/runtime/syntax/mermaid.vim %{_datadir}/nvim/runtime/syntax/meson.vim %{_datadir}/nvim/runtime/syntax/messages.vim %{_datadir}/nvim/runtime/syntax/mf.vim @@ -1586,6 +1628,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/netrw.vim %{_datadir}/nvim/runtime/syntax/nginx.vim %{_datadir}/nvim/runtime/syntax/ninja.vim +%{_datadir}/nvim/runtime/syntax/nix.vim %{_datadir}/nvim/runtime/syntax/nosyntax.vim %{_datadir}/nvim/runtime/syntax/nqc.vim %{_datadir}/nvim/runtime/syntax/nroff.vim @@ -1593,12 +1636,14 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/obj.vim %{_datadir}/nvim/runtime/syntax/objc.vim %{_datadir}/nvim/runtime/syntax/objcpp.vim +%{_datadir}/nvim/runtime/syntax/obse.vim %{_datadir}/nvim/runtime/syntax/ocaml.vim %{_datadir}/nvim/runtime/syntax/occam.vim %{_datadir}/nvim/runtime/syntax/omnimark.vim %{_datadir}/nvim/runtime/syntax/opam.vim %{_datadir}/nvim/runtime/syntax/openroad.vim %{_datadir}/nvim/runtime/syntax/openscad.vim +%{_datadir}/nvim/runtime/syntax/openvpn.vim %{_datadir}/nvim/runtime/syntax/opl.vim %{_datadir}/nvim/runtime/syntax/ora.vim %{_datadir}/nvim/runtime/syntax/pamconf.vim @@ -1627,6 +1672,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/plsql.vim %{_datadir}/nvim/runtime/syntax/po.vim %{_datadir}/nvim/runtime/syntax/pod.vim +%{_datadir}/nvim/runtime/syntax/poefilter.vim %{_datadir}/nvim/runtime/syntax/poke.vim %{_datadir}/nvim/runtime/syntax/postscr.vim %{_datadir}/nvim/runtime/syntax/pov.vim @@ -1649,9 +1695,11 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/purifylog.vim %{_datadir}/nvim/runtime/syntax/pyrex.vim %{_datadir}/nvim/runtime/syntax/python.vim +%{_datadir}/nvim/runtime/syntax/python2.vim %{_datadir}/nvim/runtime/syntax/qb64.vim %{_datadir}/nvim/runtime/syntax/qf.vim %{_datadir}/nvim/runtime/syntax/quake.vim +%{_datadir}/nvim/runtime/syntax/quarto.vim %{_datadir}/nvim/runtime/syntax/query.lua %{_datadir}/nvim/runtime/syntax/r.vim %{_datadir}/nvim/runtime/syntax/racc.vim @@ -1759,6 +1807,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/squirrel.vim %{_datadir}/nvim/runtime/syntax/srec.vim %{_datadir}/nvim/runtime/syntax/srt.vim +%{_datadir}/nvim/runtime/syntax/ssa.vim %{_datadir}/nvim/runtime/syntax/sshconfig.vim %{_datadir}/nvim/runtime/syntax/sshdconfig.vim %{_datadir}/nvim/runtime/syntax/st.vim @@ -1848,6 +1897,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/vue.vim %{_datadir}/nvim/runtime/syntax/wast.vim %{_datadir}/nvim/runtime/syntax/wdiff.vim +%{_datadir}/nvim/runtime/syntax/wdl.vim %{_datadir}/nvim/runtime/syntax/web.vim %{_datadir}/nvim/runtime/syntax/webmacro.vim %{_datadir}/nvim/runtime/syntax/wget.vim @@ -1877,12 +1927,18 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/syntax/yacc.vim %{_datadir}/nvim/runtime/syntax/yaml.vim %{_datadir}/nvim/runtime/syntax/z8a.vim +%{_datadir}/nvim/runtime/syntax/zig.vim %{_datadir}/nvim/runtime/syntax/zimbu.vim +%{_datadir}/nvim/runtime/syntax/zir.vim %{_datadir}/nvim/runtime/syntax/zsh.vim %dir %{_datadir}/nvim/runtime/syntax/vim %{_datadir}/nvim/runtime/syntax/vim/generated.vim +%dir %{_datadir}/nvim/runtime/syntax/shared +%{_datadir}/nvim/runtime/syntax/shared/README.txt +%{_datadir}/nvim/runtime/syntax/shared/hgcommitDiff.vim + %dir %{_datadir}/nvim/runtime/tools %{_datadir}/nvim/runtime/tools/check_colors.vim %{_datadir}/nvim/runtime/tools/emoji_list.vim @@ -1896,6 +1952,10 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Fri Apr 07 2023 Andreas Schneider - 0.9.0-1 +- Update to version 0.9.0 + * For changelog see `:help news` + * Mon Mar 27 2023 Andreas Schneider - 0.8.3-4 - resolves: rhbz#2181836 - Fix snprintf buffer overflow with tags diff --git a/sources b/sources index c56bda3..bde8f1c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (neovim-0.8.3.tar.gz) = 0ecf60b564a323eb95eb2e67f7dc7e1c1e7bfc70b08466a66eb668d1b75a7362ca42901cd5a64fda22292375e2921ba61c299ac846f820ac146dc55426813eb8 +SHA512 (neovim-0.9.0.tar.gz) = e42f09f408b83fc34e8f169321e0349d1f851e67a998265c53d2ddb1a4792c3f4777fabe32baf2c7eff7d3745ff60d4a07da542ccd272883f7f4e080b2c9c1bf From 3b114c22f5c82df67b78678f8d3c58fb786eadc4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 7 Apr 2023 18:49:10 +0200 Subject: [PATCH 07/17] Update neovim-lua-bit32.patch --- neovim-lua-bit32.patch | 24 ++++++++++++------------ neovim.spec | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/neovim-lua-bit32.patch b/neovim-lua-bit32.patch index c339ee2..706c0dd 100644 --- a/neovim-lua-bit32.patch +++ b/neovim-lua-bit32.patch @@ -1,30 +1,30 @@ -Index: neovim-0.8.0/CMakeLists.txt +Index: neovim-0.9.0/CMakeLists.txt =================================================================== ---- neovim-0.8.0.orig/CMakeLists.txt 2022-09-30 17:15:13.000000000 +0200 -+++ neovim-0.8.0/CMakeLists.txt 2022-10-01 07:03:31.650272466 +0200 -@@ -548,7 +548,7 @@ endforeach() +--- neovim-0.9.0.orig/CMakeLists.txt 2023-04-07 18:47:09.146841186 +0200 ++++ neovim-0.9.0/CMakeLists.txt 2023-04-07 18:47:39.100006585 +0200 +@@ -163,7 +163,7 @@ foreach(CFGNAME ${CMAKE_CONFIGURATION_TY + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib) + endforeach() - # Find Lua interpreter - include(LuaHelpers) -set(LUA_DEPENDENCIES lpeg mpack bit) +set(LUA_DEPENDENCIES lpeg mpack bit32) if(NOT LUA_PRG) foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua) unset(_CHECK_LUA_PRG CACHE) -Index: neovim-0.8.0/src/nvim/ex_cmds.lua +Index: neovim-0.9.0/src/nvim/ex_cmds.lua =================================================================== ---- neovim-0.8.0.orig/src/nvim/ex_cmds.lua 2022-09-30 17:15:13.000000000 +0200 -+++ neovim-0.8.0/src/nvim/ex_cmds.lua 2022-10-01 07:03:31.651272464 +0200 +--- neovim-0.9.0.orig/src/nvim/ex_cmds.lua 2023-04-07 18:47:05.066818656 +0200 ++++ neovim-0.9.0/src/nvim/ex_cmds.lua 2023-04-07 18:47:09.147841191 +0200 @@ -1,4 +1,4 @@ -local bit = require 'bit' +local bit = require 'bit32' local module = {} -Index: neovim-0.8.0/src/nvim/generators/gen_ex_cmds.lua +Index: neovim-0.9.0/src/nvim/generators/gen_ex_cmds.lua =================================================================== ---- neovim-0.8.0.orig/src/nvim/generators/gen_ex_cmds.lua 2022-09-30 17:15:13.000000000 +0200 -+++ neovim-0.8.0/src/nvim/generators/gen_ex_cmds.lua 2022-10-01 07:03:31.651272464 +0200 +--- neovim-0.9.0.orig/src/nvim/generators/gen_ex_cmds.lua 2023-04-07 18:47:05.066818656 +0200 ++++ neovim-0.9.0/src/nvim/generators/gen_ex_cmds.lua 2023-04-07 18:47:09.147841191 +0200 @@ -22,7 +22,7 @@ local defsfname = autodir .. '/ex_cmds_d local enumfile = io.open(enumfname, 'w') local defsfile = io.open(defsfname, 'w') diff --git a/neovim.spec b/neovim.spec index b38935c..4380c07 100644 --- a/neovim.spec +++ b/neovim.spec @@ -111,7 +111,7 @@ parts of Vim, without compromise, and more. %setup -q %if %{without luajit} -%patch1000 -p1 +%patch -P 1000 -p1 %endif %build From bd2a90ba4b03237f3d775213c8cb1926f242e202 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 14 Apr 2023 09:27:06 +0200 Subject: [PATCH 08/17] Use pkgconfig for BR and recommend wl-clipboard --- neovim.spec | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/neovim.spec b/neovim.spec index 4380c07..92cef70 100644 --- a/neovim.spec +++ b/neovim.spec @@ -80,13 +80,13 @@ BuildRequires: lua5.1-mpack BuildRequires: jemalloc-devel %endif BuildRequires: msgpack-devel >= 3.1.0 -BuildRequires: libtermkey-devel -BuildRequires: libuv-devel >= 1.42.0 -BuildRequires: libvterm-devel >= 0.3 +BuildRequires: pkgconfig(termkey) +BuildRequires: pkgconfig(libuv) >= 1.42.0 +BuildRequires: pkgconfig(vterm) >= 0.3 # need the build with the fix for the resize buffer issue Requires: libvterm >= 0.3 -BuildRequires: unibilium-devel -BuildRequires: libtree-sitter-devel >= %{tree_sitter_min_ver} +BuildRequires: pkgconfig(unibilium) +BuildRequires: pkgconfig(libtree-sitter) >= %{tree_sitter_min_ver} # tree-sitter didn't do an soname bump. enforce the min version # see https://github.com/nvim-treesitter/nvim-treesitter/pull/3055/files Requires: libtree-sitter >= %{tree_sitter_min_ver} @@ -96,6 +96,7 @@ Suggests: (python2-neovim if python2) Suggests: (python3-neovim if python3) # XSel provides access to the system clipboard Recommends: xsel +Recommends: wl-clipboard %description Neovim is a refactor - and sometimes redactor - in the tradition of From a1860ce3c7dba1f949c13023cd30e2f8d6336b9c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 21 Apr 2023 13:47:26 +0200 Subject: [PATCH 09/17] Fix buffer overflow for user command resolves: rhbz#2188229 --- 23245.patch | 338 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 23246.patch | 150 +++++++++++++++++++++++ neovim.spec | 10 +- 3 files changed, 496 insertions(+), 2 deletions(-) create mode 100644 23245.patch create mode 100644 23246.patch diff --git a/23245.patch b/23245.patch new file mode 100644 index 0000000..5fc5c0c --- /dev/null +++ b/23245.patch @@ -0,0 +1,338 @@ +From b2a43b5287976f0bdbc43690038d9ae37610ff00 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 21 Apr 2023 10:55:36 +0200 +Subject: [PATCH 1/8] fix(api): avoid integer truncation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 ef7ae66eef4e36e15b5248b926b4b020387d8101) +--- + src/nvim/api/vim.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c +index c8bb22b33c0c1..d47f47e63863b 100644 +--- a/src/nvim/api/vim.c ++++ b/src/nvim/api/vim.c +@@ -2241,7 +2241,7 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error * + if (highlights) { + Array hl_values = ARRAY_DICT_INIT; + const char *grpname; +- char user_group[6]; ++ char user_group[15]; // strlen("User") + strlen("2147483647") + NUL + + // If first character doesn't have a defined highlight, + // add the default highlight at the beginning of the highlight list + +From b91278c4fa8f7bb319213e9cc47951795b9fda92 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 21 Apr 2023 10:58:46 +0200 +Subject: [PATCH 2/8] fix(drawline): initialize variable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 e9280a68f7ead83c572bb4c792bc743df9da7149) +--- + src/nvim/drawline.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c +index 2268a7cd3ec88..40612472bba11 100644 +--- a/src/nvim/drawline.c ++++ b/src/nvim/drawline.c +@@ -282,7 +282,7 @@ static void draw_virt_text(win_T *wp, buf_T *buf, int col_off, int *end_col, int + if (item->win_col < 0) { + continue; + } +- int col; ++ int col = 0; + if (item->decor.ui_watched) { + // send mark position to UI + col = item->win_col; + +From 6bd73ed2d9e5c03b9054aadfe765a6cc341f3eb5 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 21 Apr 2023 11:00:46 +0200 +Subject: [PATCH 3/8] fix(drawline): initialize variable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 2819718873a38c68cca0295f59186444d8534e06) +--- + src/nvim/drawline.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c +index 40612472bba11..69b3eef5e753a 100644 +--- a/src/nvim/drawline.c ++++ b/src/nvim/drawline.c +@@ -1386,7 +1386,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange, + if (v > 0 && !number_only) { + char *prev_ptr = ptr; + chartabsize_T cts; +- int charsize; ++ int charsize = 0; + + init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, ptr); + while (cts.cts_vcol < v && *cts.cts_ptr != NUL) { + +From 6ba14ff18265ff2b112b6571763b330ed5ef2e30 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 21 Apr 2023 11:07:56 +0200 +Subject: [PATCH 4/8] fix(userfunc): fix possible out of bound access +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 ‘’ 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 9802de933484cc0a69ee328f3e4e6efbb83c308e) +--- + src/nvim/eval/userfunc.c | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c +index f09da6b79bab4..63e51dea28f76 100644 +--- a/src/nvim/eval/userfunc.c ++++ b/src/nvim/eval/userfunc.c +@@ -594,14 +594,20 @@ ufunc_T *find_func(const char *name) + /// Copy the function name of "fp" to buffer "buf". + /// "buf" must be able to hold the function name plus three bytes. + /// Takes care of script-local function names. +-static void cat_func_name(char *buf, ufunc_T *fp) ++static void cat_func_name(char *buf, size_t buflen, ufunc_T *fp) + { +- if ((uint8_t)fp->uf_name[0] == K_SPECIAL) { +- STRCPY(buf, ""); +- STRCAT(buf, fp->uf_name + 3); ++ int len = -1; ++ size_t uflen = strlen(fp->uf_name); ++ assert(uflen > 0); ++ ++ if ((uint8_t)fp->uf_name[0] == K_SPECIAL && uflen > 3) { ++ len = snprintf(buf, buflen, "%s", fp->uf_name + 3); + } else { +- STRCPY(buf, fp->uf_name); ++ len = snprintf(buf, buflen, "%s", fp->uf_name); + } ++ ++ (void)len; // Avoid unused warning on release builds ++ assert(len > 0); + } + + /// Add a number variable "name" to dict "dp" with value "nr". +@@ -2746,7 +2752,7 @@ char *get_user_func_name(expand_T *xp, int idx) + return fp->uf_name; // Prevent overflow. + } + +- cat_func_name(IObuff, fp); ++ cat_func_name(IObuff, IOSIZE, fp); + if (xp->xp_context != EXPAND_USER_FUNC) { + STRCAT(IObuff, "("); + if (!fp->uf_varargs && GA_EMPTY(&fp->uf_args)) { + +From 6b32fe96b020c727141d279d976fcebb3b3939dc Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 21 Apr 2023 11:13:23 +0200 +Subject: [PATCH 5/8] fix(ex_getln): initialize pointer with NULL +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 a114a21eff58492046645b052fa3f703cddc9ce8) +--- + src/nvim/ex_getln.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c +index 97343e468b653..a8ac6ab439850 100644 +--- a/src/nvim/ex_getln.c ++++ b/src/nvim/ex_getln.c +@@ -2446,7 +2446,7 @@ static bool cmdpreview_may_show(CommandLineState *s) + + CpInfo cpinfo; + bool icm_split = *p_icm == 's'; // inccommand=split +- buf_T *cmdpreview_buf; ++ buf_T *cmdpreview_buf = NULL; + win_T *cmdpreview_win = NULL; + + emsg_silent++; // Block error reporting as the command may be incomplete, + +From a77a8a993473174bd8e469b249cf72ac9854544d Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 21 Apr 2023 11:15:20 +0200 +Subject: [PATCH 6/8] fix(linematch): initialize array +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 f5530bf566f6617565b5c1f5d1a9acc964199c93) +--- + src/nvim/linematch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nvim/linematch.c b/src/nvim/linematch.c +index a15f41d9a8111..7bde6bb121734 100644 +--- a/src/nvim/linematch.c ++++ b/src/nvim/linematch.c +@@ -186,7 +186,7 @@ static void try_possible_paths(const int *df_iters, const size_t *paths, const i + { + if (path_idx == npaths) { + if ((*choice) > 0) { +- int from_vals[LN_MAX_BUFS]; ++ int from_vals[LN_MAX_BUFS] = { 0 }; + const int *to_vals = df_iters; + const char *current_lines[LN_MAX_BUFS]; + for (size_t k = 0; k < ndiffs; k++) { + +From a99d5d17d50e39bc212f2a7bc745d666e690044e Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 21 Apr 2023 11:22:14 +0200 +Subject: [PATCH 7/8] fix(statusline): fix uninitialized variable and possible + overflow +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 54f5602038975b28570f4ab183b3388842347f57) +--- + src/nvim/statusline.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c +index d0b1727d545d4..d4595d21fe1ca 100644 +--- a/src/nvim/statusline.c ++++ b/src/nvim/statusline.c +@@ -1653,7 +1653,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n + break; + } + +- char *p; ++ char *p = NULL; + if (fold) { + size_t n = fill_foldcolumn(out_p, wp, stcp->foldinfo, (linenr_T)get_vim_var_nr(VV_LNUM)); + stl_items[curitem].minwid = -((stcp->use_cul ? HLF_CLF : HLF_FC) + 1); +@@ -1675,14 +1675,17 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n + stl_items[curitem].minwid = -(sattr ? stcp->sign_cul_id ? stcp->sign_cul_id + : sattr->hl_id : (stcp->use_cul ? HLF_CLS : HLF_SC) + 1); + } ++ size_t buflen = strlen(buf_tmp); + stl_items[curitem].type = Highlight; +- stl_items[curitem].start = out_p + strlen(buf_tmp); ++ stl_items[curitem].start = out_p + buflen; + curitem++; + if (i == width) { + str = buf_tmp; + break; + } +- STRCAT(buf_tmp, p); ++ int rc = snprintf(buf_tmp + buflen, sizeof(buf_tmp) - buflen, "%s", p); ++ (void)rc; // Avoid unused warning on release build ++ assert(rc > 0); + } + break; + } + +From c0845343b68bc7b58e8241cb012c78d41d8a33d8 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 21 Apr 2023 11:30:31 +0200 +Subject: [PATCH 8/8] fix(ui_client): check return code of dup() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 4d654472e65ed28b7cd9e66c91d98b9991452266) +--- + src/nvim/ui_client.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c +index b93b31f7dc301..e177c0a60d600 100644 +--- a/src/nvim/ui_client.c ++++ b/src/nvim/ui_client.c +@@ -65,7 +65,11 @@ uint64_t ui_client_start_server(int argc, char **argv) + #ifdef MSWIN + os_open_conin_fd(); + #else +- dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO); ++ int fd = dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO); ++ if (fd < 0) { ++ return 0; ++ } ++ // FIXME: resource leak of fd + #endif + } + diff --git a/23246.patch b/23246.patch new file mode 100644 index 0000000..0d4150c --- /dev/null +++ b/23246.patch @@ -0,0 +1,150 @@ +From 30cfd28257d06a5766e62662b47e83ee4b508061 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Fri, 21 Apr 2023 13:16:32 +0200 +Subject: [PATCH] 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=, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 + #1 0x00007f3eb8b93c03 in __pthread_kill_internal (signo=6, threadid=) 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 "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 "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 , 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=, fgetline=0x55b8c79882b8 , 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=) 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=, argv=) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/main.c:641 +--- + src/nvim/usercmd.c | 34 ++++++++++++++------------ + test/functional/ex_cmds/excmd_spec.lua | 6 ++++- + 2 files changed, 24 insertions(+), 16 deletions(-) + +diff --git a/src/nvim/usercmd.c b/src/nvim/usercmd.c +index 4cd58bb91b4e8..dadb160a19710 100644 +--- a/src/nvim/usercmd.c ++++ b/src/nvim/usercmd.c +@@ -470,7 +470,7 @@ static void uc_list(char *name, size_t name_len) + } + + // Special cases +- int len = 4; ++ size_t len = 4; + if (a & EX_BANG) { + msg_putchar('!'); + len--; +@@ -492,7 +492,7 @@ static void uc_list(char *name, size_t name_len) + } + + msg_outtrans_attr(cmd->uc_name, HL_ATTR(HLF_D)); +- len = (int)strlen(cmd->uc_name) + 4; ++ len = strlen(cmd->uc_name) + 4; + + do { + msg_putchar(' '); +@@ -501,7 +501,7 @@ static void uc_list(char *name, size_t name_len) + + // "over" is how much longer the name is than the column width for + // the name, we'll try to align what comes after. +- const int over = len - 22; ++ const int64_t over = (int64_t)len - 22; + len = 0; + + // Arguments +@@ -525,20 +525,22 @@ static void uc_list(char *name, size_t name_len) + + do { + IObuff[len++] = ' '; +- } while (len < 5 - over); ++ } while ((int64_t)len < 5 - over); + + // Address / Range + if (a & (EX_RANGE | EX_COUNT)) { + if (a & EX_COUNT) { + // -count=N +- snprintf(IObuff + len, IOSIZE, "%" PRId64 "c", cmd->uc_def); +- len += (int)strlen(IObuff + len); ++ int rc = snprintf(IObuff + len, IOSIZE - len, "%" PRId64 "c", cmd->uc_def); ++ assert(rc > 0); ++ len += (size_t)rc; + } else if (a & EX_DFLALL) { + IObuff[len++] = '%'; + } else if (cmd->uc_def >= 0) { + // -range=N +- snprintf(IObuff + len, IOSIZE, "%" PRId64 "", cmd->uc_def); +- len += (int)strlen(IObuff + len); ++ int rc = snprintf(IObuff + len, IOSIZE - len, "%" PRId64 "", cmd->uc_def); ++ assert(rc > 0); ++ len += (size_t)rc; + } else { + IObuff[len++] = '.'; + } +@@ -546,32 +548,34 @@ static void uc_list(char *name, size_t name_len) + + do { + IObuff[len++] = ' '; +- } while (len < 8 - over); ++ } while ((int64_t)len < 8 - over); + + // Address Type + for (j = 0; addr_type_complete[j].expand != ADDR_NONE; j++) { + if (addr_type_complete[j].expand != ADDR_LINES + && addr_type_complete[j].expand == cmd->uc_addr_type) { +- STRCPY(IObuff + len, addr_type_complete[j].shortname); +- len += (int)strlen(IObuff + len); ++ int rc = snprintf(IObuff + len, IOSIZE - len, "%s", addr_type_complete[j].shortname); ++ assert(rc > 0); ++ len += (size_t)rc; + break; + } + } + + do { + IObuff[len++] = ' '; +- } while (len < 13 - over); ++ } while ((int64_t)len < 13 - over); + + // Completion + char *cmd_compl = get_command_complete(cmd->uc_compl); + if (cmd_compl != NULL) { +- STRCPY(IObuff + len, get_command_complete(cmd->uc_compl)); +- len += (int)strlen(IObuff + len); ++ int rc = snprintf(IObuff + len, IOSIZE - len, "%s", get_command_complete(cmd->uc_compl)); ++ assert(rc > 0); ++ len += (size_t)rc; + } + + do { + IObuff[len++] = ' '; +- } while (len < 25 - over); ++ } while ((int64_t)len < 25 - over); + + IObuff[len] = '\0'; + msg_outtrans(IObuff); +diff --git a/test/functional/ex_cmds/excmd_spec.lua b/test/functional/ex_cmds/excmd_spec.lua +index e243f3c524d00..21bcdc079161c 100644 +--- a/test/functional/ex_cmds/excmd_spec.lua ++++ b/test/functional/ex_cmds/excmd_spec.lua +@@ -26,5 +26,9 @@ describe('Ex cmds', function() + pcall_err(command, ':bdelete 9999999999999999999999999999999999999999')) + assert_alive() + end) +-end) + ++ it('listing long user command does not crash', function() ++ command('execute "command" repeat("T", 255) ":"') ++ command('command') ++ end) ++end) diff --git a/neovim.spec b/neovim.spec index 92cef70..ca77400 100644 --- a/neovim.spec +++ b/neovim.spec @@ -40,7 +40,7 @@ Name: neovim Version: 0.9.0 -Release: 1%{?dist} +Release: 2%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -50,6 +50,9 @@ Source0: https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{v Source1: sysinit.vim Source2: spec-template +Patch0: https://github.com/neovim/neovim/pull/23246.patch +Patch1: https://github.com/neovim/neovim/pull/23245.patch + Patch1000: neovim-lua-bit32.patch BuildRequires: gcc-c++ @@ -86,7 +89,7 @@ BuildRequires: pkgconfig(vterm) >= 0.3 # need the build with the fix for the resize buffer issue Requires: libvterm >= 0.3 BuildRequires: pkgconfig(unibilium) -BuildRequires: pkgconfig(libtree-sitter) >= %{tree_sitter_min_ver} +BuildRequires: pkgconfig(tree-sitter) >= %{tree_sitter_min_ver} # tree-sitter didn't do an soname bump. enforce the min version # see https://github.com/nvim-treesitter/nvim-treesitter/pull/3055/files Requires: libtree-sitter >= %{tree_sitter_min_ver} @@ -1953,6 +1956,9 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Fri Apr 21 2023 Andreas Schneider - 0.9.0-2 +- resolves: rhbz#2188229 - Fix buffer overflow for user command + * Fri Apr 07 2023 Andreas Schneider - 0.9.0-1 - Update to version 0.9.0 * For changelog see `:help news` From 1db78db25d5a4604888b06f47152c5a43f259a47 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 2 May 2023 08:08:09 +0200 Subject: [PATCH 10/17] Improve semantic token performance and fix applying patches related: rhbz#2188229 --- 23375.patch | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++ neovim.spec | 10 ++++- 2 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 23375.patch diff --git a/23375.patch b/23375.patch new file mode 100644 index 0000000..6db2251 --- /dev/null +++ b/23375.patch @@ -0,0 +1,108 @@ +From 46cd1d957c88ea229b50ccafa63878e14c4d57c9 Mon Sep 17 00:00:00 2001 +From: John Drouhard +Date: Fri, 28 Apr 2023 08:20:38 -0500 +Subject: [PATCH] perf(lsp): process semantic tokens response in a coroutine + that yields every 5ms + +--- + runtime/lua/vim/lsp/semantic_tokens.lua | 45 ++++++++++++++++++++----- + 1 file changed, 37 insertions(+), 8 deletions(-) + +diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua +index 03532c33b7547..b6b09c58b1e60 100644 +--- a/runtime/lua/vim/lsp/semantic_tokens.lua ++++ b/runtime/lua/vim/lsp/semantic_tokens.lua +@@ -1,7 +1,8 @@ + local api = vim.api ++local bit = require('bit') + local handlers = require('vim.lsp.handlers') + local util = require('vim.lsp.util') +-local bit = require('bit') ++local uv = vim.loop + + --- @class STTokenRange + --- @field line integer line number 0-based +@@ -94,15 +95,38 @@ end + --- + ---@private + ---@return STTokenRange[] +-local function tokens_to_ranges(data, bufnr, client) ++local function tokens_to_ranges(data, bufnr, client, request) + local legend = client.server_capabilities.semanticTokensProvider.legend + local token_types = legend.tokenTypes + local token_modifiers = legend.tokenModifiers + local ranges = {} + ++ local start = uv.hrtime() ++ local ms_to_ns = 1000 * 1000 ++ local yield_interval_ns = 5 * ms_to_ns ++ local co, is_main = coroutine.running() ++ + local line + local start_char = 0 + for i = 1, #data, 5 do ++ -- if this function is called from the main coroutine, let it run to completion with no yield ++ if not is_main then ++ local elapsed_ns = uv.hrtime() - start ++ ++ if elapsed_ns > yield_interval_ns then ++ vim.schedule(function() ++ coroutine.resume(co, util.buf_versions[bufnr]) ++ end) ++ if request.version ~= coroutine.yield() then ++ -- request became stale since the last time the coroutine ran. ++ -- abandon it by yielding without a way to resume ++ coroutine.yield() ++ end ++ ++ start = uv.hrtime() ++ end ++ end ++ + local delta_line = data[i] + line = line and line + delta_line or delta_line + local delta_start = data[i + 1] +@@ -280,7 +304,7 @@ function STHighlighter:send_request() + local c = vim.lsp.get_client_by_id(ctx.client_id) + local highlighter = STHighlighter.active[ctx.bufnr] + if not err and c and highlighter then +- highlighter:process_response(response, c, version) ++ coroutine.wrap(STHighlighter.process_response)(highlighter, response, c, version) + end + end, self.bufnr) + +@@ -315,11 +339,9 @@ function STHighlighter:process_response(response, client, version) + return + end + +- -- reset active request +- state.active_request = {} +- + -- skip nil responses + if response == nil then ++ state.active_request = {} + return + end + +@@ -347,12 +369,19 @@ function STHighlighter:process_response(response, client, version) + tokens = response.data + end + +- -- Update the state with the new results ++ -- convert token list to highlight ranges ++ -- this could yield and run over multiple event loop iterations ++ local highlights = tokens_to_ranges(tokens, self.bufnr, client, state.active_request) ++ ++ -- reset active request ++ state.active_request = {} ++ ++ -- update the state with the new results + local current_result = state.current_result + current_result.version = version + current_result.result_id = response.resultId + current_result.tokens = tokens +- current_result.highlights = tokens_to_ranges(tokens, self.bufnr, client) ++ current_result.highlights = highlights + current_result.namespace_cleared = false + + -- redraw all windows displaying buffer diff --git a/neovim.spec b/neovim.spec index ca77400..45b174a 100644 --- a/neovim.spec +++ b/neovim.spec @@ -40,7 +40,7 @@ Name: neovim Version: 0.9.0 -Release: 2%{?dist} +Release: 3%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -52,6 +52,7 @@ Source2: spec-template Patch0: https://github.com/neovim/neovim/pull/23246.patch Patch1: https://github.com/neovim/neovim/pull/23245.patch +Patch2: https://github.com/neovim/neovim/pull/23375.patch Patch1000: neovim-lua-bit32.patch @@ -113,6 +114,9 @@ parts of Vim, without compromise, and more. %prep %setup -q +%patch -P 0 -p1 +%patch -P 1 -p1 +%patch -P 2 -p1 %if %{without luajit} %patch -P 1000 -p1 @@ -1956,6 +1960,10 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Tue May 02 2023 Andreas Schneider - 0.9.0-3 +- Improve semantic token performance +- related: rhbz#2188229 - Fix applying patches + * Fri Apr 21 2023 Andreas Schneider - 0.9.0-2 - resolves: rhbz#2188229 - Fix buffer overflow for user command From 59c85eaebb4957931b9e99a4d8a1d48d2c68d91b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 31 May 2023 09:51:11 +0200 Subject: [PATCH 11/17] Update to version 0.9.1 --- .gitignore | 1 + 23245.patch | 338 ---------------------------------------------------- 23246.patch | 150 ----------------------- 23375.patch | 108 ----------------- neovim.spec | 16 ++- sources | 2 +- 6 files changed, 9 insertions(+), 606 deletions(-) delete mode 100644 23245.patch delete mode 100644 23246.patch delete mode 100644 23375.patch diff --git a/.gitignore b/.gitignore index c273174..71033ba 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /neovim-0.8.2.tar.gz /neovim-0.8.3.tar.gz /neovim-0.9.0.tar.gz +/neovim-0.9.1.tar.gz diff --git a/23245.patch b/23245.patch deleted file mode 100644 index 5fc5c0c..0000000 --- a/23245.patch +++ /dev/null @@ -1,338 +0,0 @@ -From b2a43b5287976f0bdbc43690038d9ae37610ff00 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 21 Apr 2023 10:55:36 +0200 -Subject: [PATCH 1/8] fix(api): avoid integer truncation -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 ef7ae66eef4e36e15b5248b926b4b020387d8101) ---- - src/nvim/api/vim.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c -index c8bb22b33c0c1..d47f47e63863b 100644 ---- a/src/nvim/api/vim.c -+++ b/src/nvim/api/vim.c -@@ -2241,7 +2241,7 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error * - if (highlights) { - Array hl_values = ARRAY_DICT_INIT; - const char *grpname; -- char user_group[6]; -+ char user_group[15]; // strlen("User") + strlen("2147483647") + NUL - - // If first character doesn't have a defined highlight, - // add the default highlight at the beginning of the highlight list - -From b91278c4fa8f7bb319213e9cc47951795b9fda92 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 21 Apr 2023 10:58:46 +0200 -Subject: [PATCH 2/8] fix(drawline): initialize variable -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 e9280a68f7ead83c572bb4c792bc743df9da7149) ---- - src/nvim/drawline.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c -index 2268a7cd3ec88..40612472bba11 100644 ---- a/src/nvim/drawline.c -+++ b/src/nvim/drawline.c -@@ -282,7 +282,7 @@ static void draw_virt_text(win_T *wp, buf_T *buf, int col_off, int *end_col, int - if (item->win_col < 0) { - continue; - } -- int col; -+ int col = 0; - if (item->decor.ui_watched) { - // send mark position to UI - col = item->win_col; - -From 6bd73ed2d9e5c03b9054aadfe765a6cc341f3eb5 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 21 Apr 2023 11:00:46 +0200 -Subject: [PATCH 3/8] fix(drawline): initialize variable -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 2819718873a38c68cca0295f59186444d8534e06) ---- - src/nvim/drawline.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c -index 40612472bba11..69b3eef5e753a 100644 ---- a/src/nvim/drawline.c -+++ b/src/nvim/drawline.c -@@ -1386,7 +1386,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange, - if (v > 0 && !number_only) { - char *prev_ptr = ptr; - chartabsize_T cts; -- int charsize; -+ int charsize = 0; - - init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, ptr); - while (cts.cts_vcol < v && *cts.cts_ptr != NUL) { - -From 6ba14ff18265ff2b112b6571763b330ed5ef2e30 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 21 Apr 2023 11:07:56 +0200 -Subject: [PATCH 4/8] fix(userfunc): fix possible out of bound access -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 ‘’ 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 9802de933484cc0a69ee328f3e4e6efbb83c308e) ---- - src/nvim/eval/userfunc.c | 18 ++++++++++++------ - 1 file changed, 12 insertions(+), 6 deletions(-) - -diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c -index f09da6b79bab4..63e51dea28f76 100644 ---- a/src/nvim/eval/userfunc.c -+++ b/src/nvim/eval/userfunc.c -@@ -594,14 +594,20 @@ ufunc_T *find_func(const char *name) - /// Copy the function name of "fp" to buffer "buf". - /// "buf" must be able to hold the function name plus three bytes. - /// Takes care of script-local function names. --static void cat_func_name(char *buf, ufunc_T *fp) -+static void cat_func_name(char *buf, size_t buflen, ufunc_T *fp) - { -- if ((uint8_t)fp->uf_name[0] == K_SPECIAL) { -- STRCPY(buf, ""); -- STRCAT(buf, fp->uf_name + 3); -+ int len = -1; -+ size_t uflen = strlen(fp->uf_name); -+ assert(uflen > 0); -+ -+ if ((uint8_t)fp->uf_name[0] == K_SPECIAL && uflen > 3) { -+ len = snprintf(buf, buflen, "%s", fp->uf_name + 3); - } else { -- STRCPY(buf, fp->uf_name); -+ len = snprintf(buf, buflen, "%s", fp->uf_name); - } -+ -+ (void)len; // Avoid unused warning on release builds -+ assert(len > 0); - } - - /// Add a number variable "name" to dict "dp" with value "nr". -@@ -2746,7 +2752,7 @@ char *get_user_func_name(expand_T *xp, int idx) - return fp->uf_name; // Prevent overflow. - } - -- cat_func_name(IObuff, fp); -+ cat_func_name(IObuff, IOSIZE, fp); - if (xp->xp_context != EXPAND_USER_FUNC) { - STRCAT(IObuff, "("); - if (!fp->uf_varargs && GA_EMPTY(&fp->uf_args)) { - -From 6b32fe96b020c727141d279d976fcebb3b3939dc Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 21 Apr 2023 11:13:23 +0200 -Subject: [PATCH 5/8] fix(ex_getln): initialize pointer with NULL -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 a114a21eff58492046645b052fa3f703cddc9ce8) ---- - src/nvim/ex_getln.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c -index 97343e468b653..a8ac6ab439850 100644 ---- a/src/nvim/ex_getln.c -+++ b/src/nvim/ex_getln.c -@@ -2446,7 +2446,7 @@ static bool cmdpreview_may_show(CommandLineState *s) - - CpInfo cpinfo; - bool icm_split = *p_icm == 's'; // inccommand=split -- buf_T *cmdpreview_buf; -+ buf_T *cmdpreview_buf = NULL; - win_T *cmdpreview_win = NULL; - - emsg_silent++; // Block error reporting as the command may be incomplete, - -From a77a8a993473174bd8e469b249cf72ac9854544d Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 21 Apr 2023 11:15:20 +0200 -Subject: [PATCH 6/8] fix(linematch): initialize array -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 f5530bf566f6617565b5c1f5d1a9acc964199c93) ---- - src/nvim/linematch.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/nvim/linematch.c b/src/nvim/linematch.c -index a15f41d9a8111..7bde6bb121734 100644 ---- a/src/nvim/linematch.c -+++ b/src/nvim/linematch.c -@@ -186,7 +186,7 @@ static void try_possible_paths(const int *df_iters, const size_t *paths, const i - { - if (path_idx == npaths) { - if ((*choice) > 0) { -- int from_vals[LN_MAX_BUFS]; -+ int from_vals[LN_MAX_BUFS] = { 0 }; - const int *to_vals = df_iters; - const char *current_lines[LN_MAX_BUFS]; - for (size_t k = 0; k < ndiffs; k++) { - -From a99d5d17d50e39bc212f2a7bc745d666e690044e Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 21 Apr 2023 11:22:14 +0200 -Subject: [PATCH 7/8] fix(statusline): fix uninitialized variable and possible - overflow -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 54f5602038975b28570f4ab183b3388842347f57) ---- - src/nvim/statusline.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c -index d0b1727d545d4..d4595d21fe1ca 100644 ---- a/src/nvim/statusline.c -+++ b/src/nvim/statusline.c -@@ -1653,7 +1653,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n - break; - } - -- char *p; -+ char *p = NULL; - if (fold) { - size_t n = fill_foldcolumn(out_p, wp, stcp->foldinfo, (linenr_T)get_vim_var_nr(VV_LNUM)); - stl_items[curitem].minwid = -((stcp->use_cul ? HLF_CLF : HLF_FC) + 1); -@@ -1675,14 +1675,17 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n - stl_items[curitem].minwid = -(sattr ? stcp->sign_cul_id ? stcp->sign_cul_id - : sattr->hl_id : (stcp->use_cul ? HLF_CLS : HLF_SC) + 1); - } -+ size_t buflen = strlen(buf_tmp); - stl_items[curitem].type = Highlight; -- stl_items[curitem].start = out_p + strlen(buf_tmp); -+ stl_items[curitem].start = out_p + buflen; - curitem++; - if (i == width) { - str = buf_tmp; - break; - } -- STRCAT(buf_tmp, p); -+ int rc = snprintf(buf_tmp + buflen, sizeof(buf_tmp) - buflen, "%s", p); -+ (void)rc; // Avoid unused warning on release build -+ assert(rc > 0); - } - break; - } - -From c0845343b68bc7b58e8241cb012c78d41d8a33d8 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 21 Apr 2023 11:30:31 +0200 -Subject: [PATCH 8/8] fix(ui_client): check return code of dup() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 4d654472e65ed28b7cd9e66c91d98b9991452266) ---- - src/nvim/ui_client.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c -index b93b31f7dc301..e177c0a60d600 100644 ---- a/src/nvim/ui_client.c -+++ b/src/nvim/ui_client.c -@@ -65,7 +65,11 @@ uint64_t ui_client_start_server(int argc, char **argv) - #ifdef MSWIN - os_open_conin_fd(); - #else -- dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO); -+ int fd = dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO); -+ if (fd < 0) { -+ return 0; -+ } -+ // FIXME: resource leak of fd - #endif - } - diff --git a/23246.patch b/23246.patch deleted file mode 100644 index 0d4150c..0000000 --- a/23246.patch +++ /dev/null @@ -1,150 +0,0 @@ -From 30cfd28257d06a5766e62662b47e83ee4b508061 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Fri, 21 Apr 2023 13:16:32 +0200 -Subject: [PATCH] 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=, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 - #1 0x00007f3eb8b93c03 in __pthread_kill_internal (signo=6, threadid=) 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 "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 "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 , 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=, fgetline=0x55b8c79882b8 , 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=) 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=, argv=) at /usr/src/debug/neovim-0.9.0-1.fc38.x86_64/src/nvim/main.c:641 ---- - src/nvim/usercmd.c | 34 ++++++++++++++------------ - test/functional/ex_cmds/excmd_spec.lua | 6 ++++- - 2 files changed, 24 insertions(+), 16 deletions(-) - -diff --git a/src/nvim/usercmd.c b/src/nvim/usercmd.c -index 4cd58bb91b4e8..dadb160a19710 100644 ---- a/src/nvim/usercmd.c -+++ b/src/nvim/usercmd.c -@@ -470,7 +470,7 @@ static void uc_list(char *name, size_t name_len) - } - - // Special cases -- int len = 4; -+ size_t len = 4; - if (a & EX_BANG) { - msg_putchar('!'); - len--; -@@ -492,7 +492,7 @@ static void uc_list(char *name, size_t name_len) - } - - msg_outtrans_attr(cmd->uc_name, HL_ATTR(HLF_D)); -- len = (int)strlen(cmd->uc_name) + 4; -+ len = strlen(cmd->uc_name) + 4; - - do { - msg_putchar(' '); -@@ -501,7 +501,7 @@ static void uc_list(char *name, size_t name_len) - - // "over" is how much longer the name is than the column width for - // the name, we'll try to align what comes after. -- const int over = len - 22; -+ const int64_t over = (int64_t)len - 22; - len = 0; - - // Arguments -@@ -525,20 +525,22 @@ static void uc_list(char *name, size_t name_len) - - do { - IObuff[len++] = ' '; -- } while (len < 5 - over); -+ } while ((int64_t)len < 5 - over); - - // Address / Range - if (a & (EX_RANGE | EX_COUNT)) { - if (a & EX_COUNT) { - // -count=N -- snprintf(IObuff + len, IOSIZE, "%" PRId64 "c", cmd->uc_def); -- len += (int)strlen(IObuff + len); -+ int rc = snprintf(IObuff + len, IOSIZE - len, "%" PRId64 "c", cmd->uc_def); -+ assert(rc > 0); -+ len += (size_t)rc; - } else if (a & EX_DFLALL) { - IObuff[len++] = '%'; - } else if (cmd->uc_def >= 0) { - // -range=N -- snprintf(IObuff + len, IOSIZE, "%" PRId64 "", cmd->uc_def); -- len += (int)strlen(IObuff + len); -+ int rc = snprintf(IObuff + len, IOSIZE - len, "%" PRId64 "", cmd->uc_def); -+ assert(rc > 0); -+ len += (size_t)rc; - } else { - IObuff[len++] = '.'; - } -@@ -546,32 +548,34 @@ static void uc_list(char *name, size_t name_len) - - do { - IObuff[len++] = ' '; -- } while (len < 8 - over); -+ } while ((int64_t)len < 8 - over); - - // Address Type - for (j = 0; addr_type_complete[j].expand != ADDR_NONE; j++) { - if (addr_type_complete[j].expand != ADDR_LINES - && addr_type_complete[j].expand == cmd->uc_addr_type) { -- STRCPY(IObuff + len, addr_type_complete[j].shortname); -- len += (int)strlen(IObuff + len); -+ int rc = snprintf(IObuff + len, IOSIZE - len, "%s", addr_type_complete[j].shortname); -+ assert(rc > 0); -+ len += (size_t)rc; - break; - } - } - - do { - IObuff[len++] = ' '; -- } while (len < 13 - over); -+ } while ((int64_t)len < 13 - over); - - // Completion - char *cmd_compl = get_command_complete(cmd->uc_compl); - if (cmd_compl != NULL) { -- STRCPY(IObuff + len, get_command_complete(cmd->uc_compl)); -- len += (int)strlen(IObuff + len); -+ int rc = snprintf(IObuff + len, IOSIZE - len, "%s", get_command_complete(cmd->uc_compl)); -+ assert(rc > 0); -+ len += (size_t)rc; - } - - do { - IObuff[len++] = ' '; -- } while (len < 25 - over); -+ } while ((int64_t)len < 25 - over); - - IObuff[len] = '\0'; - msg_outtrans(IObuff); -diff --git a/test/functional/ex_cmds/excmd_spec.lua b/test/functional/ex_cmds/excmd_spec.lua -index e243f3c524d00..21bcdc079161c 100644 ---- a/test/functional/ex_cmds/excmd_spec.lua -+++ b/test/functional/ex_cmds/excmd_spec.lua -@@ -26,5 +26,9 @@ describe('Ex cmds', function() - pcall_err(command, ':bdelete 9999999999999999999999999999999999999999')) - assert_alive() - end) --end) - -+ it('listing long user command does not crash', function() -+ command('execute "command" repeat("T", 255) ":"') -+ command('command') -+ end) -+end) diff --git a/23375.patch b/23375.patch deleted file mode 100644 index 6db2251..0000000 --- a/23375.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 46cd1d957c88ea229b50ccafa63878e14c4d57c9 Mon Sep 17 00:00:00 2001 -From: John Drouhard -Date: Fri, 28 Apr 2023 08:20:38 -0500 -Subject: [PATCH] perf(lsp): process semantic tokens response in a coroutine - that yields every 5ms - ---- - runtime/lua/vim/lsp/semantic_tokens.lua | 45 ++++++++++++++++++++----- - 1 file changed, 37 insertions(+), 8 deletions(-) - -diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua -index 03532c33b7547..b6b09c58b1e60 100644 ---- a/runtime/lua/vim/lsp/semantic_tokens.lua -+++ b/runtime/lua/vim/lsp/semantic_tokens.lua -@@ -1,7 +1,8 @@ - local api = vim.api -+local bit = require('bit') - local handlers = require('vim.lsp.handlers') - local util = require('vim.lsp.util') --local bit = require('bit') -+local uv = vim.loop - - --- @class STTokenRange - --- @field line integer line number 0-based -@@ -94,15 +95,38 @@ end - --- - ---@private - ---@return STTokenRange[] --local function tokens_to_ranges(data, bufnr, client) -+local function tokens_to_ranges(data, bufnr, client, request) - local legend = client.server_capabilities.semanticTokensProvider.legend - local token_types = legend.tokenTypes - local token_modifiers = legend.tokenModifiers - local ranges = {} - -+ local start = uv.hrtime() -+ local ms_to_ns = 1000 * 1000 -+ local yield_interval_ns = 5 * ms_to_ns -+ local co, is_main = coroutine.running() -+ - local line - local start_char = 0 - for i = 1, #data, 5 do -+ -- if this function is called from the main coroutine, let it run to completion with no yield -+ if not is_main then -+ local elapsed_ns = uv.hrtime() - start -+ -+ if elapsed_ns > yield_interval_ns then -+ vim.schedule(function() -+ coroutine.resume(co, util.buf_versions[bufnr]) -+ end) -+ if request.version ~= coroutine.yield() then -+ -- request became stale since the last time the coroutine ran. -+ -- abandon it by yielding without a way to resume -+ coroutine.yield() -+ end -+ -+ start = uv.hrtime() -+ end -+ end -+ - local delta_line = data[i] - line = line and line + delta_line or delta_line - local delta_start = data[i + 1] -@@ -280,7 +304,7 @@ function STHighlighter:send_request() - local c = vim.lsp.get_client_by_id(ctx.client_id) - local highlighter = STHighlighter.active[ctx.bufnr] - if not err and c and highlighter then -- highlighter:process_response(response, c, version) -+ coroutine.wrap(STHighlighter.process_response)(highlighter, response, c, version) - end - end, self.bufnr) - -@@ -315,11 +339,9 @@ function STHighlighter:process_response(response, client, version) - return - end - -- -- reset active request -- state.active_request = {} -- - -- skip nil responses - if response == nil then -+ state.active_request = {} - return - end - -@@ -347,12 +369,19 @@ function STHighlighter:process_response(response, client, version) - tokens = response.data - end - -- -- Update the state with the new results -+ -- convert token list to highlight ranges -+ -- this could yield and run over multiple event loop iterations -+ local highlights = tokens_to_ranges(tokens, self.bufnr, client, state.active_request) -+ -+ -- reset active request -+ state.active_request = {} -+ -+ -- update the state with the new results - local current_result = state.current_result - current_result.version = version - current_result.result_id = response.resultId - current_result.tokens = tokens -- current_result.highlights = tokens_to_ranges(tokens, self.bufnr, client) -+ current_result.highlights = highlights - current_result.namespace_cleared = false - - -- redraw all windows displaying buffer diff --git a/neovim.spec b/neovim.spec index 45b174a..38b74d1 100644 --- a/neovim.spec +++ b/neovim.spec @@ -39,8 +39,8 @@ %endif Name: neovim -Version: 0.9.0 -Release: 3%{?dist} +Version: 0.9.1 +Release: 1%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -50,10 +50,6 @@ Source0: https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{v Source1: sysinit.vim Source2: spec-template -Patch0: https://github.com/neovim/neovim/pull/23246.patch -Patch1: https://github.com/neovim/neovim/pull/23245.patch -Patch2: https://github.com/neovim/neovim/pull/23375.patch - Patch1000: neovim-lua-bit32.patch BuildRequires: gcc-c++ @@ -114,9 +110,6 @@ parts of Vim, without compromise, and more. %prep %setup -q -%patch -P 0 -p1 -%patch -P 1 -p1 -%patch -P 2 -p1 %if %{without luajit} %patch -P 1000 -p1 @@ -571,6 +564,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/crm.vim %{_datadir}/nvim/runtime/ftplugin/crontab.vim %{_datadir}/nvim/runtime/ftplugin/cs.vim +%{_datadir}/nvim/runtime/ftplugin/cs.lua %{_datadir}/nvim/runtime/ftplugin/csc.vim %{_datadir}/nvim/runtime/ftplugin/csh.vim %{_datadir}/nvim/runtime/ftplugin/css.lua @@ -1960,6 +1954,10 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Wed May 31 2023 Andreas Schneider - 0.9.1-1 +- Update to version 0.9.1 + * For changelog see `:help news` + * Tue May 02 2023 Andreas Schneider - 0.9.0-3 - Improve semantic token performance - related: rhbz#2188229 - Fix applying patches diff --git a/sources b/sources index bde8f1c..88c3b1a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (neovim-0.9.0.tar.gz) = e42f09f408b83fc34e8f169321e0349d1f851e67a998265c53d2ddb1a4792c3f4777fabe32baf2c7eff7d3745ff60d4a07da542ccd272883f7f4e080b2c9c1bf +SHA512 (neovim-0.9.1.tar.gz) = 339efd3d8c1a73aa3b43e8770d6943aeba9e4ce6a3598c0424e388f80759d50b14aa7c60fd435bf2d17997476e06d28b79e7e98670d02ca9ceec031841e8b9b8 From eef71caa1e08924c23811b364251aeffaaa5afc0 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 5 Jun 2023 07:48:30 +0200 Subject: [PATCH 12/17] Remove linker hack --- neovim.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/neovim.spec b/neovim.spec index 38b74d1..d49d94d 100644 --- a/neovim.spec +++ b/neovim.spec @@ -124,10 +124,8 @@ USERNAME=koji -DLUA_PRG=%{lua_prg} \ -DENABLE_JEMALLOC=%{?with_jemalloc:ON}%{!?with_jemalloc:OFF} \ -DLIBLUV_INCLUDE_DIR:PATH=%{luv_include_dir} \ - -DLIBLUV_LIBRARY:FILEPATH=%{luv_library} + -DLIBLUV_LIBRARY:STRING=-Wl,%{luv_library} -# HACK: Replace -lluv with the correct path -sed -i 's#-lluv#%{luv_library}#' %{__cmake_builddir}/src/nvim/CMakeFiles/nvim.dir/link.txt %cmake_build %install From df88ec9623ab863a3a76429eeb9d630af8c4b6ac Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 6 Jun 2023 09:05:34 +0200 Subject: [PATCH 13/17] Build with new libluv-devel --- neovim.spec | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/neovim.spec b/neovim.spec index d49d94d..10605f3 100644 --- a/neovim.spec +++ b/neovim.spec @@ -24,23 +24,18 @@ %global luv_min_ver 1.43.0 %global tree_sitter_min_ver 0.20.8 +%global luv_include_dir %{_includedir}/luv %if %{with luajit} %global luajit_version 2.1 %global lua_prg %{_bindir}/luajit - -%global luv_include_dir %{_includedir}/luajit-%{luajit_version} -%global luv_library %{_libdir}/luajit/%{luajit_version}/luv.so %else %global lua_version 5.1 %global lua_prg %{_bindir}/lua-5.1 - -%global luv_include_dir %{_includedir}/lua-%{lua_version} -%global luv_library %{_libdir}/lua/%{lua_version}/luv.so %endif Name: neovim Version: 0.9.1 -Release: 1%{?dist} +Release: 2%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -59,18 +54,17 @@ BuildRequires: fdupes BuildRequires: gettext BuildRequires: gperf BuildRequires: gcc +BuildRequires: libluv-devel >= %{luv_min_ver} %if %{with luajit} # luajit implements version 5.1 of the lua language spec, so it needs the # compat versions of libs. BuildRequires: luajit-devel -BuildRequires: luajit2.1-luv-devel >= %{luv_min_ver} Requires: luajit2.1-luv >= %{luv_min_ver} %else # lua5.1 BuildRequires: compat-lua BuildRequires: compat-lua-devel BuildRequires: lua5.1-bit32 -BuildRequires: lua5.1-luv-devel >= %{luv_min_ver} Requires: lua5.1-luv >= %{luv_min_ver} # /with luajit %endif @@ -124,7 +118,6 @@ USERNAME=koji -DLUA_PRG=%{lua_prg} \ -DENABLE_JEMALLOC=%{?with_jemalloc:ON}%{!?with_jemalloc:OFF} \ -DLIBLUV_INCLUDE_DIR:PATH=%{luv_include_dir} \ - -DLIBLUV_LIBRARY:STRING=-Wl,%{luv_library} %cmake_build @@ -1952,6 +1945,9 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Tue Jun 06 2023 Andreas Schneider - 0.9.1-2 +- Build with new libluv-devel + * Wed May 31 2023 Andreas Schneider - 0.9.1-1 - Update to version 0.9.1 * For changelog see `:help news` From 46e9b7004db88db9fceb54c9de1b447b2436988b Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Mon, 28 Aug 2023 20:14:02 +0200 Subject: [PATCH 14/17] Improve spec template * %autorelease must not have {}, otherwise "Dist tag is present." error is triggered in fedora-review, see: https://pagure.io/FedoraReview/blob/d037481/f/plugins/generic.py#_425 * Also remove {} from %autochangelog while at it. --- neovim.spec | 5 ++++- spec-template | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/neovim.spec b/neovim.spec index 10605f3..f23397f 100644 --- a/neovim.spec +++ b/neovim.spec @@ -35,7 +35,7 @@ Name: neovim Version: 0.9.1 -Release: 2%{?dist} +Release: 3%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -1945,6 +1945,9 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Mon Aug 28 2023 LuK1337 - 0.9.1-3 +- Improve spec template + * Tue Jun 06 2023 Andreas Schneider - 0.9.1-2 - Build with new libluv-devel diff --git a/spec-template b/spec-template index 30e6437..cc35793 100644 --- a/spec-template +++ b/spec-template @@ -1,6 +1,6 @@ Name: Version: -Release: %{autorelease} +Release: %autorelease Summary: License: @@ -35,4 +35,4 @@ Requires: %changelog -%{autochangelog} +%autochangelog From 8668960b23b448c0ae2545cf822c9eb82a2b5833 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 7 Sep 2023 16:08:13 +0200 Subject: [PATCH 15/17] Update to version 0.9.2 --- .gitignore | 1 + neovim.spec | 8 ++++++-- sources | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 71033ba..94c3c15 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ /neovim-0.8.3.tar.gz /neovim-0.9.0.tar.gz /neovim-0.9.1.tar.gz +/neovim-0.9.2.tar.gz diff --git a/neovim.spec b/neovim.spec index f23397f..032480d 100644 --- a/neovim.spec +++ b/neovim.spec @@ -34,8 +34,8 @@ %endif Name: neovim -Version: 0.9.1 -Release: 3%{?dist} +Version: 0.9.2 +Release: 1%{?dist} License: Apache-2.0 AND Vim Summary: Vim-fork focused on extensibility and agility @@ -1945,6 +1945,10 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Thu Sep 07 2023 Andreas Schneider - 0.9.2-1 +- Update to version 0.9.2 + * For changelog see `:help news` + * Mon Aug 28 2023 LuK1337 - 0.9.1-3 - Improve spec template diff --git a/sources b/sources index 88c3b1a..14be258 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (neovim-0.9.1.tar.gz) = 339efd3d8c1a73aa3b43e8770d6943aeba9e4ce6a3598c0424e388f80759d50b14aa7c60fd435bf2d17997476e06d28b79e7e98670d02ca9ceec031841e8b9b8 +SHA512 (neovim-0.9.2.tar.gz) = f12ae48c82c4a3622e464a23966cb06e9da1a7cd000b4efeb8408bb55e189ffeb4ece99e9488244c16f7de70356303e4dc964afd70ab24d23a5e07c59e902ed9 From de0852ece2715a67fb4e2d53b8656b7aff1888c9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 20 Oct 2023 15:49:13 +0200 Subject: [PATCH 16/17] Update to version 0.9.4 --- .gitignore | 1 + neovim-fix-cmake-find-libluv.patch | 15 +++++++++++++++ neovim.spec | 16 +++++++++++++--- sources | 2 +- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 neovim-fix-cmake-find-libluv.patch diff --git a/.gitignore b/.gitignore index 94c3c15..ec5f1b4 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ /neovim-0.9.0.tar.gz /neovim-0.9.1.tar.gz /neovim-0.9.2.tar.gz +/neovim-0.9.4.tar.gz diff --git a/neovim-fix-cmake-find-libluv.patch b/neovim-fix-cmake-find-libluv.patch new file mode 100644 index 0000000..36cfd1d --- /dev/null +++ b/neovim-fix-cmake-find-libluv.patch @@ -0,0 +1,15 @@ +Index: neovim-0.9.4/src/nvim/CMakeLists.txt +=================================================================== +--- neovim-0.9.4.orig/src/nvim/CMakeLists.txt 2023-10-09 22:38:17.000000000 +0200 ++++ neovim-0.9.4/src/nvim/CMakeLists.txt 2023-10-20 22:49:27.287874311 +0200 +@@ -3,8 +3,8 @@ add_executable(nvim main.c) + + add_library(libuv INTERFACE) + find_package(libuv CONFIG) +-if(TARGET libuv::uv_a) +- target_link_libraries(libuv INTERFACE libuv::uv_a) ++if(TARGET libuv::uv) ++ target_link_libraries(libuv INTERFACE libuv::uv) + mark_as_advanced(libuv_DIR) + else() + # Fall back to find module for older libuv versions that don't provide config file diff --git a/neovim.spec b/neovim.spec index 032480d..29ced97 100644 --- a/neovim.spec +++ b/neovim.spec @@ -34,7 +34,7 @@ %endif Name: neovim -Version: 0.9.2 +Version: 0.9.4 Release: 1%{?dist} License: Apache-2.0 AND Vim @@ -45,6 +45,8 @@ Source0: https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{v Source1: sysinit.vim Source2: spec-template +Patch0: neovim-fix-cmake-find-libluv.patch + Patch1000: neovim-lua-bit32.patch BuildRequires: gcc-c++ @@ -69,7 +71,7 @@ Requires: lua5.1-luv >= %{luv_min_ver} # /with luajit %endif BuildRequires: lua5.1-lpeg -BuildRequires: lua5.1-mpack +BuildRequires: lua5.1-mpack >= 1.0.11 %if %{with jemalloc} BuildRequires: jemalloc-devel %endif @@ -105,6 +107,7 @@ parts of Vim, without compromise, and more. %prep %setup -q +%patch -P 0 -p1 %if %{without luajit} %patch -P 1000 -p1 %endif @@ -562,6 +565,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/ftplugin/css.vim %{_datadir}/nvim/runtime/ftplugin/cucumber.vim %{_datadir}/nvim/runtime/ftplugin/cvsrc.vim +%{_datadir}/nvim/runtime/ftplugin/d.lua %{_datadir}/nvim/runtime/ftplugin/debchangelog.vim %{_datadir}/nvim/runtime/ftplugin/debcontrol.vim %{_datadir}/nvim/runtime/ftplugin/denyhosts.vim @@ -1087,7 +1091,7 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/lua/vim/_editor.lua %{_datadir}/nvim/runtime/lua/vim/_init_packages.lua %{_datadir}/nvim/runtime/lua/vim/_inspector.lua -%{_datadir}/nvim/runtime/lua/vim/_meta.lua +%{_datadir}/nvim/runtime/lua/vim/_options.lua %{_datadir}/nvim/runtime/lua/vim/_watch.lua %{_datadir}/nvim/runtime/lua/vim/diagnostic.lua %{_datadir}/nvim/runtime/lua/vim/filetype.lua @@ -1945,6 +1949,12 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Fri Oct 20 2023 Andreas Schneider - 0.9.4-1 +- Update to version 0.9.4 + * https://github.com/neovim/neovim/releases/tag/v0.9.4 + * For bigger version bump changelog see `:help news` + * resolves: rhbz#2243010 + * Thu Sep 07 2023 Andreas Schneider - 0.9.2-1 - Update to version 0.9.2 * For changelog see `:help news` diff --git a/sources b/sources index 14be258..f9fad0d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (neovim-0.9.2.tar.gz) = f12ae48c82c4a3622e464a23966cb06e9da1a7cd000b4efeb8408bb55e189ffeb4ece99e9488244c16f7de70356303e4dc964afd70ab24d23a5e07c59e902ed9 +SHA512 (neovim-0.9.4.tar.gz) = a9bac18aeecd99dfeab79b367c3f0c46003b95d057edb6fd18ba178d6b6f22434689508d0bfe91b2f771ef0a23a4888815e8c4001abb76f2a60357bab0cd7004 From ab66bc678c35b7adab909d7134a58ccd197e6659 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 2 Jan 2024 09:05:04 +0100 Subject: [PATCH 17/17] Update to version 0.9.5 resolves: rhbz#2256278 --- .gitignore | 6 ++++++ neovim.spec | 8 +++++++- sources | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ec5f1b4..88a99c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +/*.log +/*.rpm +/series +/x86_64/ +/results_neovim/ /neovim-0.1.7.tar.gz /neovim-0.2.0.tar.gz /neovim-0.2.1.tar.gz @@ -28,3 +33,4 @@ /neovim-0.9.1.tar.gz /neovim-0.9.2.tar.gz /neovim-0.9.4.tar.gz +/neovim-0.9.5.tar.gz diff --git a/neovim.spec b/neovim.spec index 29ced97..ef78a3c 100644 --- a/neovim.spec +++ b/neovim.spec @@ -34,7 +34,7 @@ %endif Name: neovim -Version: 0.9.4 +Version: 0.9.5 Release: 1%{?dist} License: Apache-2.0 AND Vim @@ -1949,6 +1949,12 @@ find %{buildroot}%{_datadir} \( -name "*.bat" -o -name "*.awk" \) \ %{_datadir}/nvim/runtime/tutor/en/vim-01-beginner.tutor.json %changelog +* Tue Jan 02 2024 Andreas Schneider - 0.9.5-1 +- Update to version 0.9.5 + * https://github.com/neovim/neovim/releases/tag/v0.9.5 + * For bigger version bump changelog see `:help news` + * resolves: rhbz#2256278 + * Fri Oct 20 2023 Andreas Schneider - 0.9.4-1 - Update to version 0.9.4 * https://github.com/neovim/neovim/releases/tag/v0.9.4 diff --git a/sources b/sources index f9fad0d..2846255 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (neovim-0.9.4.tar.gz) = a9bac18aeecd99dfeab79b367c3f0c46003b95d057edb6fd18ba178d6b6f22434689508d0bfe91b2f771ef0a23a4888815e8c4001abb76f2a60357bab0cd7004 +SHA512 (neovim-0.9.5.tar.gz) = 6e20d0a1d506dc292dd68dabe4b5635f86c019ca832f9927e907377e6d21fe7765b3010f5bba644bb2d7a76c178d55b290af24856a7e3c4083a1aa60bc496775