From dbe39edb29cf5f899d475ee783a059cb6f678286 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 4 Jan 2025 17:12:24 +0100 Subject: [PATCH 01/28] patch 9.1.0989: Vim9: Whitespace after the final enum value causes a syntax error Problem: Vim9: Whitespace after the final enum value causes a syntax error Solution: Fix parsing to allow whitespace after the final enum value. (Doug Kearns) closes: #16383 Signed-off-by: Doug Kearns Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_codestyle.vim | 1 + src/testdir/test_vim9_enum.vim | 35 ++++++++++++++++++++++++++++++++++ src/version.c | 2 ++ src/vim9class.c | 2 ++ 4 files changed, 40 insertions(+) diff --git a/src/testdir/test_codestyle.vim b/src/testdir/test_codestyle.vim index 83f52ef34cd60..51c1209d4ff32 100644 --- a/src/testdir/test_codestyle.vim +++ b/src/testdir/test_codestyle.vim @@ -85,6 +85,7 @@ def Test_test_files() && fname !~ 'test_let.vim' && fname !~ 'test_tagjump.vim' && fname !~ 'test_vim9_cmd.vim' + && fname !~ 'test_vim9_enum.vim' cursor(1, 1) var lnum = search( fname =~ 'test_vim9_assign.vim' ? '[^=]\s$' diff --git a/src/testdir/test_vim9_enum.vim b/src/testdir/test_vim9_enum.vim index a5fb26fcf3938..74eb468805bcf 100644 --- a/src/testdir/test_vim9_enum.vim +++ b/src/testdir/test_vim9_enum.vim @@ -908,6 +908,18 @@ def Test_enum_comments() END v9.CheckSourceSuccess(lines) + lines =<< trim END + vim9script + enum Car # cars + # before enum + Honda(), # honda + # before enum + Ford() # ford + endenum + assert_equal(1, Car.Ford.ordinal) + END + v9.CheckSourceSuccess(lines) + # Test for using an unsupported comment lines =<< trim END vim9script @@ -921,6 +933,29 @@ def Test_enum_comments() v9.CheckSourceFailure(lines, 'E1170: Cannot use #{ to start a comment', 4) enddef +" Test trailing whitespace after enum values +def Test_enum_whitespace() + var lines =<< trim END + vim9script + enum Car + Honda, + Ford + endenum + defcompile + END + v9.CheckSourceSuccess(lines) + + lines =<< trim END + vim9script + enum Car + Honda(), + Ford() + endenum + defcompile + END + v9.CheckSourceSuccess(lines) +enddef + " Test string() with enums def Test_enum_string() var lines =<< trim END diff --git a/src/version.c b/src/version.c index 987aa9b3f23e2..99f41030ff078 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 989, /**/ 988, /**/ diff --git a/src/vim9class.c b/src/vim9class.c index 22db751e5a266..7c7700ba19bd4 100644 --- a/src/vim9class.c +++ b/src/vim9class.c @@ -1623,6 +1623,8 @@ enum_parse_values( } } + p = skipwhite(p); + if (*p != NUL && *p != '#') { if (did_emsg == did_emsg_before) From e15cbc1af47e9dea90448c714eb4908e5d4302fc Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sat, 4 Jan 2025 17:18:08 +0100 Subject: [PATCH 02/28] patch 9.1.0990: Inconsistent behavior when changing cmdheight Problem: Inconsistent behavior when changing cmdheight by resizing the topframe through wincmds and dragging laststatus. Changing cmdheight by resizing the topframe does not trigger OptionSet. Solution: Consolidate logic for changing the cmdheight, set the option value to handle side-effects (Luuk van Baal) closes: #16359 Signed-off-by: Luuk van Baal Signed-off-by: Christian Brabandt --- .../dumps/Test_changing_cmdheight_1.dump | 2 +- .../dumps/Test_changing_cmdheight_2.dump | 4 +- src/testdir/test_autocmd.vim | 24 ++ src/testdir/test_cmdline.vim | 7 +- src/version.c | 2 + src/window.c | 207 +++++++----------- 6 files changed, 115 insertions(+), 131 deletions(-) diff --git a/src/testdir/dumps/Test_changing_cmdheight_1.dump b/src/testdir/dumps/Test_changing_cmdheight_1.dump index db6d41110f8ad..127fe26f04360 100644 --- a/src/testdir/dumps/Test_changing_cmdheight_1.dump +++ b/src/testdir/dumps/Test_changing_cmdheight_1.dump @@ -5,4 +5,4 @@ | +0&&@74 @75 @75 -|:|r|e|s|i|z|e| |-|3| @64 +@75 diff --git a/src/testdir/dumps/Test_changing_cmdheight_2.dump b/src/testdir/dumps/Test_changing_cmdheight_2.dump index 76d944040da0f..d652cc63102f6 100644 --- a/src/testdir/dumps/Test_changing_cmdheight_2.dump +++ b/src/testdir/dumps/Test_changing_cmdheight_2.dump @@ -1,8 +1,8 @@ > +0&#ffffff0@74 |~+0#4040ff13&| @73 -|~| @73 |[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 -|:+0&&|s|e|t| |c|m|d|h|e|i|g|h|t|+|=|3| @57 +| +0&&@74 +@75 @75 @75 @75 diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index d6f8ef4ceead7..5868f1c037d0d 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -4902,4 +4902,28 @@ func Test_autocmd_BufWinLeave_with_vsp() exe "bw! " .. dummy endfunc +func Test_OptionSet_cmdheight() + set mouse=a laststatus=2 + au OptionSet cmdheight :let &l:ch = v:option_new + + resize -1 + call assert_equal(2, &l:ch) + resize +1 + call assert_equal(1, &l:ch) + + call test_setmouse(&lines - 1, 1) + call feedkeys("\", 'xt') + call test_setmouse(&lines - 2, 1) + call feedkeys("\", 'xt') + call assert_equal(2, &l:ch) + + tabnew | resize +1 + call assert_equal(1, &l:ch) + tabfirst + call assert_equal(2, &l:ch) + + tabonly + set cmdheight& mouse& laststatus& +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 6d4fdd781167f..2b81dc05a9cdf 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -290,9 +290,10 @@ func Test_changing_cmdheight() call term_sendkeys(buf, ":resize -3\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_1', {}) - " using the space available doesn't change the status line - call term_sendkeys(buf, ":set cmdheight+=3\") + " :resize now also changes 'cmdheight' accordingly + call term_sendkeys(buf, ":set cmdheight+=1\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_2', {}) + call term_sendkeys(buf, ":set cmdheight-=1\") " using more space moves the status line up call term_sendkeys(buf, ":set cmdheight+=1\") @@ -311,7 +312,7 @@ func Test_changing_cmdheight() call term_sendkeys(buf, ":call EchoTwo()\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {}) - " increasing 'cmdheight' doesn't clear the messages that need hit-enter + " decreasing 'cmdheight' doesn't clear the messages that need hit-enter call term_sendkeys(buf, ":call EchoOne()\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_7', {}) diff --git a/src/version.c b/src/version.c index 99f41030ff078..b42c2fc260179 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 990, /**/ 989, /**/ diff --git a/src/window.c b/src/window.c index af29a698d36d9..93b0a327d6494 100644 --- a/src/window.c +++ b/src/window.c @@ -27,7 +27,7 @@ static win_T *frame2win(frame_T *frp); static int frame_has_win(frame_T *frp, win_T *wp); static void win_fix_scroll(int resize); static void win_fix_cursor(int normal); -static void frame_new_height(frame_T *topfrp, int height, int topfirst, int wfh); +static void frame_new_height(frame_T *topfrp, int height, int topfirst, int wfh, int set_ch); static int frame_fixed_height(frame_T *frp); static int frame_fixed_width(frame_T *frp); static void frame_add_statusline(frame_T *frp); @@ -1404,13 +1404,14 @@ win_split_ins( if (flags & (WSP_TOP | WSP_BOT)) { int new_fr_height = curfrp->fr_height - new_size - + WINBAR_HEIGHT(wp) ; + + WINBAR_HEIGHT(wp); if (!((flags & WSP_BOT) && p_ls == 0)) new_fr_height -= STATUS_HEIGHT; if (flags & WSP_BOT) frame_add_statusline(curfrp); - frame_new_height(curfrp, new_fr_height, flags & WSP_TOP, FALSE); + frame_new_height(curfrp, new_fr_height, flags & WSP_TOP, FALSE, + FALSE); } else win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT)); @@ -2126,7 +2127,7 @@ win_equal_rec( ) { topfr->fr_win->w_winrow = row; - frame_new_height(topfr, height, FALSE, FALSE); + frame_new_height(topfr, height, FALSE, FALSE, FALSE); topfr->fr_win->w_wincol = col; frame_new_width(topfr, width, FALSE, FALSE); redraw_all_later(UPD_NOT_VALID); @@ -3551,7 +3552,7 @@ winframe_remove( } } frame_new_height(frp2, frp2->fr_height + frp_close->fr_height, - frp2 == frp_close->fr_next, FALSE); + frp2 == frp_close->fr_next, FALSE, FALSE); *dirp = 'v'; } else @@ -3691,7 +3692,7 @@ winframe_restore(win_T *wp, int dir, frame_T *unflat_altfr) if (dir == 'v') { frame_new_height(unflat_altfr, unflat_altfr->fr_height - frp->fr_height, - unflat_altfr == frp->fr_next, FALSE); + unflat_altfr == frp->fr_next, FALSE, FALSE); } else if (dir == 'h') { @@ -3840,13 +3841,22 @@ frame_new_height( frame_T *topfrp, int height, int topfirst, // resize topmost contained frame first - int wfh) // obey 'winfixheight' when there is a choice; + int wfh, // obey 'winfixheight' when there is a choice; // may cause the height not to be set + int set_ch) // set 'cmdheight' to resize topframe { frame_T *frp; int extra_lines; int h; + if (topfrp->fr_parent == NULL && set_ch) + { + // topframe: update the command line height, with side effects. + int new_ch = MAX(1, p_ch + topfrp->fr_height - height); + if (new_ch != p_ch) + set_option_value((char_u *)"cmdheight", new_ch, NULL, 0); + height = MIN(height, ROWS_AVAIL); + } if (topfrp->fr_win != NULL) { // Simple case: just one window. @@ -3861,7 +3871,7 @@ frame_new_height( // All frames in this row get the same new height. FOR_ALL_FRAMES(frp, topfrp->fr_child) { - frame_new_height(frp, height, topfirst, wfh); + frame_new_height(frp, height, topfirst, wfh, set_ch); if (frp->fr_height > height) { // Could not fit the windows, make the whole row higher. @@ -3907,12 +3917,12 @@ frame_new_height( if (frp->fr_height + extra_lines < h) { extra_lines += frp->fr_height - h; - frame_new_height(frp, h, topfirst, wfh); + frame_new_height(frp, h, topfirst, wfh, set_ch); } else { frame_new_height(frp, frp->fr_height + extra_lines, - topfirst, wfh); + topfirst, wfh, set_ch); break; } if (topfirst) @@ -3935,7 +3945,8 @@ frame_new_height( else if (extra_lines > 0) { // increase height of bottom or top frame - frame_new_height(frp, frp->fr_height + extra_lines, topfirst, wfh); + frame_new_height(frp, frp->fr_height + extra_lines, topfirst, wfh, + set_ch); } } topfrp->fr_height = height; @@ -4381,6 +4392,10 @@ unuse_tabpage(tabpage_T *tp) tp->tp_curwin = curwin; } +// When switching tabpage, handle other side-effects in command_height(), but +// avoid setting frame sizes which are still correct. +static int command_frame_height = TRUE; + /* * Set the relevant pointers to use tab page "tp". May want to call * unuse_tabpage() first. @@ -4915,13 +4930,23 @@ enter_tabpage( int trigger_enter_autocmds, int trigger_leave_autocmds) { - int row; int old_off = tp->tp_firstwin->w_winrow; win_T *next_prevwin = tp->tp_prevwin; tabpage_T *last_tab = curtab; use_tabpage(tp); + if (p_ch != curtab->tp_ch_used) + { + // Use the stored value of p_ch, so that it can be different for each + // tab page. + int new_ch = curtab->tp_ch_used; + curtab->tp_ch_used = p_ch; + command_frame_height = FALSE; + set_option_value((char_u *)"cmdheight", new_ch, NULL, 0); + command_frame_height = TRUE; + } + // We would like doing the TabEnter event first, but we don't have a // valid current window yet, which may break some commands. // This triggers autocommands, thus may make "tp" invalid. @@ -4931,23 +4956,11 @@ enter_tabpage( prevwin = next_prevwin; last_status(FALSE); // status line may appear or disappear - row = win_comp_pos(); // recompute w_winrow for all windows + win_comp_pos(); // recompute w_winrow for all windows #ifdef FEAT_DIFF diff_need_scrollbind = TRUE; #endif - // Use the stored value of p_ch, so that it can be different for each tab - // page. - if (p_ch != curtab->tp_ch_used) - clear_cmdline = TRUE; - p_ch = curtab->tp_ch_used; - - // When cmdheight is changed in a tab page with '-', cmdline_row is - // changed but p_ch and tp_ch_used are not changed. Thus we also need to - // check cmdline_row. - if (row < cmdline_row && cmdline_row <= Rows - p_ch) - clear_cmdline = TRUE; - // If there was a click in a window, it won't be usable for a following // drag. reset_dragwin(); @@ -6091,9 +6104,9 @@ shell_new_rows(void) // First try setting the heights of windows with 'winfixheight'. If // that doesn't result in the right height, forget about that option. - frame_new_height(topframe, h, FALSE, TRUE); + frame_new_height(topframe, h, FALSE, TRUE, FALSE); if (!frame_check_height(topframe, h)) - frame_new_height(topframe, h, FALSE, FALSE); + frame_new_height(topframe, h, FALSE, FALSE, FALSE); (void)win_comp_pos(); // recompute w_winrow and w_wincol compute_cmdrow(); @@ -6275,8 +6288,6 @@ win_setheight(int height) void win_setheight_win(int height, win_T *win) { - int row; - if (win == curwin) { // Always keep current window at least one line high, even when @@ -6291,18 +6302,7 @@ win_setheight_win(int height, win_T *win) frame_setheight(win->w_frame, height + win->w_status_height); // recompute the window positions - row = win_comp_pos(); - - /* - * If there is extra space created between the last window and the command - * line, clear it. - */ - if (full_screen && msg_scrolled == 0 && row < cmdline_row) - screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ', 0); - cmdline_row = row; - msg_row = row; - msg_col = 0; - + win_comp_pos(); win_fix_scroll(TRUE); redraw_all_later(UPD_NOT_VALID); @@ -6339,10 +6339,8 @@ frame_setheight(frame_T *curfrp, int height) if (curfrp->fr_parent == NULL) { // topframe: can only change the command line height - if (height > ROWS_AVAIL) - height = ROWS_AVAIL; if (height > 0) - frame_new_height(curfrp, height, FALSE, FALSE); + frame_new_height(curfrp, height, FALSE, FALSE, TRUE); } else if (curfrp->fr_parent->fr_layout == FR_ROW) { @@ -6428,7 +6426,7 @@ frame_setheight(frame_T *curfrp, int height) /* * set the current frame to the new height */ - frame_new_height(curfrp, height, FALSE, FALSE); + frame_new_height(curfrp, height, FALSE, FALSE, TRUE); /* * First take lines from the frames after the current frame. If @@ -6455,7 +6453,8 @@ frame_setheight(frame_T *curfrp, int height) if (frp->fr_height - room_reserved > take) room_reserved = frp->fr_height - take; take -= frp->fr_height - room_reserved; - frame_new_height(frp, room_reserved, FALSE, FALSE); + frame_new_height(frp, room_reserved, FALSE, FALSE, + TRUE); room_reserved = 0; } } @@ -6464,12 +6463,12 @@ frame_setheight(frame_T *curfrp, int height) if (frp->fr_height - take < h) { take -= frp->fr_height - h; - frame_new_height(frp, h, FALSE, FALSE); + frame_new_height(frp, h, FALSE, FALSE, TRUE); } else { frame_new_height(frp, frp->fr_height - take, - FALSE, FALSE); + FALSE, FALSE, TRUE); take = 0; } } @@ -6718,7 +6717,6 @@ win_drag_status_line(win_T *dragwin, int offset) frame_T *curfr; frame_T *fr; int room; - int row; int up; // if TRUE, drag status line up, otherwise down int n; @@ -6799,7 +6797,7 @@ win_drag_status_line(win_T *dragwin, int offset) * Doesn't happen when dragging the last status line up. */ if (fr != NULL) - frame_new_height(fr, fr->fr_height + offset, up, FALSE); + frame_new_height(fr, fr->fr_height + offset, up, FALSE, TRUE); if (up) fr = curfr; // current frame gets smaller @@ -6815,11 +6813,11 @@ win_drag_status_line(win_T *dragwin, int offset) if (fr->fr_height - offset <= n) { offset -= fr->fr_height - n; - frame_new_height(fr, n, !up, FALSE); + frame_new_height(fr, n, !up, FALSE, TRUE); } else { - frame_new_height(fr, fr->fr_height - offset, !up, FALSE); + frame_new_height(fr, fr->fr_height - offset, !up, FALSE, TRUE); break; } if (up) @@ -6827,12 +6825,7 @@ win_drag_status_line(win_T *dragwin, int offset) else fr = fr->fr_next; } - row = win_comp_pos(); - screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ', 0); - cmdline_row = row; - p_ch = MAX(Rows - cmdline_row, MIN_CMDHEIGHT); - curtab->tp_ch_used = p_ch; - + win_comp_pos(); win_fix_scroll(TRUE); redraw_all_later(UPD_SOME_VALID); @@ -7287,31 +7280,10 @@ win_comp_scroll(win_T *wp) void command_height(void) { - int h; - frame_T *frp; int old_p_ch = curtab->tp_ch_used; - // Use the value of p_ch that we remembered. This is needed for when the - // GUI starts up, we can't be sure in what order things happen. And when - // p_ch was changed in another tab page. - curtab->tp_ch_used = p_ch; - - // If the space for the command line is already more than 'cmdheight' there - // is nothing to do (window size must have decreased). - // Note: this makes curtab->tp_ch_used unreliable - if (p_ch > old_p_ch && cmdline_row <= Rows - p_ch) - return; - - // Update cmdline_row to what it should be: just below the last window. - cmdline_row = topframe->fr_height + tabline_height(); - - // old_p_ch may be unreliable, because of the early return above, so - // set old_p_ch to what it would be, so that the windows get resized - // properly for the new value. - old_p_ch = Rows - cmdline_row; - // Find bottom frame with width of screen. - frp = lastwin->w_frame; + frame_T *frp = lastwin->w_frame; while (frp->fr_width != Columns && frp->fr_parent != NULL) frp = frp->fr_parent; @@ -7320,54 +7292,39 @@ command_height(void) && frp->fr_win->w_p_wfh) frp = frp->fr_prev; - if (starting != NO_SCREEN) + while (p_ch > old_p_ch && command_frame_height) { - cmdline_row = Rows - p_ch; - - if (p_ch > old_p_ch) // p_ch got bigger + if (frp == NULL) { - while (p_ch > old_p_ch) - { - if (frp == NULL) - { - emsg(_(e_not_enough_room)); - p_ch = old_p_ch; - curtab->tp_ch_used = p_ch; - cmdline_row = Rows - p_ch; - break; - } - h = frp->fr_height - frame_minheight(frp, NULL); - if (h > p_ch - old_p_ch) - h = p_ch - old_p_ch; - old_p_ch += h; - frame_add_height(frp, -h); - frp = frp->fr_prev; - } - - // Recompute window positions. - (void)win_comp_pos(); - - if (!need_wait_return) - { - // clear the lines added to cmdline - if (full_screen) - screen_fill(cmdline_row, (int)Rows, 0, - (int)Columns, ' ', ' ', 0); - msg_row = cmdline_row; - } - redraw_cmdline = TRUE; - return; + emsg(_(e_not_enough_room)); + p_ch = old_p_ch; + break; } - - if (msg_row < cmdline_row) - msg_row = cmdline_row; - redraw_cmdline = TRUE; + int h = MIN(p_ch - old_p_ch, + frp->fr_height - frame_minheight(frp, NULL)); + frame_add_height(frp, -h); + old_p_ch += h; + frp = frp->fr_prev; } - frame_add_height(frp, (int)(old_p_ch - p_ch)); + if (p_ch < old_p_ch && command_frame_height) + frame_add_height(frp, (int)(old_p_ch - p_ch)); // Recompute window positions. - if (frp != lastwin->w_frame) - (void)win_comp_pos(); + win_comp_pos(); + cmdline_row = Rows - p_ch; + redraw_cmdline = TRUE; + + // Clear the cmdheight area. + if (msg_scrolled == 0 && full_screen) + { + screen_fill(cmdline_row, (int)Rows, 0, (int)Columns, ' ', ' ', 0); + msg_row = cmdline_row; + } + + // Use the value of p_ch that we remembered. This is needed for when the + // GUI starts up, we can't be sure in what order things happen. And when + // p_ch was changed in another tab page. + curtab->tp_ch_used = p_ch; } /* @@ -7377,7 +7334,7 @@ command_height(void) static void frame_add_height(frame_T *frp, int n) { - frame_new_height(frp, frp->fr_height + n, FALSE, FALSE); + frame_new_height(frp, frp->fr_height + n, FALSE, FALSE, FALSE); for (;;) { frp = frp->fr_parent; @@ -7436,7 +7393,7 @@ last_status_rec(frame_T *fr, int statusline) wp->w_status_height = 1; if (fp != fr) { - frame_new_height(fp, fp->fr_height - 1, FALSE, FALSE); + frame_new_height(fp, fp->fr_height - 1, FALSE, FALSE, FALSE); frame_fix_height(wp); (void)win_comp_pos(); } @@ -7819,7 +7776,7 @@ restore_snapshot_rec(frame_T *sn, frame_T *fr) fr->fr_width = sn->fr_width; if (fr->fr_layout == FR_LEAF) { - frame_new_height(fr, fr->fr_height, FALSE, FALSE); + frame_new_height(fr, fr->fr_height, FALSE, FALSE, FALSE); frame_new_width(fr, fr->fr_width, FALSE, FALSE); wp = sn->fr_win; } From 8a27d9784805ad15a5d832917410b4e70039e7d2 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 5 Jan 2025 15:56:57 +0100 Subject: [PATCH 03/28] runtime(doc): Capitalise the mnemonic "Zero" for the 'z' flag of search() closes: #16384 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/doc/builtin.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index d7ed7320f3510..1b39b1b59ea36 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 02 +*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -9038,7 +9038,7 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]]) 's' Set the ' mark at the previous location of the cursor 'w' Wrap around the end of the file 'W' don't Wrap around the end of the file - 'z' start searching at the cursor column instead of zero + 'z' start searching at the cursor column instead of Zero If neither 'w' or 'W' is given, the 'wrapscan' option applies. If the 's' flag is supplied, the ' mark is set, only if the From 202ebc6ced6c5d7c0cdd9a79867af14aab39f75d Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 5 Jan 2025 16:36:10 +0100 Subject: [PATCH 04/28] runtime(zsh): sync syntax script with upstream repo fixes: #16371 Signed-off-by: Christian Brabandt --- runtime/syntax/zsh.vim | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim index 084f8cdb41d47..04b39aeac075f 100644 --- a/runtime/syntax/zsh.vim +++ b/runtime/syntax/zsh.vim @@ -2,7 +2,7 @@ " Language: Zsh shell script " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2022-07-26 +" Latest Revision: 2024 Jan 04 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh @@ -48,8 +48,9 @@ syn match zshPOSIXQuoted '\\u[0-9a-fA-F]\{1,4}' syn match zshPOSIXQuoted '\\U[1-9a-fA-F]\{1,8}' syn region zshString matchgroup=zshStringDelimiter start=+"+ end=+"+ - \ contains=zshQuoted,@zshDerefs,@zshSubstQuoted fold + \ contains=@Spell,zshQuoted,@zshDerefs,@zshSubstQuoted fold syn region zshString matchgroup=zshStringDelimiter start=+'+ end=+'+ fold + \ contains=@Spell syn region zshPOSIXString matchgroup=zshStringDelimiter start=+\$'+ \ skip=+\\[\\']+ end=+'+ contains=zshPOSIXQuoted,zshQuoted syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)' @@ -68,7 +69,7 @@ syn keyword zshConditional if then elif else fi esac select syn keyword zshCase case nextgroup=zshCaseWord skipwhite syn match zshCaseWord /\S\+/ nextgroup=zshCaseIn skipwhite contained transparent -syn keyword zshCaseIn in nextgroup=zshCasePattern skipwhite skipnl contained +syn keyword zshCaseIn in nextgroup=zshComment,zshCasePattern skipwhite skipnl contained syn match zshCasePattern /\S[^)]*)/ contained syn keyword zshRepeat while until repeat @@ -94,22 +95,24 @@ syn match zshRedir '|\@1' - \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString + \ end='^\z1$' + \ contains=@Spell,@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString syn region zshHereDoc matchgroup=zshRedir \ start='<\@' - \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString + \ end='^\z1$' + \ contains=@Spell syn region zshHereDoc matchgroup=zshRedir \ start='<\@' - \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString + \ end='^\t*\z1$' + \ contains=@Spell syn region zshHereDoc matchgroup=zshRedir \ start=+<\@' + \ end='^\z1$' + \ contains=@Spell syn region zshHereDoc matchgroup=zshRedir \ start=+<\@' + \ end='^\t*\z1$' + \ contains=@Spell syn match zshVariable '\<\h\w*' contained From 7ceaa8f3ddbaad75fa02f91c0b354661b38253cb Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 6 Jan 2025 18:12:11 +0100 Subject: [PATCH 05/28] runtime(vim): Remove trailing comma from match_words fixes: #16377 (`filetype plugin indent on` breaks matchit). closes: #16389 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/ftplugin/vim.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index d960da801e3c0..2c883a537a420 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Vim " Maintainer: Doug Kearns -" Last Change: 2025 Jan 3 +" Last Change: 2025 Jan 06 " Former Maintainer: Bram Moolenaar " Contributors: Riley Bruins ('commentstring') @@ -109,7 +109,7 @@ if exists("loaded_matchit") \ '\\)\@!\S:\,' .. \ '\:\,' .. \ '\:\,' .. - \ '\:\,' + \ '\:\' " Ignore syntax region commands and settings, any 'en*' would clobber " if-endif. From cf1f55548d1c8782c5bd11f82354d98fb30cde42 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Mon, 6 Jan 2025 18:27:38 +0100 Subject: [PATCH 06/28] runtime(sh): add PS0 to bashSpecialVariables in syntax script PS0 is also a special prompt variable. (It is expanded and displayed after it reads a command but before executing it.) References: https://www.gnu.org/software/bash/manual/html_node/Interactive-Shell-Behavior.html closes: #16394 Signed-off-by: Jon Parise Signed-off-by: Christian Brabandt --- runtime/syntax/sh.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 0a8fb47b7de2d..290d4b68c7f07 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -5,6 +5,7 @@ " Lennart Schultz " Last Change: 2024 Mar 04 by Vim Project " 2024 Nov 03 by Aliaksei Budavei <0x000c70 AT gmail DOT com> (improved bracket expressions, #15941) +" 2025 Jan 06 add $0 to bashSpecialVariables (#16394) " Version: 208 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax @@ -404,7 +405,7 @@ syn region shCmdParenRegion matchgroup=shCmdSubRegion start="((\@!" skip='\\\\\| if exists("b:is_bash") syn cluster shCommandSubList add=bashSpecialVariables,bashStatement syn cluster shCaseList add=bashAdminStatement,bashStatement - syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ALIASES BASH_ARGC BASH_ARGC BASH_ARGV BASH_ARGV BASH_CMDS BASH_CMDS BASH_COMMAND BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_EXECUTION_STRING BASH_LINENO BASH_LINENO BASHOPTS BASHOPTS BASHPID BASHPID BASH_REMATCH BASH_REMATCH BASH_SOURCE BASH_SOURCE BASH_SUBSHELL BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD BASH_XTRACEFD CDPATH COLUMNS COLUMNS COMP_CWORD COMP_CWORD COMP_KEY COMP_KEY COMP_LINE COMP_LINE COMP_POINT COMP_POINT COMPREPLY COMPREPLY COMP_TYPE COMP_TYPE COMP_WORDBREAKS COMP_WORDBREAKS COMP_WORDS COMP_WORDS COPROC COPROC DIRSTACK EMACS EMACS ENV ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNAME FUNCNEST FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_NUMERIC LINENO LINES LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT POSIXLY_CORRECT PPID PROMPT_COMMAND PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_LINE READLINE_POINT READLINE_POINT REPLY SECONDS SHELL SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR TMPDIR UID + syn keyword bashSpecialVariables contained auto_resume BASH BASH_ALIASES BASH_ALIASES BASH_ARGC BASH_ARGC BASH_ARGV BASH_ARGV BASH_CMDS BASH_CMDS BASH_COMMAND BASH_COMMAND BASH_ENV BASH_EXECUTION_STRING BASH_EXECUTION_STRING BASH_LINENO BASH_LINENO BASHOPTS BASHOPTS BASHPID BASHPID BASH_REMATCH BASH_REMATCH BASH_SOURCE BASH_SOURCE BASH_SUBSHELL BASH_SUBSHELL BASH_VERSINFO BASH_VERSION BASH_XTRACEFD BASH_XTRACEFD CDPATH COLUMNS COLUMNS COMP_CWORD COMP_CWORD COMP_KEY COMP_KEY COMP_LINE COMP_LINE COMP_POINT COMP_POINT COMPREPLY COMPREPLY COMP_TYPE COMP_TYPE COMP_WORDBREAKS COMP_WORDBREAKS COMP_WORDS COMP_WORDS COPROC COPROC DIRSTACK EMACS EMACS ENV ENV EUID FCEDIT FIGNORE FUNCNAME FUNCNAME FUNCNEST FUNCNEST GLOBIGNORE GROUPS histchars HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HISTTIMEFORMAT HISTTIMEFORMAT HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_CTYPE LC_CTYPE LC_MESSAGES LC_NUMERIC LC_NUMERIC LINENO LINES LINES MACHTYPE MAIL MAILCHECK MAILPATH MAPFILE MAPFILE OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS POSIXLY_CORRECT POSIXLY_CORRECT PPID PROMPT_COMMAND PS0 PS1 PS2 PS3 PS4 PWD RANDOM READLINE_LINE READLINE_LINE READLINE_POINT READLINE_POINT REPLY SECONDS SHELL SHELL SHELLOPTS SHLVL TIMEFORMAT TIMEOUT TMPDIR TMPDIR UID syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep head less ls mkdir mv rm rmdir rpm sed sleep sort strip tail syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop syn keyword bashStatement command compgen From 6655bef33047b826e0ccb8c686f3f57e47161b1c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 6 Jan 2025 18:32:13 +0100 Subject: [PATCH 07/28] patch 9.1.0991: v:stacktrace has wrong type in Vim9 script Problem: v:stacktrace has wrong type in Vim9 script. Solution: Change the type to t_list_dict_any. Fix grammar in docs. (zeertzjq) closes: #16390 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- runtime/doc/builtin.txt | 12 ++++++------ src/evalvars.c | 2 +- src/testdir/test_stacktrace.vim | 31 ++++++++++++++++++++++++++++--- src/version.c | 2 ++ 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 1b39b1b59ea36..a34c63aebc463 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 05 +*builtin.txt* For Vim version 9.1. Last change: 2025 Jan 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5002,12 +5002,12 @@ getstacktrace() *getstacktrace()* Returns the current stack trace of Vim scripts. Stack trace is a |List|, of which each item is a |Dictionary| with the following items: - funcref The funcref if the stack is at the function, - otherwise this item is not exist. + funcref The funcref if the stack is at a function, + otherwise this item is omitted. event The string of the event description if the - stack is at autocmd event, otherwise this item - is not exist. - lnum The line number of the script on the stack. + stack is at an autocmd event, otherwise this + item is omitted. + lnum The line number in the script on the stack. filepath The file path of the script on the stack. Return type: list> diff --git a/src/evalvars.c b/src/evalvars.c index f5fef04adccf4..e0ca4b81d7239 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -161,7 +161,7 @@ static struct vimvar {VV_NAME("t_typealias", VAR_NUMBER), NULL, VV_RO}, {VV_NAME("t_enum", VAR_NUMBER), NULL, VV_RO}, {VV_NAME("t_enumvalue", VAR_NUMBER), NULL, VV_RO}, - {VV_NAME("stacktrace", VAR_LIST), &t_list_string, VV_RO}, + {VV_NAME("stacktrace", VAR_LIST), &t_list_dict_any, VV_RO}, }; // shorthand diff --git a/src/testdir/test_stacktrace.vim b/src/testdir/test_stacktrace.vim index 8cdb6efb513ba..5c71d5023d352 100644 --- a/src/testdir/test_stacktrace.vim +++ b/src/testdir/test_stacktrace.vim @@ -1,5 +1,7 @@ " Test for getstacktrace() and v:stacktrace +import './vim9.vim' as v9 + let s:thisfile = expand('%:p') let s:testdir = s:thisfile->fnamemodify(':h') @@ -34,7 +36,7 @@ func Test_getstacktrace() source Xscript1 call Xfunc1() call AssertStacktrace([ - \ #{funcref: funcref('Test_getstacktrace'), lnum: 35, filepath: s:thisfile}, + \ #{funcref: funcref('Test_getstacktrace'), lnum: 37, filepath: s:thisfile}, \ #{funcref: funcref('Xfunc1'), lnum: 5, filepath: Filepath('Xscript1')}, \ #{funcref: funcref('Xfunc2'), lnum: 4, filepath: Filepath('Xscript2')}, \ ], g:stacktrace) @@ -61,7 +63,7 @@ func Test_getstacktrace_event() source Xscript1 source Xscript2 call AssertStacktrace([ - \ #{funcref: funcref('Test_getstacktrace_event'), lnum: 62, filepath: s:thisfile}, + \ #{funcref: funcref('Test_getstacktrace_event'), lnum: 64, filepath: s:thisfile}, \ #{event: 'SourcePre Autocommands for "*"', lnum: 7, filepath: Filepath('Xscript1')}, \ #{funcref: funcref('Xfunc'), lnum: 4, filepath: Filepath('Xscript1')}, \ ], g:stacktrace) @@ -98,10 +100,33 @@ func Test_vstacktrace() endtry call assert_equal([], v:stacktrace) call AssertStacktrace([ - \ #{funcref: funcref('Test_vstacktrace'), lnum: 95, filepath: s:thisfile}, + \ #{funcref: funcref('Test_vstacktrace'), lnum: 97, filepath: s:thisfile}, \ #{funcref: funcref('Xfunc1'), lnum: 5, filepath: Filepath('Xscript1')}, \ #{funcref: funcref('Xfunc2'), lnum: 4, filepath: Filepath('Xscript2')}, \ ], stacktrace) endfunc +func Test_zzz_stacktrace_vim9() + let lines =<< trim [SCRIPT] + var stacktrace = getstacktrace() + assert_notequal([], stacktrace) + for d in stacktrace + assert_true(has_key(d, 'lnum')) + endfor + try + throw 'Exception from s:Func' + catch + assert_notequal([], v:stacktrace) + assert_equal(len(stacktrace), len(v:stacktrace)) + for d in v:stacktrace + assert_true(has_key(d, 'lnum')) + endfor + endtry + [SCRIPT] + call v9.CheckDefSuccess(lines) + " FIXME: v:stacktrace is not cleared after the exception handling, and this + " test has to be run as the last one because of this. + " call assert_equal([], v:stacktrace) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index b42c2fc260179..dc04ffc0935d3 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 991, /**/ 990, /**/ From 2050dcc20f99b3440199f4fbe60581e2ad8dac97 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Mon, 6 Jan 2025 18:34:49 +0100 Subject: [PATCH 08/28] patch 9.1.0992: Vim9: double-free after v9.1.0988 Problem: Vim9: double-free after v9.1.0988 (h-east) Solution: clear typval pointer, before setting the type (Yegappan Lakshmanan) Otherwise the contents are still referring to some other value. fixes: #16386 closes: #16388 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_class.vim | 27 +++++++++++++++++++++++++++ src/version.c | 2 ++ src/vim9execute.c | 1 + 3 files changed, 30 insertions(+) diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index c7a0fbefa7de7..0c11c078e721e 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -11839,4 +11839,31 @@ def Test_uninitialized_object_var() v9.CheckSourceFailure(lines, "E1430: Uninitialized object variable 'x' referenced") enddef +" Test for initializing member variables of compound type in the constructor +def Test_constructor_init_compound_member_var() + var lines =<< trim END + vim9script + + class Foo + var v1: string = "aaa" + var v2: list = [1, 2] + var v3: dict = {a: 'a', b: 'b'} + endclass + + class Bar + var v4: string = "bbb" + var v5: Foo = Foo.new() + var v6: list = [1, 2] + endclass + + var b: Bar = Bar.new() + assert_equal("aaa", b.v5.v1) + assert_equal([1, 2], b.v5.v2) + assert_equal({a: 'a', b: 'b'}, b.v5.v3) + assert_equal("bbb", b.v4) + assert_equal([1, 2], b.v6) + END + v9.CheckSourceSuccess(lines) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/version.c b/src/version.c index dc04ffc0935d3..e8feb96f40159 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 992, /**/ 991, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index dde95b511509c..d6962804b361d 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -4855,6 +4855,7 @@ exec_instructions(ectx_T *ectx) + iptr->isn_arg.jumparg.jump_arg_off + STACK_FRAME_SIZE; type_T *t = ufunc->uf_arg_types[argidx]; + CLEAR_POINTER(tv); tv->v_type = t->tt_type; } From 3159b6494ec08fbe780d14e54ad4e89e7b55bb16 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 6 Jan 2025 18:50:15 +0100 Subject: [PATCH 09/28] runtime(sh): fix typo in Last Change header related: #16394 Signed-off-by: Christian Brabandt --- runtime/syntax/sh.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 290d4b68c7f07..d71a966553c4c 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -5,7 +5,7 @@ " Lennart Schultz " Last Change: 2024 Mar 04 by Vim Project " 2024 Nov 03 by Aliaksei Budavei <0x000c70 AT gmail DOT com> (improved bracket expressions, #15941) -" 2025 Jan 06 add $0 to bashSpecialVariables (#16394) +" 2025 Jan 06 add $PS0 to bashSpecialVariables (#16394) " Version: 208 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax From c97e8695353565d6b20adffa48aad47f6e09967f Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Mon, 6 Jan 2025 18:58:21 +0100 Subject: [PATCH 10/28] patch 9.1.0993: New 'cmdheight' behavior may be surprising Problem: Although patch 9.1.0990 fixed a real problem/inconsistency, it also introduced new behavior that may break BWC and/or be unexpected. Before 9.1.0990, window commands could make the topframe smaller (without changing 'cmdheight'; quirk that is now fixed), but did not allow extending the topframe beyond the 'cmdheight' set by the user. After 9.1.0990, the user can reduce the 'cmdheight' below the value they set explicitly, through window commands, which may lead to confusion. (aftere v9.1.0990) Solution: Store the value explicitly set by the user and clamp the 'cmdheight' when resizing the topframe. This also applies to dragging laststatus, which in contrast to window commands _did_ allow reducing the 'cmdheight' to values below the one set by the user. So with this patch there is still new behavior, but I think in a way that is less surprising. While at it, also fix a Coverity warning, introduced in v9.1.0990 (Luuk van Baal) closes: #16385 Signed-off-by: Luuk van Baal Signed-off-by: Christian Brabandt --- src/testdir/dumps/Test_changing_cmdheight_3.dump | 4 ++-- src/testdir/dumps/Test_changing_cmdheight_8.dump | 8 ++++++++ src/testdir/test_cmdline.vim | 9 ++++++--- src/version.c | 2 ++ src/window.c | 11 +++++++++-- 5 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 src/testdir/dumps/Test_changing_cmdheight_8.dump diff --git a/src/testdir/dumps/Test_changing_cmdheight_3.dump b/src/testdir/dumps/Test_changing_cmdheight_3.dump index d652cc63102f6..0adb5c6664b22 100644 --- a/src/testdir/dumps/Test_changing_cmdheight_3.dump +++ b/src/testdir/dumps/Test_changing_cmdheight_3.dump @@ -1,8 +1,8 @@ > +0&#ffffff0@74 -|~+0#4040ff13&| @73 -|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +|[+3&&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 | +0&&@74 @75 @75 @75 @75 +@75 diff --git a/src/testdir/dumps/Test_changing_cmdheight_8.dump b/src/testdir/dumps/Test_changing_cmdheight_8.dump new file mode 100644 index 0000000000000..1b24f33413abb --- /dev/null +++ b/src/testdir/dumps/Test_changing_cmdheight_8.dump @@ -0,0 +1,8 @@ +> +0&#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +|:+0&&|w|i|n|c|m|d| |_| @65 +@75 diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 2b81dc05a9cdf..dfebb400b5364 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -293,14 +293,13 @@ func Test_changing_cmdheight() " :resize now also changes 'cmdheight' accordingly call term_sendkeys(buf, ":set cmdheight+=1\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_2', {}) - call term_sendkeys(buf, ":set cmdheight-=1\") " using more space moves the status line up call term_sendkeys(buf, ":set cmdheight+=1\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_3', {}) " reducing cmdheight moves status line down - call term_sendkeys(buf, ":set cmdheight-=2\") + call term_sendkeys(buf, ":set cmdheight-=3\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_4', {}) " reducing window size and then setting cmdheight @@ -312,10 +311,14 @@ func Test_changing_cmdheight() call term_sendkeys(buf, ":call EchoTwo()\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {}) - " decreasing 'cmdheight' doesn't clear the messages that need hit-enter + " increasing 'cmdheight' doesn't clear the messages that need hit-enter call term_sendkeys(buf, ":call EchoOne()\") call VerifyScreenDump(buf, 'Test_changing_cmdheight_7', {}) + " window commands do not reduce 'cmdheight' to value lower than :set by user + call term_sendkeys(buf, "\:wincmd _\") + call VerifyScreenDump(buf, 'Test_changing_cmdheight_8', {}) + " clean up call StopVimInTerminal(buf) endfunc diff --git a/src/version.c b/src/version.c index e8feb96f40159..60de70238c7d2 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 993, /**/ 992, /**/ diff --git a/src/window.c b/src/window.c index 93b0a327d6494..b15ad3eca8379 100644 --- a/src/window.c +++ b/src/window.c @@ -3832,6 +3832,10 @@ frame_has_win(frame_T *frp, win_T *wp) return FALSE; } +// 'cmdheight' value explicitly set by the user: window commands are allowed to +// resize the topframe to values higher than this minimum, but not lower. +static int min_set_ch = 1; + /* * Set a new height for a frame. Recursively sets the height for contained * frames and windows. Caller must take care of positions. @@ -3852,9 +3856,11 @@ frame_new_height( if (topfrp->fr_parent == NULL && set_ch) { // topframe: update the command line height, with side effects. - int new_ch = MAX(1, p_ch + topfrp->fr_height - height); + int new_ch = MAX(min_set_ch, p_ch + topfrp->fr_height - height); + int save_ch = min_set_ch; if (new_ch != p_ch) set_option_value((char_u *)"cmdheight", new_ch, NULL, 0); + min_set_ch = save_ch; height = MIN(height, ROWS_AVAIL); } if (topfrp->fr_win != NULL) @@ -7306,7 +7312,7 @@ command_height(void) old_p_ch += h; frp = frp->fr_prev; } - if (p_ch < old_p_ch && command_frame_height) + if (p_ch < old_p_ch && command_frame_height && frp != NULL) frame_add_height(frp, (int)(old_p_ch - p_ch)); // Recompute window positions. @@ -7325,6 +7331,7 @@ command_height(void) // GUI starts up, we can't be sure in what order things happen. And when // p_ch was changed in another tab page. curtab->tp_ch_used = p_ch; + min_set_ch = p_ch; } /* From 0072ceedc66c4bc26c98d2e9bd81973bbe3f7f74 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Tue, 7 Jan 2025 20:22:32 +0100 Subject: [PATCH 11/28] patch 9.1.0994: Vim9: not able to use comment after opening curly brace Problem: Vim9: not able to use comment after opening curly brace (lifepillar) Solution: allow to use comments after curly braces of an inner-block, modify the logic to search for comment in a line, update Vim9 tests to use specific class type instead of any (Yegappan Lakshmanan) fixes: #16363 closes: #16405 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_class.vim | 27 ++++----- src/testdir/test_vim9_func.vim | 17 ++++++ src/testdir/test_vim9_script.vim | 21 +++++++ src/userfunc.c | 98 +++++++++++++++++++++++++++++++- src/version.c | 2 + 5 files changed, 149 insertions(+), 16 deletions(-) diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index 0c11c078e721e..799230a98b00c 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -4345,23 +4345,20 @@ def Test_lockvar_object_variable() END v9.CheckSourceFailure(lines, 'E1335: Variable "val4" in class "C" is not writable') - # TODO: the following tests use type "any" for argument. Need a run time - # check for access. Probably OK as is for now. - # read-only lockvar from object method arg lines =<< trim END vim9script class C var val5: number - def Lock(o_any: any) - lockvar o_any.val5 + def Lock(c: C) + lockvar c.val5 enddef endclass var o = C.new(3) o.Lock(C.new(5)) END - v9.CheckSourceFailure(lines, 'E1391: Cannot (un)lock variable "o_any.val5" in class "C"') + v9.CheckSourceFailure(lines, 'E1391: Cannot (un)lock variable "c.val5" in class "C"') # read-only lockvar from class method arg lines =<< trim END @@ -4369,14 +4366,14 @@ def Test_lockvar_object_variable() class C var val6: number - static def Lock(o_any: any) - lockvar o_any.val6 + static def Lock(c: C) + lockvar c.val6 enddef endclass var o = C.new(3) C.Lock(o) END - v9.CheckSourceFailure(lines, 'E1391: Cannot (un)lock variable "o_any.val6" in class "C"') + v9.CheckSourceFailure(lines, 'E1391: Cannot (un)lock variable "c.val6" in class "C"') # # lockvar of public object variable @@ -4444,14 +4441,14 @@ def Test_lockvar_object_variable() class C public var val5: number - def Lock(o_any: any) - lockvar o_any.val5 + def Lock(c: C) + lockvar c.val5 enddef endclass var o = C.new(3) o.Lock(C.new(5)) END - v9.CheckSourceFailure(lines, 'E1391: Cannot (un)lock variable "o_any.val5" in class "C"', 1) + v9.CheckSourceFailure(lines, 'E1391: Cannot (un)lock variable "c.val5" in class "C"', 1) # lockvar from class method arg lines =<< trim END @@ -4459,14 +4456,14 @@ def Test_lockvar_object_variable() class C public var val6: number - static def Lock(o_any: any) - lockvar o_any.val6 + static def Lock(c: C) + lockvar c.val6 enddef endclass var o = C.new(3) C.Lock(o) END - v9.CheckSourceFailure(lines, 'E1391: Cannot (un)lock variable "o_any.val6" in class "C"', 1) + v9.CheckSourceFailure(lines, 'E1391: Cannot (un)lock variable "c.val6" in class "C"', 1) enddef " Test trying to lock a class variable from various places diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 79bb9d8216cda..4188f82e5d065 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -4697,6 +4697,23 @@ def Test_test_override_defcompile() test_override('defcompile', 0) enddef +" Test for using a comment after the opening curly brace of an inner block. +def Test_comment_after_inner_block() + var lines =<< trim END + vim9script + + def F(G: func) + enddef + + F(() => { # comment1 + F(() => { # comment2 + echo 'ok' # comment3 + }) # comment4 + }) # comment5 + END + v9.CheckScriptSuccess(lines) +enddef + " The following messes up syntax highlight, keep near the end. if has('python3') def Test_python3_command() diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 82f808862db17..550c725dd7641 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -595,6 +595,27 @@ def Test_autocommand_block() unlet g:otherVar enddef +def Test_block_in_a_string() + var lines =<< trim END + vim9script + + def Foo(): string + var x = ' => { # abc' + return x + enddef + + assert_equal(' => { # abc', Foo()) + + def Bar(): string + var x = " => { # abc" + return x + enddef + + assert_equal(" => { # abc", Bar()) + END + v9.CheckSourceSuccess(lines) +enddef + func g:NoSuchFunc() echo 'none' endfunc diff --git a/src/userfunc.c b/src/userfunc.c index 5bf7e9558ed4d..b4ee0a2675a08 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -859,6 +859,92 @@ function_using_block_scopes(ufunc_T *fp, cstack_T *cstack) cstack->cs_flags[i] |= CSF_FUNC_DEF; } +/* + * Skip over all the characters in a single quoted string starting at "p" and + * return a pointer to the character following the ending single quote. + * If the ending single quote is missing, then return a pointer to the NUL + * character. + */ + static char_u * +skip_single_quote_string(char_u *p) +{ + p++; // skip the beginning single quote + while (*p != NUL) + { + // Within the string, a single quote can be escaped by using + // two single quotes. + if (*p == '\'' && *(p + 1) == '\'') + p += 2; + else if (*p == '\'') + { + p++; // skip the ending single quote + break; + } + else + MB_PTR_ADV(p); + } + + return p; +} + +/* + * Skip over all the characters in a double quoted string starting at "p" and + * return a pointer to the character following the ending double quote. + * If the ending double quote is missing, then return a pointer to the NUL + * character. + */ + static char_u * +skip_double_quote_string(char_u *p) +{ + p++; // skip the beginning double quote + while (*p != NUL) + { + // Within the string, a double quote can be escaped by + // preceding it with a backslash. + if (*p == '\\' && *(p + 1) == '"') + p += 2; + else if (*p == '"') + { + p++; // skip the ending double quote + break; + } + else + MB_PTR_ADV(p); + } + + return p; +} + +/* + * Return the start of a Vim9 comment (#) in the line starting at "line". + * If a comment is not found, then returns a pointer to the end of the + * string (NUL). + */ + static char_u * +find_start_of_vim9_comment(char_u *line) +{ + char_u *p = line; + + while (*p != NUL) + { + if (*p == '\'') + // Skip a single quoted string. + p = skip_single_quote_string(p); + else if (*p == '"') + // Skip a double quoted string. + p = skip_double_quote_string(p); + else + { + if (*p == '#') + // Found the start of a Vim9 comment + break; + MB_PTR_ADV(p); + } + } + + return p; +} + /* * Read the body of a function, put every line in "newlines". * This stops at "}", "endfunction" or "enddef". @@ -1123,7 +1209,17 @@ get_function_body( if (nesting_def[nesting] ? *p != '#' : *p != '"') { // Not a comment line: check for nested inline function. - end = p + STRLEN(p) - 1; + + if (nesting_inline[nesting]) + { + // A comment (#) can follow the opening curly brace of a + // block statement. Need to ignore the comment and look + // for the opening curly brace before the comment. + end = find_start_of_vim9_comment(p) - 1; + } + else + end = p + STRLEN(p) - 1; + while (end > p && VIM_ISWHITE(*end)) --end; if (end > p + 1 && *end == '{' && VIM_ISWHITE(end[-1])) diff --git a/src/version.c b/src/version.c index 60de70238c7d2..699ad36254aad 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 994, /**/ 993, /**/ From 616219f684744bcfad61a53c13166cda9b141dea Mon Sep 17 00:00:00 2001 From: mtvare6 Date: Tue, 7 Jan 2025 20:31:27 +0100 Subject: [PATCH 12/28] patch 9.1.0995: filetype: shaderslang files are not detected Problem: filetype: shaderslang files are not detected Solution: detect '*.slang' files as shaderslang filetype, include a filetype and syntax script (mtvare6) Reference: https://shader-slang.com/ closes: #16387 Signed-off-by: mtvare6 Signed-off-by: Christian Brabandt --- .github/MAINTAINERS | 2 + runtime/filetype.vim | 5 +- runtime/ftplugin/shaderslang.vim | 54 +++++ runtime/syntax/shaderslang.vim | 360 +++++++++++++++++++++++++++++++ src/testdir/test_filetype.vim | 1 + src/version.c | 2 + 6 files changed, 423 insertions(+), 1 deletion(-) create mode 100644 runtime/ftplugin/shaderslang.vim create mode 100644 runtime/syntax/shaderslang.vim diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index 433ac1c4e7c4f..80965385e4125 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -273,6 +273,7 @@ runtime/ftplugin/scss.vim @tpope runtime/ftplugin/sdoc.vim @gpanders runtime/ftplugin/sed.vim @dkearns runtime/ftplugin/sh.vim @dkearns +runtime/ftplugin/shaderslang.vim @mTvare6 runtime/ftplugin/slint.vim @ribru17 runtime/ftplugin/snakemake.vim @ribru17 runtime/ftplugin/solidity.vim @cothi @@ -590,6 +591,7 @@ runtime/syntax/scss.vim @tpope runtime/syntax/sdoc.vim @gpanders runtime/syntax/sed.vim @dkearns runtime/syntax/shared/debversions.vim @jamessan +runtime/syntax/shaderslang.vim @mTvare6 runtime/syntax/solidity.vim @cothi runtime/syntax/spec.vim @ignatenkobrain runtime/syntax/sqloracle.vim @chrisbra diff --git a/runtime/filetype.vim b/runtime/filetype.vim index ac77cbbb94a61..737f881000eed 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -2185,7 +2185,7 @@ au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby au BufNewFile,BufRead *.rs setf rust au BufNewFile,BufRead Cargo.lock,*/.cargo/config,*/.cargo/credentials setf toml -" S-lang (or shader language, or SmallLisp) +" S-lang au BufNewFile,BufRead *.sl setf slang " Sage @@ -2209,6 +2209,9 @@ au BufNewFile,BufRead *.scala setf scala " SBT - Scala Build Tool au BufNewFile,BufRead *.sbt setf sbt +" Slang Shading Language +au BufNewFile,BufRead *.slang setf shaderslang + " Slint au BufNewFile,BufRead *.slint setf slint diff --git a/runtime/ftplugin/shaderslang.vim b/runtime/ftplugin/shaderslang.vim new file mode 100644 index 0000000000000..f3d1ab8c1cb01 --- /dev/null +++ b/runtime/ftplugin/shaderslang.vim @@ -0,0 +1,54 @@ +" Vim filetype plugin file +" Language: Slang +" Maintainer: Austin Shijo +" Last Change: 2025 Jan 05 + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +" Don't load another plugin for this buffer +let b:did_ftplugin = 1 + +" Using line continuation here. +let s:cpo_save = &cpo +set cpo-=C + +let b:undo_ftplugin = "setl fo< com< cms< inc<" + +" Set 'formatoptions' to break comment lines but not other lines, +" and insert the comment leader when hitting or using "o". +setlocal fo-=t fo+=croql + +" Set comment string (Slang uses C-style comments) +setlocal commentstring=//\ %s + +" Set 'comments' to format dashed lists in comments +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// + +" When the matchit plugin is loaded, this makes the % command skip parens and +" braces in comments properly, and adds support for shader-specific keywords +if exists("loaded_matchit") + " Add common shader control structures + let b:match_words = '{\|^\s*\<\(if\|for\|while\|switch\|struct\|class\)\>:}\|^\s*\,' .. + \ '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>,' .. + \ '\[:\]' + let b:match_skip = 's:comment\|string\|character\|special' + let b:match_ignorecase = 0 + let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words b:match_ignorecase" +endif + +" Win32 and GTK can filter files in the browse dialog +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Slang Source Files (*.slang)\t*.slang\n" + if has("win32") + let b:browsefilter ..= "All Files (*.*)\t*\n" + else + let b:browsefilter ..= "All Files (*)\t*\n" + endif + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/shaderslang.vim b/runtime/syntax/shaderslang.vim new file mode 100644 index 0000000000000..1cae202b04312 --- /dev/null +++ b/runtime/syntax/shaderslang.vim @@ -0,0 +1,360 @@ +" Vim syntax file +" Language: Slang +" Maintainer: Austin Shijo +" Last Change: 2024 Jan 05 + +if exists("b:current_syntax") + finish +endif + +" Read the C syntax to start with +runtime! syntax/c.vim +unlet b:current_syntax + +" Annotations +syn match shaderslangAnnotation /<.*;>/ + +" Attributes +syn match shaderslangAttribute /^\s*\[maxvertexcount(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[domain(\s*"\(tri\|quad\|isoline\)"\s*)\]/ +syn match shaderslangAttribute /^\s*\[earlydepthstencil\]/ +syn match shaderslangAttribute /^\s*\[instance(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[maxtessfactor(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[numthreads(\s*\w\+\s*,\s*\w\+\s*,\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[outputcontrolpoints(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[outputtopology(\s*"\(point\|line\|triangle_cw\|triangle_ccw\|triangle\)"\s*)\]/ +syn match shaderslangAttribute /^\s*\[partitioning(\s*"\(integer\|fractional_even\|fractional_odd\|pow2\)"\s*)\]/ +syn match shaderslangAttribute /^\s*\[patchconstantfunc(\s*"\(\d\|\w\|_\)\+"\s*)\]/ +syn match shaderslangAttribute /^\s*\[WaveSize(\s*\w\+\(\s*,\s*\w\+\(\s*,\s*\w\+\)\?\)\?\s*)\]/ +syn match shaderslangAttribute /^\s*\[shader(\s*"\(anyhit\|callable\|closesthit\|intersection\|miss\|raygeneration\)"\s*)\]/ + +syn match shaderslangAttribute /^\s*\[fastopt\]/ +syn match shaderslangAttribute /^\s*\[loop\]/ +syn match shaderslangAttribute /^\s*\[unroll\]/ +syn match shaderslangAttribute /^\s*\[allow_uav_condition\]/ +syn match shaderslangAttribute /^\s*\[branch\]/ +syn match shaderslangAttribute /^\s*\[flatten\]/ +syn match shaderslangAttribute /^\s*\[forcecase\]/ +syn match shaderslangAttribute /^\s*\[call\]/ +syn match shaderslangAttribute /^\s*\[WaveOpsIncludeHelperLanes\]/ + +syn match shaderslangAttribute /\[raypayload\]/ + +" Work graph shader target attributes +syn match shaderslangAttribute /^\s*\[Shader(\s*"\(\d\|\w\|_\)\+"\s*)\]/ + +" Work graph shader function attributes +syn match shaderslangAttribute /^\s*\[NodeLaunch(\s*"\(broadcasting\|coalescing\|thread\)"\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeIsProgramEntry\]/ +syn match shaderslangAttribute /^\s*\[NodeLocalRootArgumentsTableIndex(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NumThreads(\s*\w\+\s*,\s*\w\+\s*,\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeShareInputOf(\s*"\w\+"\(\s*,\s*\w\+\)\?\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeDispatchGrid(\s*\w\+\s*,\s*\w\+\s*,\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeMaxDispatchGrid(\s*\w\+\s*,\s*\w\+\s*,\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeMaxRecursionDepth(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /^\s*\[NodeMaxInputRecordsPerGraphEntryRecord(\s*\w\+\s*,\s*\(true\|false\)\s*)\]/ + +" Work graph record attributes +syn match shaderslangAttribute /\[NodeTrackRWInputSharing\]/ +syn match shaderslangAttribute /\[MaxRecords(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /\[NodeID(\s*"\w\+"\(\s*,\s*\w\+\)\?\s*)\]/ +syn match shaderslangAttribute /\[MaxRecordsSharedWith(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /\[AllowSparseNodes\]/ +syn match shaderslangAttribute /\[NodeArraySize(\s*\w\+\s*)\]/ +syn match shaderslangAttribute /\[UnboundedSparseNodes\]/ + +" Intrinsic functions +syn keyword shaderslangFunc abs acos acosh asin asinh atan atanh cos cosh exp exp2 floor log log10 log2 round rsqrt sin sincos sinh sqrt tan tanh trunc +syn keyword shaderslangFunc AllMemoryBarrier AllMemoryBarrierWithGroupSync DeviceMemoryBarrier DeviceMemoryBarrierWithGroupSync GroupMemoryBarrier GroupMemoryBarrierWithGroupSync +syn keyword shaderslangFunc abort clip errorf printf +syn keyword shaderslangFunc all any countbits faceforward firstbithigh firstbitlow isfinite isinf isnan max min noise pow reversebits sign +syn keyword shaderslangFunc asdouble asfloat asint asuint D3DCOLORtoUBYTE4 f16tof32 f32tof16 +syn keyword shaderslangFunc ceil clamp degrees fma fmod frac frexp ldexp lerp mad modf radiants saturate smoothstep step +syn keyword shaderslangFunc cross determinant distance dot dst length lit msad4 mul normalize rcp reflect refract transpose +syn keyword shaderslangFunc ddx ddx_coarse ddx_fine ddy ddy_coarse ddy_fine fwidth +syn keyword shaderslangFunc EvaluateAttributeAtCentroid EvaluateAttributeAtSample EvaluateAttributeSnapped +syn keyword shaderslangFunc GetRenderTargetSampleCount GetRenderTargetSamplePosition +syn keyword shaderslangFunc InterlockedAdd InterlockedAnd InterlockedCompareExchange InterlockedCompareStore InterlockedExchange InterlockedMax InterlockedMin InterlockedOr InterlockedXor +syn keyword shaderslangFunc InterlockedCompareStoreFloatBitwise InterlockedCompareExchangeFloatBitwise +syn keyword shaderslangFunc Process2DQuadTessFactorsAvg Process2DQuadTessFactorsMax Process2DQuadTessFactorsMin ProcessIsolineTessFactors +syn keyword shaderslangFunc ProcessQuadTessFactorsAvg ProcessQuadTessFactorsMax ProcessQuadTessFactorsMin ProcessTriTessFactorsAvg ProcessTriTessFactorsMax ProcessTriTessFactorsMin +syn keyword shaderslangFunc tex1D tex1Dbias tex1Dgrad tex1Dlod tex1Dproj +syn keyword shaderslangFunc tex2D tex2Dbias tex2Dgrad tex2Dlod tex2Dproj +syn keyword shaderslangFunc tex3D tex3Dbias tex3Dgrad tex3Dlod tex3Dproj +syn keyword shaderslangFunc texCUBE texCUBEbias texCUBEgrad texCUBElod texCUBEproj +syn keyword shaderslangFunc WaveIsFirstLane WaveGetLaneCount WaveGetLaneIndex +syn keyword shaderslangFunc IsHelperLane +syn keyword shaderslangFunc WaveActiveAnyTrue WaveActiveAllTrue WaveActiveBallot +syn keyword shaderslangFunc WaveReadLaneFirst WaveReadLaneAt +syn keyword shaderslangFunc WaveActiveAllEqual WaveActiveAllEqualBool WaveActiveCountBits +syn keyword shaderslangFunc WaveActiveSum WaveActiveProduct WaveActiveBitAnd WaveActiveBitOr WaveActiveBitXor WaveActiveMin WaveActiveMax +syn keyword shaderslangFunc WavePrefixCountBits WavePrefixProduct WavePrefixSum +syn keyword shaderslangFunc QuadReadAcrossX QuadReadAcrossY QuadReadAcrossDiagonal QuadReadLaneAt +syn keyword shaderslangFunc QuadAny QuadAll +syn keyword shaderslangFunc WaveMatch WaveMultiPrefixSum WaveMultiPrefixProduct WaveMultiPrefixCountBits WaveMultiPrefixAnd WaveMultiPrefixOr WaveMultiPrefixXor +syn keyword shaderslangFunc NonUniformResourceIndex +syn keyword shaderslangFunc DispatchMesh SetMeshOutputCounts +syn keyword shaderslangFunc dot4add_u8packed dot4add_i8packed dot2add + +syn keyword shaderslangFunc RestartStrip +syn keyword shaderslangFunc CalculateLevelOfDetail CalculateLevelOfDetailUnclamped Gather GetDimensions GetSamplePosition Load Sample SampleBias SampleCmp SampleCmpLevelZero SampleGrad SampleLevel GatherRaw SampleCmpLevel +syn keyword shaderslangFunc SampleCmpBias SampleCmpGrad +syn keyword shaderslangFunc WriteSamplerFeedback WriteSamplerFeedbackBias WriteSamplerFeedbackGrad WriteSamplerFeedbackLevel +syn keyword shaderslangFunc Append Consume DecrementCounter IncrementCounter +syn keyword shaderslangFunc Load2 Load3 Load4 Store Store2 Store3 Store4 +syn keyword shaderslangFunc GatherRed GatherGreen GatherBlue GatherAlpha GatherCmp GatherCmpRed GatherCmpGreen GatherCmpBlue GatherCmpAlpha +syn match shaderslangFunc /\.mips\[\d\+\]\[\d\+\]/ +syn match shaderslangFunc /\.sample\[\d\+\]\[\d\+\]/ + +" Ray intrinsics +syn keyword shaderslangFunc AcceptHitAndEndSearch CallShader IgnoreHit ReportHit TraceRay +syn keyword shaderslangFunc DispatchRaysIndex DispatchRaysDimensions +syn keyword shaderslangFunc WorldRayOrigin WorldRayDirection RayTMin RayTCurrent RayFlags +syn keyword shaderslangFunc InstanceIndex InstanceID GeometryIndex PrimitiveIndex ObjectRayOrigin ObjectRayDirection ObjectToWorld3x4 ObjectToWorld4x3 WorldToObject3x4 WorldToObject4x3 +syn keyword shaderslangFunc HitKind + +" RayQuery intrinsics +syn keyword shaderslangFunc TraceRayInline Proceed Abort CommittedStatus +syn keyword shaderslangFunc CandidateType CandidateProceduralPrimitiveNonOpaque CandidateTriangleRayT CandidateInstanceIndex CandidateInstanceID CandidateInstanceContributionToHitGroupIndex CandidateGeometryIndex +syn keyword shaderslangFunc CandidatePrimitiveIndex CandidateObjectRayOrigin CandidateObjectRayDirection CandidateObjectToWorld3x4 CandidateObjectToWorld4x3 CandidateWorldToObject3x4 CandidateWorldToObject4x3 +syn keyword shaderslangFunc CommitNonOpaqueTriangleHit CommitProceduralPrimitiveHit CommittedStatus CommittedRayT CommittedInstanceIndex CommittedInstanceID CommittedInstanceContributionToHitGroupIndex +syn keyword shaderslangFunc CommittedGeometryIndex CommittedPrimitiveIndex CommittedObjectRayOrigin CommittedObjectRayDirection CommittedObjectToWorld3x4 CommittedObjectToWorld4x3 CommittedWorldToObject3x4 +syn keyword shaderslangFunc CommittedWorldToObject4x3 CandidateTriangleBarycentrics CandidateTriangleFrontFace CommittedTriangleBarycentrics CommittedTriangleFrontFace + +" Pack/unpack math intrinsics +syn keyword shaderslangFunc unpack_s8s16 unpack_u8u16 unpack_s8s32 unpack_u8u32 +syn keyword shaderslangFunc pack_u8 pack_s8 pack_clamp_u8 pack_clamp_s8 + +" Work graph object methods +syn keyword shaderslangFunc Get FinishedCrossGroupSharing Count GetThreadNodeOutputRecords GetGroupNodeOutputRecords IsValid GroupIncrementOutputCount ThreadIncrementOutputCount OutputComplete + +" Work graph free intrinsics +syn keyword shaderslangFunc GetRemainingRecursionLevels Barrier + +" Layout Qualifiers +syn keyword shaderslangLayoutQual const row_major column_major +syn keyword shaderslangLayoutQual point line triangle lineadj triangleadj +syn keyword shaderslangLayoutQual InputPatch OutputPatch +syn match shaderslangLayoutQual /PointStream<\s*\w\+\s*>/ +syn match shaderslangLayoutQual /LineStream<\s*\w\+\s*>/ +syn match shaderslangLayoutQual /TriangleStream<\s*\w\+\s*>/ + +" User defined Semantics +syn match shaderslangSemantic /:\s*[A-Z]\w*/ +syn match shaderslangSemantic /:\s*packoffset(\s*c\d\+\(\.[xyzw]\)\?\s*)/ " packoffset +syn match shaderslangSemantic /:\s*register(\s*\(r\|x\|v\|t\|s\|cb\|icb\|b\|c\|u\)\d\+\s*)/ " register +syn match shaderslangSemantic /:\s*read(\s*\(\(anyhit\|closesthit\|miss\|caller\)\s*,\s*\)*\(anyhit\|closesthit\|miss\|caller\)\?\s*)/ " read +syn match shaderslangSemantic /:\s*write(\s*\(\(anyhit\|closesthit\|miss\|caller\)\s*,\s*\)*\(anyhit\|closesthit\|miss\|caller\)\?\s*)/ " write + +" System-Value Semantics +" Vertex Shader +syn match shaderslangSemantic /SV_ClipDistance\d\+/ +syn match shaderslangSemantic /SV_CullDistance\d\+/ +syn keyword shaderslangSemantic SV_Position SV_InstanceID SV_PrimitiveID SV_VertexID +syn keyword shaderslangSemantic SV_StartVertexLocation SV_StartInstanceLocation +" Tessellation pipeline +syn keyword shaderslangSemantic SV_DomainLocation SV_InsideTessFactor SV_OutputControlPointID SV_TessFactor +" Geometry Shader +syn keyword shaderslangSemantic SV_GSInstanceID SV_RenderTargetArrayIndex +" Pixel Shader - MSAA +syn keyword shaderslangSemantic SV_Coverage SV_Depth SV_IsFrontFace SV_SampleIndex +syn match shaderslangSemantic /SV_Target[0-7]/ +syn keyword shaderslangSemantic SV_ShadingRate SV_ViewID +syn match shaderslangSemantic /SV_Barycentrics[0-1]/ +" Compute Shader +syn keyword shaderslangSemantic SV_DispatchThreadID SV_GroupID SV_GroupIndex SV_GroupThreadID +" Mesh shading pipeline +syn keyword shaderslangSemantic SV_CullPrimitive +" Work graph record system values +syn keyword shaderslangSemantic SV_DispatchGrid + +" slang structures +syn keyword shaderslangStructure cbuffer + +" Shader profiles +" Cg profiles +syn keyword shaderslangProfile arbfp1 arbvp1 fp20 vp20 fp30 vp30 ps_1_1 ps_1_2 ps_1_3 +" Shader Model 1 +syn keyword shaderslangProfile vs_1_1 +" Shader Model 2 +syn keyword shaderslangProfile ps_2_0 ps_2_x vs_2_0 vs_2_x +" Shader Model 3 +syn keyword shaderslangProfile ps_3_0 vs_3_0 +" Shader Model 4 +syn keyword shaderslangProfile gs_4_0 ps_4_0 vs_4_0 gs_4_1 ps_4_1 vs_4_1 +" Shader Model 5 +syn keyword shaderslangProfile cs_4_0 cs_4_1 cs_5_0 ds_5_0 gs_5_0 hs_5_0 ps_5_0 vs_5_0 +" Shader Model 6 +syn keyword shaderslangProfile cs_6_0 ds_6_0 gs_6_0 hs_6_0 ps_6_0 vs_6_0 lib_6_0 + +" Swizzling +syn match shaderslangSwizzle /\.[xyzw]\{1,4\}\>/ +syn match shaderslangSwizzle /\.[rgba]\{1,4\}\>/ +syn match shaderslangSwizzle /\.\(_m[0-3]\{2}\)\{1,4\}/ +syn match shaderslangSwizzle /\.\(_[1-4]\{2}\)\{1,4\}/ + +" Other Statements +syn keyword shaderslangStatement discard + +" Storage class +syn match shaderslangStorageClass /\/ +syn match shaderslangStorageClass /\/ +syn keyword shaderslangStorageClass inout +syn keyword shaderslangStorageClass extern nointerpolation precise shared groupshared static uniform volatile +syn keyword shaderslangStorageClass snorm unorm +syn keyword shaderslangStorageClass linear centroid nointerpolation noperspective sample +syn keyword shaderslangStorageClass globallycoherent + +" Types +" Buffer types +syn keyword shaderslangType ConstantBuffer Buffer ByteAddressBuffer ConsumeStructuredBuffer StructuredBuffer +syn keyword shaderslangType AppendStructuredBuffer RWBuffer RWByteAddressBuffer RWStructuredBuffer +syn keyword shaderslangType RasterizerOrderedBuffer RasterizerOrderedByteAddressBuffer RasterizerOrderedStructuredBuffer + +" Scalar types +syn keyword shaderslangType bool int uint dword half float double +syn keyword shaderslangType min16float min10float min16int min12int min16uint +syn keyword shaderslangType float16_t float32_t float64_t + +" Vector types +syn match shaderslangType /vector<\s*\w\+,\s*[1-4]\s*>/ +syn keyword shaderslangType bool1 bool2 bool3 bool4 +syn keyword shaderslangType int1 int2 int3 int4 +syn keyword shaderslangType uint1 uint2 uint3 uint4 +syn keyword shaderslangType dword1 dword2 dword3 dword4 +syn keyword shaderslangType half1 half2 half3 half4 +syn keyword shaderslangType float1 float2 float3 float4 +syn keyword shaderslangType double1 double2 double3 double4 +syn keyword shaderslangType min16float1 min16float2 min16float3 min16float4 +syn keyword shaderslangType min10float1 min10float2 min10float3 min10float4 +syn keyword shaderslangType min16int1 min16int2 min16int3 min16int4 +syn keyword shaderslangType min12int1 min12int2 min12int3 min12int4 +syn keyword shaderslangType min16uint1 min16uint2 min16uint3 min16uint4 +syn keyword shaderslangType float16_t1 float16_t2 float16_t3 float16_t4 +syn keyword shaderslangType float32_t1 float32_t2 float32_t3 float32_t4 +syn keyword shaderslangType float64_t1 float64_t2 float64_t3 float64_t4 +syn keyword shaderslangType int16_t1 int16_t2 int16_t3 int16_t4 +syn keyword shaderslangType int32_t1 int32_t2 int32_t3 int32_t4 +syn keyword shaderslangType int64_t1 int64_t2 int64_t3 int64_t4 +syn keyword shaderslangType uint16_t1 uint16_t2 uint16_t3 uint16_t4 +syn keyword shaderslangType uint32_t1 uint32_t2 uint32_t3 uint32_t4 +syn keyword shaderslangType uint64_t1 uint64_t2 uint64_t3 uint64_t4 + +" Packed types +syn keyword shaderslangType uint8_t4_packed int8_t4_packed + +" Matrix types +syn match shaderslangType /matrix<\s*\w\+\s*,\s*[1-4]\s*,\s*[1-4]\s*>/ +syn keyword shaderslangType bool1x1 bool2x1 bool3x1 bool4x1 bool1x2 bool2x2 bool3x2 bool4x2 bool1x3 bool2x3 bool3x3 bool4x3 bool1x4 bool2x4 bool3x4 bool4x4 +syn keyword shaderslangType int1x1 int2x1 int3x1 int4x1 int1x2 int2x2 int3x2 int4x2 int1x3 int2x3 int3x3 int4x3 int1x4 int2x4 int3x4 int4x4 +syn keyword shaderslangType uint1x1 uint2x1 uint3x1 uint4x1 uint1x2 uint2x2 uint3x2 uint4x2 uint1x3 uint2x3 uint3x3 uint4x3 uint1x4 uint2x4 uint3x4 uint4x4 +syn keyword shaderslangType dword1x1 dword2x1 dword3x1 dword4x1 dword1x2 dword2x2 dword3x2 dword4x2 dword1x3 dword2x3 dword3x3 dword4x3 dword1x4 dword2x4 dword3x4 dword4x4 +syn keyword shaderslangType half1x1 half2x1 half3x1 half4x1 half1x2 half2x2 half3x2 half4x2 half1x3 half2x3 half3x3 half4x3 half1x4 half2x4 half3x4 half4x4 +syn keyword shaderslangType float1x1 float2x1 float3x1 float4x1 float1x2 float2x2 float3x2 float4x2 float1x3 float2x3 float3x3 float4x3 float1x4 float2x4 float3x4 float4x4 +syn keyword shaderslangType double1x1 double2x1 double3x1 double4x1 double1x2 double2x2 double3x2 double4x2 double1x3 double2x3 double3x3 double4x3 double1x4 double2x4 double3x4 double4x4 +syn keyword shaderslangType min16float1x1 min16float2x1 min16float3x1 min16float4x1 min16float1x2 min16float2x2 min16float3x2 min16float4x2 min16float1x3 min16float2x3 min16float3x3 min16float4x3 min16float1x4 min16float2x4 min16float3x4 min16float4x4 +syn keyword shaderslangType min10float1x1 min10float2x1 min10float3x1 min10float4x1 min10float1x2 min10float2x2 min10float3x2 min10float4x2 min10float1x3 min10float2x3 min10float3x3 min10float4x3 min10float1x4 min10float2x4 min10float3x4 min10float4x4 +syn keyword shaderslangType min16int1x1 min16int2x1 min16int3x1 min16int4x1 min16int1x2 min16int2x2 min16int3x2 min16int4x2 min16int1x3 min16int2x3 min16int3x3 min16int4x3 min16int1x4 min16int2x4 min16int3x4 min16int4x4 +syn keyword shaderslangType min12int1x1 min12int2x1 min12int3x1 min12int4x1 min12int1x2 min12int2x2 min12int3x2 min12int4x2 min12int1x3 min12int2x3 min12int3x3 min12int4x3 min12int1x4 min12int2x4 min12int3x4 min12int4x4 +syn keyword shaderslangType min16uint1x1 min16uint2x1 min16uint3x1 min16uint4x1 min16uint1x2 min16uint2x2 min16uint3x2 min16uint4x2 min16uint1x3 min16uint2x3 min16uint3x3 min16uint4x3 min16uint1x4 min16uint2x4 min16uint3x4 min16uint4x4 +syn keyword shaderslangType float16_t1x1 float16_t2x1 float16_t3x1 float16_t4x1 float16_t1x2 float16_t2x2 float16_t3x2 float16_t4x2 float16_t1x3 float16_t2x3 float16_t3x3 float16_t4x3 float16_t1x4 float16_t2x4 float16_t3x4 float16_t4x4 +syn keyword shaderslangType float32_t1x1 float32_t2x1 float32_t3x1 float32_t4x1 float32_t1x2 float32_t2x2 float32_t3x2 float32_t4x2 float32_t1x3 float32_t2x3 float32_t3x3 float32_t4x3 float32_t1x4 float32_t2x4 float32_t3x4 float32_t4x4 +syn keyword shaderslangType float64_t1x1 float64_t2x1 float64_t3x1 float64_t4x1 float64_t1x2 float64_t2x2 float64_t3x2 float64_t4x2 float64_t1x3 float64_t2x3 float64_t3x3 float64_t4x3 float64_t1x4 float64_t2x4 float64_t3x4 float64_t4x4 +syn keyword shaderslangType int16_t1x1 int16_t2x1 int16_t3x1 int16_t4x1 int16_t1x2 int16_t2x2 int16_t3x2 int16_t4x2 int16_t1x3 int16_t2x3 int16_t3x3 int16_t4x3 int16_t1x4 int16_t2x4 int16_t3x4 int16_t4x4 +syn keyword shaderslangType int32_t1x1 int32_t2x1 int32_t3x1 int32_t4x1 int32_t1x2 int32_t2x2 int32_t3x2 int32_t4x2 int32_t1x3 int32_t2x3 int32_t3x3 int32_t4x3 int32_t1x4 int32_t2x4 int32_t3x4 int32_t4x4 +syn keyword shaderslangType int64_t1x1 int64_t2x1 int64_t3x1 int64_t4x1 int64_t1x2 int64_t2x2 int64_t3x2 int64_t4x2 int64_t1x3 int64_t2x3 int64_t3x3 int64_t4x3 int64_t1x4 int64_t2x4 int64_t3x4 int64_t4x4 +syn keyword shaderslangType uint16_t1x1 uint16_t2x1 uint16_t3x1 uint16_t4x1 uint16_t1x2 uint16_t2x2 uint16_t3x2 uint16_t4x2 uint16_t1x3 uint16_t2x3 uint16_t3x3 uint16_t4x3 uint16_t1x4 uint16_t2x4 uint16_t3x4 uint16_t4x4 +syn keyword shaderslangType uint32_t1x1 uint32_t2x1 uint32_t3x1 uint32_t4x1 uint32_t1x2 uint32_t2x2 uint32_t3x2 uint32_t4x2 uint32_t1x3 uint32_t2x3 uint32_t3x3 uint32_t4x3 uint32_t1x4 uint32_t2x4 uint32_t3x4 uint32_t4x4 +syn keyword shaderslangType uint64_t1x1 uint64_t2x1 uint64_t3x1 uint64_t4x1 uint64_t1x2 uint64_t2x2 uint64_t3x2 uint64_t4x2 uint64_t1x3 uint64_t2x3 uint64_t3x3 uint64_t4x3 uint64_t1x4 uint64_t2x4 uint64_t3x4 uint64_t4x4 + +" Sampler types +syn keyword shaderslangType SamplerState SamplerComparisonState +syn keyword shaderslangType sampler sampler1D sampler2D sampler3D samplerCUBE sampler_state + +" Texture types +syn keyword shaderslangType Texture1D Texture1DArray Texture2D Texture2DArray Texture2DMS Texture2DMSArray Texture3D TextureCube TextureCubeArray +syn keyword shaderslangType RWTexture1D RWTexture2D RWTexture2DArray RWTexture3D RWTextureCubeArray RWTexture2DMS RWTexture2DMSArray +syn keyword shaderslangType FeedbackTexture2D FeedbackTexture2DArray +syn keyword shaderslangType RasterizerOrderedTexture1D RasterizerOrderedTexture1DArray RasterizerOrderedTexture2D RasterizerOrderedTexture2DArray RasterizerOrderedTexture3D +syn keyword shaderslangTypeDeprec texture texture1D texture2D texture3D + +" Raytracing types +syn keyword shaderslangType RaytracingAccelerationStructure RayDesc RayQuery BuiltInTriangleIntersectionAttributes + +" Work graph input record objects +syn keyword shaderslangType DispatchNodeInputRecord RWDispatchNodeInputRecord GroupNodeInputRecords RWGroupNodeInputRecords ThreadNodeInputRecord RWThreadNodeInputRecord EmptyNodeInput + +" Work graph output node objects +syn keyword shaderslangType NodeOutput NodeOutputArray EmptyNodeOutput EmptyNodeOutputArray + +" Work graph output record objects +syn keyword shaderslangType ThreadNodeOutputRecords GroupNodeOutputRecords + +" State Groups args +syn case ignore " This section case insensitive + +" Blend state group +syn keyword shaderslangStateGroupArg AlphaToCoverageEnable BlendEnable SrcBlend DestBlend BlendOp SrcBlendAlpha DestBlendAlpha BlendOpAlpha RenderTargetWriteMask +syn keyword shaderslangStateGroupVal ZERO ONE SRC_COLOR INV_SRC_COLOR SRC_ALPHA INV_SRC_ALPHA DEST_ALPHA INV_DEST_ALPHA DEST_COLOR INV_DEST_COLOR SRC_ALPHA_SAT BLEND_FACTOR INV_BLEND_FACTOR SRC1_COLOR INV_SRC1_COLOR SRC1_ALPHA INV_SRC1_ALPHA +syn keyword shaderslangStateGroupVal ADD SUBSTRACT REV_SUBSTRACT MIN MAX + +" Rasterizer state group +syn keyword shaderslangStateGroupArg FillMode CullMode FrontCounterClockwise DepthBias DepthBiasClamp SlopeScaledDepthBias ZClipEnable DepthClipEnable ScissorEnable MultisampleEnable AntialiasedLineEnable +syn keyword shaderslangStateGroupVal SOLID WIREFRAME +syn keyword shaderslangStateGroupVal NONE FRONT BACK + +" Sampler state group +syn keyword shaderslangStateGroupArg Filter AddressU AddressV AddressW MipLODBias MaxAnisotropy ComparisonFunc BorderColor MinLOD MaxLOD ComparisonFilter +syn keyword shaderslangStateGroupVal MIN_MAG_MIP_POINT MIN_MAG_POINT_MIP_LINEAR MIN_POINT_MAG_LINEAR_MIP_POINT MIN_POINT_MAG_MIP_LINEAR MIN_LINEAR_MAG_MIP_POINT MIN_LINEAR_MAG_POINT_MIP_LINEAR MIN_MAG_LINEAR_MIP_POINT MIN_MAG_MIP_LINEAR ANISOTROPIC +syn keyword shaderslangStateGroupVal COMPARISON_MIN_MAG_MIP_POINT COMPARISON_MIN_MAG_POINT_MIP_LINEAR COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT COMPARISON_MIN_POINT_MAG_MIP_LINEAR COMPARISON_MIN_LINEAR_MAG_MIP_POINT +syn keyword shaderslangStateGroupVal COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR COMPARISON_MIN_MAG_LINEAR_MIP_POINT COMPARISON_MIN_MAG_MIP_LINEAR COMPARISON_ANISOTROPIC +syn keyword shaderslangStateGroupVal COMPARISON_NEVER COMPARISON_LESS COMPARISON_EQUAL COMPARISON_LESS_EQUAL COMPARISON_GREATER COMPARISON_NOT_EQUAL COMPARISON_GREATER_EQUAL COMPARISON_ALWAYS +syn keyword shaderslangStateGroupVal WRAP MIRROR CLAMP BORDER MIRROR_ONCE +syn keyword shaderslangStateGroupVal SAMPLER_FEEDBACK_MIN_MIP SAMPLER_FEEDBACK_MIP_REGION_USED + +" Ray flags +syn keyword shaderslangStateGroupVal RAY_FLAG_NONE RAY_FLAG_FORCE_OPAQUE RAY_FLAG_FORCE_NON_OPAQUE RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH RAY_FLAG_SKIP_CLOSEST_HIT_SHADER +syn keyword shaderslangStateGroupVal RAY_FLAG_CULL_BACK_FACING_TRIANGLES RAY_FLAG_CULL_FRONT_FACING_TRIANGLES RAY_FLAG_CULL_OPAQUE RAY_FLAG_CULL_NON_OPAQUE +syn keyword shaderslangStateGroupVal RAY_FLAG_SKIP_TRIANGLES RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES + +" HitKind enum +syn keyword shaderslangStateGroupVal HIT_KIND_TRIANGLE_FRONT_FACE HIT_KIND_TRIANGLE_BACK_FACE + +" RayQuery enums +syn keyword shaderslangStateGroupVal COMMITTED_NOTHING COMMITTED_TRIANGLE_HIT COMMITTED_PROCEDURAL_PRIMITIVE_HIT +syn keyword shaderslangStateGroupVal CANDIDATE_NON_OPAQUE_TRIANGLE CANDIDATE_PROCEDURAL_PRIMITIVE + +" Heap objects +syn keyword shaderslangStateGroupVal ResourceDescriptorHeap SamplerDescriptorHeap + +" Work graph constants +syn keyword shaderslangStateGroupVal UAV_MEMORY GROUP_SHARED_MEMORY NODE_INPUT_MEMORY NODE_OUTPUT_MEMORY ALL_MEMORY GROUP_SYNC GROUP_SCOPE DEVICE_SCOPE + +syn case match " Case sensitive from now on + +" Effect files declarations and functions +" Effect groups, techniques passes +syn keyword shaderslangEffectGroup fxgroup technique11 pass +" Effect functions +syn keyword shaderslangEffectFunc SetBlendState SetDepthStencilState SetRasterizerState SetVertexShader SetHullShader SetDomainShader SetGeometryShader SetPixelShader SetComputeShader CompileShader ConstructGSWithSO SetRenderTargets + +" Default highlighting +hi def link shaderslangProfile shaderslangStatement +hi def link shaderslangStateGroupArg shaderslangStatement +hi def link shaderslangStateGroupVal Number +hi def link shaderslangStatement Statement +hi def link shaderslangType Type +hi def link shaderslangTypeDeprec WarningMsg +hi def link shaderslangStorageClass StorageClass +hi def link shaderslangSemantic PreProc +hi def link shaderslangFunc shaderslangStatement +hi def link shaderslangLayoutQual shaderslangFunc +hi def link shaderslangAnnotation PreProc +hi def link shaderslangStructure Structure +hi def link shaderslangSwizzle SpecialChar +hi def link shaderslangAttribute Statement + +hi def link shaderslangEffectGroup Type +hi def link shaderslangEffectFunc Statement + +let b:current_syntax = "shaderslang" diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 54f038578e355..8f2fb4fc9ccb9 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -697,6 +697,7 @@ def s:GetFilenameChecks(): dict> 'user-dirs.defaults', 'user-dirs.dirs', 'makepkg.conf', '.makepkg.conf', 'file.mdd', '.env', '.envrc', 'devscripts.conf', '.devscripts', 'file.lo', 'file.la', 'file.lai'], + shaderslang: ['file.slang'], sieve: ['file.siv', 'file.sieve'], sil: ['file.sil'], simula: ['file.sim'], diff --git a/src/version.c b/src/version.c index 699ad36254aad..95567b7373cae 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 995, /**/ 994, /**/ From e0424b3348042d6486eee0273439c073ed96da15 Mon Sep 17 00:00:00 2001 From: "Philip H." <47042125+pheiduck@users.noreply.github.com> Date: Tue, 7 Jan 2025 20:43:29 +0100 Subject: [PATCH 13/28] CI: drop setup of snd-dummy module Apparently even when loading the snd-dummy kernel module, the CI tests for the sounds feature in test_sound.vim are already skipped. So let's just remove all of this (even so we may loose a bit of coverage information here). closes: #16391 Signed-off-by: Philip H. <47042125+pheiduck@users.noreply.github.com> Signed-off-by: Christian Brabandt --- .github/workflows/ci.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d49111f99d07..6d05b75f44cda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -215,21 +215,6 @@ jobs: sudo usermod -a -G audio "${USER}" sudo bash ci/setup-xvfb.sh - - name: Set up snd-dummy - if: (!(contains(matrix.extra, 'unittests') || contains(matrix.extra, 'vimtags'))) - env: - DEST_DIR: ${{ env.TMPDIR }}/linux-modules-extra-${{ env.LINUX_VERSION }} - uses: tecolicom/actions-use-apt-tools@main - with: - tools: linux-modules-extra-${{ env.LINUX_VERSION }} - path: "${DEST_DIR}" - - - name: modprobe snd-dummy - if: (!(contains(matrix.extra, 'unittests') || contains(matrix.extra, 'vimtags'))) - run: | - sudo depmod --verbose - sudo modprobe --verbose snd-dummy || true - - name: Check autoconf if: contains(matrix.extra, 'unittests') run: | From 1f045f324d0a8e9e897e5ed49c4e21aa9c2a538e Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 8 Jan 2025 14:09:02 +0100 Subject: [PATCH 14/28] runtime(doc): clarify buffer deletion on popup_close() Reported-by: Lifepillar Signed-off-by: Christian Brabandt --- runtime/doc/popup.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt index b1e6c0cb350d0..06acf3918b9c2 100644 --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -1,4 +1,4 @@ -*popup.txt* For Vim version 9.1. Last change: 2024 Dec 19 +*popup.txt* For Vim version 9.1. Last change: 2025 Jan 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -257,8 +257,8 @@ popup_clear([{force}]) popup_close({id} [, {result}]) *popup_close()* - Close popup {id}. The window and the associated buffer will - be deleted. + Close popup {id}. The window will be deleted. The associated + buffer will be deleted, if the popup created a new buffer. If the popup has a callback it will be called just before the popup window is deleted. If the optional {result} is present From 1718e7d07e391571ac81c507a746b3bc7a7e2024 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 8 Jan 2025 18:20:47 +0100 Subject: [PATCH 15/28] runtime(vim): Update base-syntax, improve ex-bang matching Always match ex-bang explicitly rather than incidentally as the ! operator. fixes: #16221 closes: #16410 Signed-off-by: Doug Kearns Signed-off-by: Christian Brabandt --- runtime/syntax/generator/vim.vim.base | 21 +++++++----- runtime/syntax/testdir/dumps/vim_expr_01.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_02.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_03.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_04.dump | 10 +++--- runtime/syntax/testdir/input/vim_expr.vim | 5 +++ runtime/syntax/vim.vim | 33 ++++++++++--------- 7 files changed, 43 insertions(+), 32 deletions(-) diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index d07c5e2f08ae7..28342680dbce5 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2024 Dec 21 +" Last Change: 2025 Jan 09 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -26,7 +26,7 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX syn cluster vimCommentGroup contains=vimTodo,@Spell " regular vim commands {{{2 -" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='' +" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang' " Lower priority for _new_ to distinguish constructors from the command. syn match vimCommand contained "\(\@!" @@ -205,7 +205,7 @@ syn case match syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 -syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand +syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" nextgroup=vimBang contains=vimCommand syn match vimBang contained "!" syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" @@ -214,7 +214,6 @@ syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>" syn match vimVar "\s\zs&t_k;" syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" syn keyword vimCommand contained in -syn match vimBang contained "!" syn cluster vimExprList contains=vimEnvvar,vimFunc,vimNumber,vimOper,vimOperParen,vimLetRegister,vimString,vimVar,@vim9ExprList syn cluster vim9ExprList contains=vim9Boolean,vim9Null @@ -282,7 +281,8 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan " Operators: {{{2 " ========= syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull -syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup @@ -558,8 +558,8 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend -syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+ extend +syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend +syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ @@ -681,10 +681,12 @@ endif " Autocmd: {{{2 " ======= -syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace +syn match vimAutoCmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoEventList +syn match vimAutoEventList contained "\%(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock -syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList +syn keyword vimAutoCmd au[tocmd] skipwhite nextgroup=vimAutoCmdBang,vimAutoEventList +syn keyword vimAutoCmd do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList @@ -1269,6 +1271,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimAugroupError vimError hi def link vimAugroupKey vimCommand hi def link vimAutoCmd vimCommand + hi def link vimAutoCmdBang vimBang hi def link vimAutoEvent Type hi def link vimAutoCmdMod Special hi def link vimBang vimOper diff --git a/runtime/syntax/testdir/dumps/vim_expr_01.dump b/runtime/syntax/testdir/dumps/vim_expr_01.dump index f1a7330368a70..81a4e21566c05 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_01.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_01.dump @@ -17,4 +17,4 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'@1|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|'| +0#0000000&@22 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|D|o|n|'|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|"| +0#0000000&@23 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 -@57|1|5|,|1| @9|2|0|%| +@57|1|5|,|1| @9|1|8|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_02.dump b/runtime/syntax/testdir/dumps/vim_expr_02.dump index 516a691043f9f..d1d443ec4cda3 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_02.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_02.dump @@ -17,4 +17,4 @@ @75 |"+0#0000e05&| |O|c|t|a|l| +0#0000000&@67 |e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 -@57|3@1|,|1| @9|5|0|%| +@57|3@1|,|1| @9|4|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_03.dump b/runtime/syntax/testdir/dumps/vim_expr_03.dump index 53001163838f6..90cd8c8655c13 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_03.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_03.dump @@ -17,4 +17,4 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|5+0#e000002&@1|.|0| +0#0000000&@65 |e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 -@57|5|1|,|1| @9|8|4|%| +@57|5|1|,|1| @9|7@1|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_04.dump b/runtime/syntax/testdir/dumps/vim_expr_04.dump index 4cb0891c38623..b7737c6420721 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_04.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_04.dump @@ -7,14 +7,14 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55 |e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53 |e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50 +@75 +@75 +|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 +|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 +@75 |~+0#4040ff13&| @73 |~| @73 |~| @73 |~| @73 |~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 | +0#0000000&@56|6|9|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index 610c2be0fbab2..8d30656ec17da 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -70,3 +70,8 @@ echo 0z echo 0zFF00ED015DAF echo 0zFF00.ED01.5DAF echo 0zFF.00.ED.01.5D.AF + + +" Issue #16221 (vimString becomes vimVar when preceded by !) +let bar = !'g:bar'->exists() + diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 2c7d91e8ff79c..1a2aa6eb6adf8 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 Jan 03 +" Last Change: 2025 Jan 09 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -26,13 +26,13 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX syn cluster vimCommentGroup contains=vimTodo,@Spell " regular vim commands {{{2 -" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='' -syn keyword vimCommand contained abo[veleft] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue] conf[irm] -syn keyword vimCommand contained cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] debugg[reedy] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] em[enu] en[dif] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] filt[er] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] hor[izontal] ij[ump] il[ist] imp[ort] int[ro] is[earch] -syn keyword vimCommand contained isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lv[imgrep] lvimgrepa[dd] lw[indow] ls m[ove] ma[rk] mak[e] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] -syn keyword vimCommand contained nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] -syn keyword vimCommand contained sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sil[ent] sla[st] sn[ext] so[urce] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] tj[ump] -syn keyword vimCommand contained tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim[grep] vimgrepa[dd] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i +" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang' +syn keyword vimCommand contained abo[veleft] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue] conf[irm] nextgroup=vimBang +syn keyword vimCommand contained cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] debugg[reedy] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] em[enu] en[dif] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] filt[er] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] hor[izontal] ij[ump] il[ist] imp[ort] int[ro] is[earch] nextgroup=vimBang +syn keyword vimCommand contained isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lv[imgrep] lvimgrepa[dd] lw[indow] ls m[ove] ma[rk] mak[e] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nextgroup=vimBang +syn keyword vimCommand contained nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] nextgroup=vimBang +syn keyword vimCommand contained sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sil[ent] sla[st] sn[ext] so[urce] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] tj[ump] nextgroup=vimBang +syn keyword vimCommand contained tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim[grep] vimgrepa[dd] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang " Lower priority for _new_ to distinguish constructors from the command. syn match vimCommand contained "\(\@!" @@ -243,7 +243,7 @@ syn case match syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 -syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand +syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" nextgroup=vimBang contains=vimCommand syn match vimBang contained "!" syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" @@ -252,7 +252,6 @@ syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>" syn match vimVar "\s\zs&t_k;" syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" syn keyword vimCommand contained in -syn match vimBang contained "!" syn cluster vimExprList contains=vimEnvvar,vimFunc,vimNumber,vimOper,vimOperParen,vimLetRegister,vimString,vimVar,@vim9ExprList syn cluster vim9ExprList contains=vim9Boolean,vim9Null @@ -320,7 +319,8 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan " Operators: {{{2 " ========= syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull -syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile +syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup @@ -598,8 +598,8 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend -syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+ extend +syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend +syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ @@ -723,10 +723,12 @@ syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod " Autocmd: {{{2 " ======= -syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace +syn match vimAutoCmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoEventList +syn match vimAutoEventList contained "\%(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock -syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList +syn keyword vimAutoCmd au[tocmd] skipwhite nextgroup=vimAutoCmdBang,vimAutoEventList +syn keyword vimAutoCmd do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList @@ -1315,6 +1317,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimAugroupError vimError hi def link vimAugroupKey vimCommand hi def link vimAutoCmd vimCommand + hi def link vimAutoCmdBang vimBang hi def link vimAutoEvent Type hi def link vimAutoCmdMod Special hi def link vimBang vimOper From e890887b8052561ac5f8dce218e578ed28599cc6 Mon Sep 17 00:00:00 2001 From: glepnir Date: Wed, 8 Jan 2025 18:30:45 +0100 Subject: [PATCH 16/28] patch 9.1.0996: ComplMatchIns may highlight wrong text Problem: ComplMatchIns may highlight wrong text Solution: don't highlight in case of fuzzy match, skip-highlight when not inserting anything (glepnir) closes: #16404 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- src/highlight.c | 3 ++- src/insexpand.c | 5 ++++- .../dumps/Test_pum_matchins_combine_07.dump | 20 +++++++++++++++++++ .../dumps/Test_pum_matchins_combine_08.dump | 20 +++++++++++++++++++ src/testdir/test_popup.vim | 14 +++++++++++++ src/version.c | 2 ++ 6 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 src/testdir/dumps/Test_pum_matchins_combine_07.dump create mode 100644 src/testdir/dumps/Test_pum_matchins_combine_08.dump diff --git a/src/highlight.c b/src/highlight.c index 628ceb2593729..f38abd86b6423 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -262,7 +262,8 @@ static char *(highlight_init_both[]) = { "default link PmenuMatchSel PmenuSel", "default link PmenuExtra Pmenu", "default link PmenuExtraSel PmenuSel", - CENT("ComplMatchIns cterm=NONE", "ComplMatchIns gui=NONE"), + CENT("ComplMatchIns ctermfg=DarkGrey cterm=NONE", + "ComplMatchIns guifg=DarkGrey gui=NONE"), CENT("Normal cterm=NONE", "Normal gui=NONE"), NULL }; diff --git a/src/insexpand.c b/src/insexpand.c index 818b1b96a1f76..22f021de7ef81 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -924,7 +924,10 @@ ins_compl_insert_bytes(char_u *p, int len) int ins_compl_col_range_attr(int col) { - if (col >= compl_col && col < compl_ins_end_col) + if ((get_cot_flags() & COT_FUZZY)) + return -1; + + if (col >= (compl_col + (int)compl_leader.length) && col < compl_ins_end_col) return syn_name2attr((char_u *)"ComplMatchIns"); return -1; diff --git a/src/testdir/dumps/Test_pum_matchins_combine_07.dump b/src/testdir/dumps/Test_pum_matchins_combine_07.dump new file mode 100644 index 0000000000000..60d5a670f0215 --- /dev/null +++ b/src/testdir/dumps/Test_pum_matchins_combine_07.dump @@ -0,0 +1,20 @@ +|f+8(ff4011@1|o+8#ffff4012#ff404010@1> +8#0000000#40ff4011@70 +| +0#0000001#e0e0e08|f|o@1| @11| +0#4040ff13#4040ff13@58 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |O|m|n|i| |c|o|m|p|l|e|t|i|o|n| |(|^|O|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@34 diff --git a/src/testdir/dumps/Test_pum_matchins_combine_08.dump b/src/testdir/dumps/Test_pum_matchins_combine_08.dump new file mode 100644 index 0000000000000..c0b414973026d --- /dev/null +++ b/src/testdir/dumps/Test_pum_matchins_combine_08.dump @@ -0,0 +1,20 @@ +|f+8(ff4011@1|o@1> @70 +| +0#0000001#e0e0e08|f|o@1| @11| +0#4040ff13#4040ff13@58 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |O|m|n|i| |c|o|m|p|l|e|t|i|o|n| |(|^|O|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@34 diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 729fbecffa44e..3f4836fa80322 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -1816,6 +1816,20 @@ func Test_pum_matchins_highlight_combine() call VerifyScreenDump(buf, 'Test_pum_matchins_combine_06', {}) call term_sendkeys(buf, "\") + " Does not highlight the compl leader + call TermWait(buf) + call term_sendkeys(buf, ":set cot+=menuone,noselect\") + call TermWait(buf) + call term_sendkeys(buf, "S\\f\") + call VerifyScreenDump(buf, 'Test_pum_matchins_combine_07', {}) + call term_sendkeys(buf, "\\") + + call term_sendkeys(buf, ":set cot+=fuzzy\") + call TermWait(buf) + call term_sendkeys(buf, "S\\f\") + call VerifyScreenDump(buf, 'Test_pum_matchins_combine_08', {}) + call term_sendkeys(buf, "\\") + call StopVimInTerminal(buf) endfunc diff --git a/src/version.c b/src/version.c index 95567b7373cae..38f46927d042a 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 996, /**/ 995, /**/ From 8ab1819df625354f6cc9b36cb46989e7b7c9ebae Mon Sep 17 00:00:00 2001 From: Jan-Arvid Harrach Date: Wed, 8 Jan 2025 20:02:04 +0100 Subject: [PATCH 17/28] runtime(xf86conf): add section name OutputClass to syntax script References: https://man.archlinux.org/man/xorg.conf.5#DESCRIPTION closes: #16397 Signed-off-by: Jan-Arvid Harrach --- runtime/syntax/xf86conf.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/syntax/xf86conf.vim b/runtime/syntax/xf86conf.vim index e8162f3a35e8a..0f4e5036ffdcb 100644 --- a/runtime/syntax/xf86conf.vim +++ b/runtime/syntax/xf86conf.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: XF86Config (XFree86 configuration file) +" Maintainer: This runtime file is looking for a new maintainer. +" Last Change: 2025 Jan 06 by Jan-Arvid Harrach (#16397) " Former Maintainer: David Ne\v{c}as (Yeti) " Last Change By David: 2010 Nov 01 -" Last Change: 2023 Jan 23 -" Required Vim Version: 6.0 " " Options: let xf86conf_xfree86_version = 3 or 4 " to force XFree86 3.x or 4.x XF86Config syntax @@ -58,7 +58,7 @@ syn match xf86confModeLineValue "\"[^\"]\+\"\(\_s\+[0-9.]\+\)\{9}" nextgroup=xf8 " Sections and subsections if b:xf86conf_xfree86_version >= 4 - syn region xf86confSection matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\)\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOption,xf86confKeyword,xf86confSectionError + syn region xf86confSection matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\|OutputClass\)\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOption,xf86confKeyword,xf86confSectionError syn region xf86confSectionModule matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Module\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionAny,xf86confComment,xf86confOption,xf86confKeyword syn region xf86confSectionMonitor matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Monitor\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionMode,xf86confModeLine,xf86confComment,xf86confOption,xf86confKeyword syn region xf86confSectionModes matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Modes\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionMode,xf86confModeLine,xf86confComment @@ -162,7 +162,7 @@ syn match xf86confSync "\(\s\+[+-][CHV]_*Sync\)\+" contained " Synchronization if b:xf86conf_xfree86_version >= 4 - syn sync match xf86confSyncSection grouphere xf86confSection "^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\)\"" + syn sync match xf86confSyncSection grouphere xf86confSection "^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Extensions\|Vendor\|Keyboard\|Pointer\|InputClass\|OutputClass\)\"" syn sync match xf86confSyncSectionModule grouphere xf86confSectionModule "^\s*Section\s\+\"Module\"" syn sync match xf86confSyncSectionModes groupthere xf86confSectionModes "^\s*Section\s\+\"Modes\"" else From a21240b97debea2e087aee6ad1488b5f075d1259 Mon Sep 17 00:00:00 2001 From: John Marriott Date: Wed, 8 Jan 2025 20:10:59 +0100 Subject: [PATCH 18/28] patch 9.1.0997: too many strlen() calls in drawscreen.c Problem: too many strlen() calls in drawscreen.c Solution: refactor drawscreen.c and remove calls to strlen(), make get_keymap_str() (in screen.c) return string length instead of TRUE/FALSE (John Marriott). Signed-off-by: John Marriott Signed-off-by: Christian Brabandt --- src/buffer.c | 48 ++++++------ src/drawscreen.c | 176 +++++++++++++++++++++---------------------- src/proto/buffer.pro | 4 +- src/screen.c | 20 +++-- src/version.c | 2 + 5 files changed, 126 insertions(+), 124 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index 147d20dc78f0f..a925552199a51 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -3914,7 +3914,7 @@ fileinfo( n); validate_virtcol(); len = STRLEN(buffer); - col_print((char_u *)buffer + len, IOSIZE - len, + (void)col_print((char_u *)buffer + len, IOSIZE - len, (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1); } @@ -3946,7 +3946,7 @@ fileinfo( vim_free(buffer); } - void + int col_print( char_u *buf, size_t buflen, @@ -3954,9 +3954,9 @@ col_print( int vcol) { if (col == vcol) - vim_snprintf((char *)buf, buflen, "%d", col); - else - vim_snprintf((char *)buf, buflen, "%d-%d", col, vcol); + return vim_snprintf((char *)buf, buflen, "%d", col); + + return vim_snprintf((char *)buf, buflen, "%d-%d", col, vcol); } static char_u *lasttitle = NULL; @@ -4820,7 +4820,7 @@ build_stl_str_hl( case STL_ALTPERCENT: str = buf_tmp; - get_rel_pos(wp, str, TMPLEN); + (void)get_rel_pos(wp, str, TMPLEN); break; case STL_SHOWCMD: @@ -4837,7 +4837,7 @@ build_stl_str_hl( case STL_KEYMAP: fillable = FALSE; - if (get_keymap_str(wp, (char_u *)"<%s>", buf_tmp, TMPLEN)) + if (get_keymap_str(wp, (char_u *)"<%s>", buf_tmp, TMPLEN) > 0) str = buf_tmp; break; case STL_PAGENUM: @@ -5271,7 +5271,7 @@ build_stl_str_hl( * Get relative cursor position in window into "buf[buflen]", in the localized * percentage form like %99, 99%; using "Top", "Bot" or "All" when appropriate. */ - void + int get_rel_pos( win_T *wp, char_u *buf, @@ -5279,9 +5279,10 @@ get_rel_pos( { long above; // number of lines above window long below; // number of lines below window + int len; if (buflen < 3) // need at least 3 chars for writing - return; + return 0; above = wp->w_topline - 1; #ifdef FEAT_DIFF above += diff_check_fill(wp, wp->w_topline) - wp->w_topfill; @@ -5292,28 +5293,27 @@ get_rel_pos( #endif below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1; if (below <= 0) - vim_strncpy(buf, (char_u *)(above == 0 ? _("All") : _("Bot")), - (size_t)(buflen - 1)); + len = vim_snprintf((char *)buf, buflen, "%s", (above == 0) ? _("All") : _("Bot")); else if (above <= 0) - vim_strncpy(buf, (char_u *)_("Top"), (size_t)(buflen - 1)); + len = vim_snprintf((char *)buf, buflen, "%s", _("Top")); else { int perc = (above > 1000000L) - ? (int)(above / ((above + below) / 100L)) - : (int)(above * 100L / (above + below)); + ? (int)(above / ((above + below) / 100L)) + : (int)(above * 100L / (above + below)); - char *p = (char *)buf; - size_t l = buflen; - if (perc < 10) - { - // prepend one space - buf[0] = ' '; - ++p; - --l; - } // localized percentage value - vim_snprintf(p, l, _("%d%%"), perc); + len = vim_snprintf((char *)buf, buflen, _("%s%d%%"), (perc < 10) ? " " : "", perc); } + if (len < 0) + { + buf[0] = NUL; + len = 0; + } + else if (len > buflen - 1) + len = buflen - 1; + + return len; } /* diff --git a/src/drawscreen.c b/src/drawscreen.c index 778cda4d4f4f5..36034cc9dfc86 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -425,11 +425,8 @@ statusline_row(win_T *wp) win_redr_status(win_T *wp, int ignore_pum UNUSED) { int row; - char_u *p; - int len; int fillchar; int attr; - int this_ru_col; static int busy = FALSE; // It's possible to get here recursively when 'statusline' (indirectly) @@ -463,11 +460,17 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) #endif else { + char_u *p; + int plen; + int NameBufflen; + int this_ru_col; + int n; // scratch value + fillchar = fillchar_status(&attr, wp); get_trans_bufname(wp->w_buffer); p = NameBuff; - len = (int)STRLEN(p); + plen = (int)STRLEN(p); if ((bt_help(wp->w_buffer) #ifdef FEAT_QUICKFIX @@ -475,74 +478,61 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) #endif || bufIsChanged(wp->w_buffer) || wp->w_buffer->b_p_ro) - && len < MAXPATHL - 1) - *(p + len++) = ' '; + && plen < MAXPATHL - 1) + *(p + plen++) = ' '; if (bt_help(wp->w_buffer)) - { - vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Help]")); - len += (int)STRLEN(p + len); - } + plen += vim_snprintf((char *)p + plen, MAXPATHL - plen, "%s", _("[Help]")); #ifdef FEAT_QUICKFIX if (wp->w_p_pvw) - { - vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Preview]")); - len += (int)STRLEN(p + len); - } + plen += vim_snprintf((char *)p + plen, MAXPATHL - plen, "%s", _("[Preview]")); #endif if (bufIsChanged(wp->w_buffer) && !bt_terminal(wp->w_buffer)) - { - vim_snprintf((char *)p + len, MAXPATHL - len, "%s", "[+]"); - len += (int)STRLEN(p + len); - } + plen += vim_snprintf((char *)p + plen, MAXPATHL - plen, "%s", "[+]"); if (wp->w_buffer->b_p_ro) - { - vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[RO]")); - len += (int)STRLEN(p + len); - } + plen += vim_snprintf((char *)p + plen, MAXPATHL - plen, "%s", _("[RO]")); this_ru_col = ru_col - (Columns - wp->w_width); - if (this_ru_col < (wp->w_width + 1) / 2) - this_ru_col = (wp->w_width + 1) / 2; + n = (wp->w_width + 1) / 2; + if (this_ru_col < n) + this_ru_col = n; if (this_ru_col <= 1) { p = (char_u *)"<"; // No room for file name! - len = 1; + plen = 1; } else if (has_mbyte) { - int clen = 0, i; + int i; // Count total number of display cells. - clen = mb_string2cells(p, -1); + plen = mb_string2cells(p, -1); // Find first character that will fit. // Going from start to end is much faster for DBCS. - for (i = 0; p[i] != NUL && clen >= this_ru_col - 1; + for (i = 0; p[i] != NUL && plen >= this_ru_col - 1; i += (*mb_ptr2len)(p + i)) - clen -= (*mb_ptr2cells)(p + i); - len = clen; + plen -= (*mb_ptr2cells)(p + i); if (i > 0) { p = p + i - 1; *p = '<'; - ++len; + ++plen; } - } - else if (len > this_ru_col - 1) + else if (plen > this_ru_col - 1) { - p += len - (this_ru_col - 1); + p += plen - (this_ru_col - 1); *p = '<'; - len = this_ru_col - 1; + plen = this_ru_col - 1; } screen_puts(p, row, wp->w_wincol, attr); - screen_fill(row, row + 1, len + wp->w_wincol, + screen_fill(row, row + 1, plen + wp->w_wincol, this_ru_col + wp->w_wincol, fillchar, fillchar, attr); - if (get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL) - && (this_ru_col - len) > (int)(STRLEN(NameBuff) + 1)) - screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff) + if ((NameBufflen = get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL)) > 0 + && (this_ru_col - plen) > (NameBufflen + 1)) + screen_puts(NameBuff, row, (int)(this_ru_col - NameBufflen - 1 + wp->w_wincol), attr); win_redr_ruler(wp, TRUE, ignore_pum); @@ -550,7 +540,8 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) // Draw the 'showcmd' information if 'showcmdloc' == "statusline". if (p_sc && *p_sloc == 's') { - int width = MIN(10, this_ru_col - len - 2); + n = this_ru_col - plen - 2; // perform the calculation here so we only do it once + int width = MIN(10, n); if (width > 0) screen_puts_len(showcmd_buf, width, row, @@ -631,19 +622,7 @@ showruler(int always) void win_redr_ruler(win_T *wp, int always, int ignore_pum) { -#define RULER_BUF_LEN 70 - char_u buffer[RULER_BUF_LEN]; - int row; - int fillchar; - int attr; - int empty_line = FALSE; - colnr_T virtcol; - int i; - size_t len; - int o; - int this_ru_col; - int off = 0; - int width; + int empty_line = FALSE; // If 'ruler' off don't do anything if (!p_ru) @@ -661,6 +640,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) if (wp == lastwin && lastwin->w_status_height == 0) if (edit_submode != NULL) return; + // Don't draw the ruler when the popup menu is visible, it may overlap. // Except when the popup menu will be redrawn anyway. if (!ignore_pum && pum_visible()) @@ -698,6 +678,21 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) #endif || empty_line != wp->w_ru_empty) { + int row; + int fillchar; + int attr; + int off; + int width; + colnr_T virtcol; +#define RULER_BUF_LEN 70 + char_u buffer[RULER_BUF_LEN]; + int bufferlen; + char_u rel_pos[RULER_BUF_LEN]; + int rel_poslen; + int this_ru_col; + int n1; // scratch value + int n2; // scratch value + cursor_off(); if (wp->w_status_height) { @@ -724,16 +719,11 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) wp->w_p_list = TRUE; } - /* - * Some sprintfs return the length, some return a pointer. - * To avoid portability problems we use strlen() here. - */ - vim_snprintf((char *)buffer, RULER_BUF_LEN, "%ld,", + bufferlen = vim_snprintf((char *)buffer, RULER_BUF_LEN, "%ld,", (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) ? 0L : (long)(wp->w_cursor.lnum)); - len = STRLEN(buffer); - col_print(buffer + len, RULER_BUF_LEN - len, + bufferlen += col_print(buffer + bufferlen, RULER_BUF_LEN - bufferlen, empty_line ? 0 : (int)wp->w_cursor.col + 1, (int)virtcol + 1); @@ -742,56 +732,60 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) * On the last line, don't print in the last column (scrolls the * screen up on some terminals). */ - i = (int)STRLEN(buffer); - get_rel_pos(wp, buffer + i + 1, RULER_BUF_LEN - i - 1); - o = i + vim_strsize(buffer + i + 1); + rel_poslen = get_rel_pos(wp, rel_pos, RULER_BUF_LEN); + n1 = bufferlen + vim_strsize(rel_pos); if (wp->w_status_height == 0) // can't use last char of screen - ++o; + ++n1; + this_ru_col = ru_col - (Columns - width); - if (this_ru_col < 0) - this_ru_col = 0; // Never use more than half the window/screen width, leave the other // half for the filename. - if (this_ru_col < (width + 1) / 2) - this_ru_col = (width + 1) / 2; - if (this_ru_col + o < width) - { - // need at least 3 chars left for get_rel_pos() + NUL - while (this_ru_col + o < width && RULER_BUF_LEN > i + 4) + n2 = (width + 1) / 2; + if (this_ru_col < n2) + this_ru_col = n2; + if (this_ru_col + n1 < width) + { + // need at least space for rel_pos + NUL + while (this_ru_col + n1 < width + && RULER_BUF_LEN > bufferlen + rel_poslen + 1) // +1 for NUL { if (has_mbyte) - i += (*mb_char2bytes)(fillchar, buffer + i); + bufferlen += (*mb_char2bytes)(fillchar, buffer + bufferlen); else - buffer[i++] = fillchar; - ++o; + buffer[bufferlen++] = fillchar; + ++n1; } - get_rel_pos(wp, buffer + i, RULER_BUF_LEN - i); + bufferlen += vim_snprintf((char *)buffer + bufferlen, RULER_BUF_LEN - bufferlen, + "%s", rel_pos); } // Truncate at window boundary. if (has_mbyte) { - o = 0; - for (i = 0; buffer[i] != NUL; i += (*mb_ptr2len)(buffer + i)) + for (n1 = 0, n2 = 0; buffer[n1] != NUL; n1 += (*mb_ptr2len)(buffer + n1)) { - o += (*mb_ptr2cells)(buffer + i); - if (this_ru_col + o > width) + n2 += (*mb_ptr2cells)(buffer + n1); + if (this_ru_col + n2 > width) { - buffer[i] = NUL; + bufferlen = n1; + buffer[bufferlen] = NUL; break; } } } - else if (this_ru_col + (int)STRLEN(buffer) > width) - buffer[width - this_ru_col] = NUL; + else if (this_ru_col + bufferlen > width) + { + bufferlen = width - this_ru_col; + buffer[bufferlen] = NUL; + } screen_puts(buffer, row, this_ru_col + off, attr); - i = redraw_cmdline; + n1 = redraw_cmdline; screen_fill(row, row + 1, - this_ru_col + off + (int)STRLEN(buffer), + this_ru_col + off + bufferlen, (off + width), fillchar, fillchar, attr); // don't redraw the cmdline because of showing the ruler - redraw_cmdline = i; + redraw_cmdline = n1; wp->w_ru_cursor = wp->w_cursor; wp->w_ru_virtcol = wp->w_virtcol; wp->w_ru_empty = empty_line; @@ -948,9 +942,10 @@ text_to_screenline(win_T *wp, char_u *text, int col) else { int len = (int)STRLEN(text); + int n = wp->w_width - col; - if (len > wp->w_width - col) - len = wp->w_width - col; + if (len > n) + len = n; if (len > 0) { #ifdef FEAT_RIGHTLEFT @@ -1217,7 +1212,7 @@ fold_line( } } - sprintf((char *)buf, fmt, w, num); + vim_snprintf((char *)buf, sizeof(buf), fmt, w, num); #ifdef FEAT_RIGHTLEFT if (wp->w_p_rl) // the line number isn't reversed @@ -2048,8 +2043,7 @@ win_update(win_T *wp) { colnr_T t; - pos.col = (int)STRLEN(ml_get_buf(wp->w_buffer, - pos.lnum, FALSE)); + pos.col = (int)ml_get_buf_len(wp->w_buffer, pos.lnum); getvvcol(wp, &pos, NULL, NULL, &t); if (toc < t) toc = t; diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro index dc68ca8fc123f..5491940daf35c 100644 --- a/src/proto/buffer.pro +++ b/src/proto/buffer.pro @@ -44,12 +44,12 @@ void buflist_altfpos(win_T *win); int otherfile(char_u *ffname); void buf_setino(buf_T *buf); void fileinfo(int fullname, int shorthelp, int dont_truncate); -void col_print(char_u *buf, size_t buflen, int col, int vcol); +int col_print(char_u *buf, size_t buflen, int col, int vcol); void maketitle(void); void resettitle(void); void free_titles(void); int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, char_u *opt_name, int opt_scope, int fillchar, int maxwidth, stl_hlrec_T **hltab, stl_hlrec_T **tabtab); -void get_rel_pos(win_T *wp, char_u *buf, int buflen); +int get_rel_pos(win_T *wp, char_u *buf, int buflen); char_u *fix_fname(char_u *fname); void fname_expand(buf_T *buf, char_u **ffname, char_u **sfname); void ex_buffer_all(exarg_T *eap); diff --git a/src/screen.c b/src/screen.c index 35d300213b616..8fb17ae87a636 100644 --- a/src/screen.c +++ b/src/screen.c @@ -968,20 +968,21 @@ get_keymap_str( int len) // length of buffer { char_u *p; + int plen; if (wp->w_buffer->b_p_iminsert != B_IMODE_LMAP) - return FALSE; + return 0; #ifdef FEAT_EVAL buf_T *old_curbuf = curbuf; win_T *old_curwin = curwin; + char_u to_evaluate[] = "b:keymap_name"; char_u *s; curbuf = wp->w_buffer; curwin = wp; - STRCPY(buf, "b:keymap_name"); // must be writable ++emsg_skip; - s = p = eval_to_string(buf, FALSE, FALSE); + s = p = eval_to_string(to_evaluate, FALSE, FALSE); --emsg_skip; curbuf = old_curbuf; curwin = old_curwin; @@ -995,12 +996,17 @@ get_keymap_str( #endif p = (char_u *)"lang"; } - if (vim_snprintf((char *)buf, len, (char *)fmt, p) > len - 1) - buf[0] = NUL; + plen = vim_snprintf((char *)buf, len, (char *)fmt, p); #ifdef FEAT_EVAL vim_free(s); #endif - return buf[0] != NUL; + if (plen < 0 || plen > len - 1) + { + buf[0] = NUL; + plen = 0; + } + + return plen; } #if defined(FEAT_STL_OPT) || defined(PROTO) @@ -4133,7 +4139,7 @@ showmode(void) else # endif if (get_keymap_str(curwin, (char_u *)" (%s)", - NameBuff, MAXPATHL)) + NameBuff, MAXPATHL) > 0) msg_puts_attr((char *)NameBuff, attr); } #endif diff --git a/src/version.c b/src/version.c index 38f46927d042a..22efc7e6bb8fb 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 997, /**/ 996, /**/ From 4f73c07abff420bad9fa5befc2c284c00b984993 Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Wed, 8 Jan 2025 20:20:06 +0100 Subject: [PATCH 19/28] patch 9.1.0998: filetype: TI assembly files are not recognized Problem: filetype: TI assembly files are not recognized Solution: inspect '*.sa' and assembly files and detect TI assembly files, include filetype plugin and syntax script for TI assembly files (Wu, Zhenyu) closes: #15827 Signed-off-by: Wu, Zhenyu Signed-off-by: Christian Brabandt --- .github/MAINTAINERS | 2 + runtime/autoload/dist/ft.vim | 14 ++++- runtime/filetype.vim | 6 +- runtime/ftplugin/tiasm.vim | 18 ++++++ runtime/syntax/tiasm.vim | 102 ++++++++++++++++++++++++++++++++++ src/testdir/test_filetype.vim | 17 +++++- src/version.c | 2 + 7 files changed, 156 insertions(+), 5 deletions(-) create mode 100644 runtime/ftplugin/tiasm.vim create mode 100644 runtime/syntax/tiasm.vim diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index 80965385e4125..6052197de55b4 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -292,6 +292,7 @@ runtime/ftplugin/tcsh.vim @dkearns runtime/ftplugin/terraform.vim @JannoTjarks runtime/ftplugin/tf.vim @ribru17 runtime/ftplugin/thrift.vim @jiangyinzuo +runtime/ftplugin/tiasm.vim @Freed-Wu runtime/ftplugin/tidy.vim @dkearns runtime/ftplugin/tmux.vim @ericpruitt runtime/ftplugin/toml.vim @averms @@ -610,6 +611,7 @@ runtime/syntax/tcsh.vim @dkearns runtime/syntax/teraterm.vim @k-takata runtime/syntax/terraform.vim @gpanders runtime/syntax/thrift.vim @jiangyinzuo +runtime/syntax/tiasm.vim @Freed-Wu runtime/syntax/tidy.vim @dkearns runtime/syntax/tmux.vim @ericpruitt runtime/syntax/toml.vim @averms diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index ce7f44fa65ac8..f1e6ee272bbb6 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: The Vim Project -# Last Change: 2024 May 23 +# Last Change: 2025 Jan 08 # Former Maintainer: Bram Moolenaar # These functions are moved here from runtime/filetype.vim to make startup @@ -32,6 +32,10 @@ enddef # This function checks for the kind of assembly that is wanted by the user, or # can be detected from the first five lines of the file. export def FTasm() + # tiasm uses `* commment` + if join(getline(1, 10), "\n") =~ '\%(\%(^\|\n\)\*\|Texas Instruments Incorporated\)' + setf tiasm + endif # make sure b:asmsyntax exists if !exists("b:asmsyntax") b:asmsyntax = "" @@ -1003,6 +1007,14 @@ export def SQL() endif enddef +export def FTsa() + if join(getline(1, 4), "\n") =~# '\%(^\|\n\);' + setf tiasm + return + endif + setf sather +enddef + # This function checks the first 25 lines of file extension "sc" to resolve # detection between scala and SuperCollider. # NOTE: We don't check for 'Class : Method', as this can easily be confused diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 737f881000eed..154ce79cb6fbe 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: The Vim Project -" Last Change: 2024 Dec 31 +" Last Change: 2025 Jan 08 " Former Maintainer: Bram Moolenaar " Listen very carefully, I will say this only once @@ -2200,8 +2200,8 @@ au BufNewFile,BufRead *.sas setf sas " Sass au BufNewFile,BufRead *.sass setf sass -" Sather -au BufNewFile,BufRead *.sa setf sather +" Sather, TI linear assembly +au BufNewFile,BufRead *.sa call dist#ft#FTsa() " Scala au BufNewFile,BufRead *.scala setf scala diff --git a/runtime/ftplugin/tiasm.vim b/runtime/ftplugin/tiasm.vim new file mode 100644 index 0000000000000..13a3dc64f7c1a --- /dev/null +++ b/runtime/ftplugin/tiasm.vim @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Language: TI linear assembly language +" Maintainer: Wu, Zhenyu +" Last Change: 2025 Jan 08 + +if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 + +setlocal comments=:; +setlocal commentstring=;\ %s + +let b:undo_ftplugin = "setl commentstring< comments<" + +if exists("loaded_matchit") + let b:match_words = '^\s\+\.if\>:^\s\+\.elseif:^\s\+\.else\>:^\s\+\.endif\>,^\s\+\.group:^\s\+\.gmember:^\s\+\.endgroup,^\s\+\.loop:^\s\+\.break:^\s\+\.endloop,^\s\+\.macro:^\s\+\.mexit:^\s\+\.endm,^\s\+\.asmfunc:^\s\+\.endasmfunc,^\s\+\.c\?struct:^\s\+\.endstruct,^\s\+\.c\?union:^\s\+\.endunion,^\s\+\.c\?proc:^\s\+\.return:^\s\+\.endproc' + let b:match_ignorecase = 1 + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" +endif diff --git a/runtime/syntax/tiasm.vim b/runtime/syntax/tiasm.vim new file mode 100644 index 0000000000000..bdadc4a0a78b6 --- /dev/null +++ b/runtime/syntax/tiasm.vim @@ -0,0 +1,102 @@ +" Vim syntax file +" Language: TI linear assembly language +" Document: https://downloads.ti.com/docs/esd/SPRUI03B/#SPRUI03B_HTML/assembler-description.html +" Maintainer: Wu, Zhenyu +" Last Change: 2025 Jan 08 + +if exists("b:current_syntax") + finish +endif + +syn case ignore + +" storage types +syn match tiasmType "\.bits" +syn match tiasmType "\.byte" +syn match tiasmType "\.char" +syn match tiasmType "\.cstring" +syn match tiasmType "\.double" +syn match tiasmType "\.field" +syn match tiasmType "\.float" +syn match tiasmType "\.half" +syn match tiasmType "\.int" +syn match tiasmType "\.long" +syn match tiasmType "\.short" +syn match tiasmType "\.string" +syn match tiasmType "\.ubyte" +syn match tiasmType "\.uchar" +syn match tiasmType "\.uhalf" +syn match tiasmType "\.uint" +syn match tiasmType "\.ulong" +syn match tiasmType "\.ushort" +syn match tiasmType "\.uword" +syn match tiasmType "\.word" + +syn match tiasmIdentifier "[a-z_][a-z0-9_]*" + +syn match tiasmDecimal "\<[1-9]\d*\>" display +syn match tiasmOctal "\<0[0-7][0-7]\+\>\|\<[0-7]\+[oO]\>" display +syn match tiasmHexadecimal "\<0[xX][0-9a-fA-F]\+\>\|\<[0-9][0-9a-fA-F]*[hH]\>" display +syn match tiasmBinary "\<0[bB][0-1]\+\>\|\<[01]\+[bB]\>" display + +syn match tiasmFloat "\<\d\+\.\d*\%(e[+-]\=\d\+\)\=\>" display +syn match tiasmFloat "\<\d\%(e[+-]\=\d\+\)\>" display + +syn match tiasmCharacter "'.'\|''\|'[^']'" + +syn region tiasmString start="\"" end="\"" skip="\"\"" + +syn match tiasmFunction "\$[a-zA-Z_][a-zA-Z_0-9]*\ze(" + +syn keyword tiasmTodo contained TODO FIXME XXX NOTE +syn region tiasmComment start=";" end="$" keepend contains=tiasmTodo,@Spell +syn match tiasmComment "^[*!].*" contains=tiasmTodo,@Spell +syn match tiasmLabel "^[^ *!;][^ :]*" + +syn match tiasmInclude "\.include" +syn match tiasmCond "\.if" +syn match tiasmCond "\.else" +syn match tiasmCond "\.endif" +syn match tiasmMacro "\.macro" +syn match tiasmMacro "\.endm" + +syn match tiasmDirective "\.[A-Za-z][0-9A-Za-z-_]*" + +syn case match + +hi def link tiasmLabel Label +hi def link tiasmComment Comment +hi def link tiasmTodo Todo +hi def link tiasmDirective Statement + +hi def link tiasmInclude Include +hi def link tiasmCond PreCondit +hi def link tiasmMacro Macro + +if exists('g:tiasm_legacy_syntax_groups') + hi def link hexNumber Number + hi def link decNumber Number + hi def link octNumber Number + hi def link binNumber Number + hi def link tiasmHexadecimal hexNumber + hi def link tiasmDecimal decNumber + hi def link tiasmOctal octNumber + hi def link tiasmBinary binNumber +else + hi def link tiasmHexadecimal Number + hi def link tiasmDecimal Number + hi def link tiasmOctal Number + hi def link tiasmBinary Number +endif +hi def link tiasmFloat Float + +hi def link tiasmString String +hi def link tiasmStringEscape Special +hi def link tiasmCharacter Character +hi def link tiasmCharacterEscape Special + +hi def link tiasmIdentifier Identifier +hi def link tiasmType Type +hi def link tiasmFunction Function + +let b:current_syntax = "lineartiasm" diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 8f2fb4fc9ccb9..6d64d9df6ede3 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -676,7 +676,6 @@ def s:GetFilenameChecks(): dict> samba: ['smb.conf'], sas: ['file.sas'], sass: ['file.sass'], - sather: ['file.sa'], sbt: ['file.sbt'], scala: ['file.scala'], scheme: ['file.scm', 'file.ss', 'file.sld', 'file.stsg', 'any/local/share/supertux2/config', '.lips_repl_history'], @@ -2331,6 +2330,22 @@ func Test_cmd_file() filetype off endfunc +func Test_sa_file() + filetype on + + call writefile([';* XXX-a.sa: XXX for TI C6000 DSP *;', '.no_mdep'], 'Xfile.sa') + split Xfile.sa + call assert_equal('tiasm', &filetype) + bwipe! + + call writefile(['-- comment'], 'Xfile.sa') + split Xfile.sa + call assert_equal('sather', &filetype) + bwipe! + + filetype off +endfunc + func Test_sig_file() filetype on diff --git a/src/version.c b/src/version.c index 22efc7e6bb8fb..49a3523a21b9a 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 998, /**/ 997, /**/ From df4a7d761740d59a4f911c9e13ac620a459cdea6 Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Thu, 9 Jan 2025 22:09:16 +0100 Subject: [PATCH 20/28] runtime(tiasm): use correct syntax name tiasm in syntax script closes: #16416 Signed-off-by: Wu, Zhenyu Signed-off-by: Christian Brabandt --- runtime/syntax/tiasm.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/syntax/tiasm.vim b/runtime/syntax/tiasm.vim index bdadc4a0a78b6..c79596bdfe008 100644 --- a/runtime/syntax/tiasm.vim +++ b/runtime/syntax/tiasm.vim @@ -99,4 +99,4 @@ hi def link tiasmIdentifier Identifier hi def link tiasmType Type hi def link tiasmFunction Function -let b:current_syntax = "lineartiasm" +let b:current_syntax = "tiasm" From 2051af1642843426714efc2572c3e270fe0948be Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Thu, 9 Jan 2025 22:14:34 +0100 Subject: [PATCH 21/28] patch 9.1.0999: Vim9: leaking finished exception Problem: leaking finished exception (after v9.1.0984) Solution: use finish_exception to clean up caught exceptions (Yee Cheng Chin) In Vimscript, v:exception/throwpoint/stacktrace are supposed to reflect the currently caught exception, and be popped after the exception is finished (via endtry, finally, or a thrown exception inside catch). Vim9script does not handle this properly, and leaks them instead. This is clearly visible when launching GVim with menu enabled. A caught exception inside the s:BMShow() in menu.vim would show up when querying `v:stacktrace` even though the exception was already caught and handled. To fix this, just use the same functionality as Vimscript by calling `finish_exception` to properly restore the states. Note that this assumes `current_exception` is always the same as `caught_stack` which believe should be the case. Added tests for this. Also fix up test_stacktrace to properly test the stack restore behavior where we have nested exceptions in catch blocks and to also test the vim9script functionality properly. - Also, remove its dependency on explicitly checking a line number in runtest.vim which is a very fragile way to write tests as any minor change in runtest.vim (shared among all tests) would require changing test_stacktrace.vim. We don't actually need such granularity in the test. closes: #16413 Signed-off-by: Yee Cheng Chin Signed-off-by: Christian Brabandt --- src/ex_eval.c | 2 +- src/proto/ex_eval.pro | 1 + src/testdir/test_stacktrace.vim | 20 +++++++++--- src/testdir/test_vim9_script.vim | 53 ++++++++++++++++++++++++++++++++ src/version.c | 2 ++ src/vim9execute.c | 28 +++++++++++------ 6 files changed, 91 insertions(+), 15 deletions(-) diff --git a/src/ex_eval.c b/src/ex_eval.c index e996ce2a12b01..3c865c396511d 100644 --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -718,7 +718,7 @@ catch_exception(except_T *excp) /* * Remove an exception from the caught stack. */ - static void + void finish_exception(except_T *excp) { if (excp != caught_stack) diff --git a/src/proto/ex_eval.pro b/src/proto/ex_eval.pro index 979d6fb8f499c..feffc8fb023f7 100644 --- a/src/proto/ex_eval.pro +++ b/src/proto/ex_eval.pro @@ -11,6 +11,7 @@ char *get_exception_string(void *value, except_type_T type, char_u *cmdname, int int throw_exception(void *value, except_type_T type, char_u *cmdname); void discard_current_exception(void); void catch_exception(except_T *excp); +void finish_exception(except_T *excp); void exception_state_save(exception_state_T *estate); void exception_state_restore(exception_state_T *estate); void exception_state_clear(void); diff --git a/src/testdir/test_stacktrace.vim b/src/testdir/test_stacktrace.vim index 5c71d5023d352..fc8510a2d1477 100644 --- a/src/testdir/test_stacktrace.vim +++ b/src/testdir/test_stacktrace.vim @@ -10,7 +10,7 @@ func Filepath(name) endfunc func AssertStacktrace(expect, actual) - call assert_equal(#{lnum: 617, filepath: Filepath('runtest.vim')}, a:actual[0]) + call assert_equal(Filepath('runtest.vim'), a:actual[0]['filepath']) call assert_equal(a:expect, a:actual[-len(a:expect):]) endfunc @@ -97,6 +97,12 @@ func Test_vstacktrace() call Xfunc1() catch let stacktrace = v:stacktrace + try + call Xfunc1() + catch + let stacktrace_inner = v:stacktrace + endtry + let stacktrace_after = v:stacktrace " should be restored by the exception stack to the previous one endtry call assert_equal([], v:stacktrace) call AssertStacktrace([ @@ -104,9 +110,15 @@ func Test_vstacktrace() \ #{funcref: funcref('Xfunc1'), lnum: 5, filepath: Filepath('Xscript1')}, \ #{funcref: funcref('Xfunc2'), lnum: 4, filepath: Filepath('Xscript2')}, \ ], stacktrace) + call AssertStacktrace([ + \ #{funcref: funcref('Test_vstacktrace'), lnum: 101, filepath: s:thisfile}, + \ #{funcref: funcref('Xfunc1'), lnum: 5, filepath: Filepath('Xscript1')}, + \ #{funcref: funcref('Xfunc2'), lnum: 4, filepath: Filepath('Xscript2')}, + \ ], stacktrace_inner) + call assert_equal(stacktrace, stacktrace_after) endfunc -func Test_zzz_stacktrace_vim9() +func Test_stacktrace_vim9() let lines =<< trim [SCRIPT] var stacktrace = getstacktrace() assert_notequal([], stacktrace) @@ -122,11 +134,9 @@ func Test_zzz_stacktrace_vim9() assert_true(has_key(d, 'lnum')) endfor endtry + call assert_equal([], v:stacktrace) [SCRIPT] call v9.CheckDefSuccess(lines) - " FIXME: v:stacktrace is not cleared after the exception handling, and this - " test has to be run as the last one because of this. - " call assert_equal([], v:stacktrace) endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 550c725dd7641..b29f3cd80c455 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -945,6 +945,47 @@ def Test_try_catch_throw() endif END v9.CheckDefAndScriptSuccess(lines) + + # test that the v:exception stacks are correctly restored + try + try + throw 101 + catch + assert_equal('101', v:exception) + try + catch + finally + assert_equal('101', v:exception) # finally shouldn't clear if it doesn't own it + endtry + assert_equal('101', v:exception) + throw 102 # Re-throw inside catch block + endtry + catch + assert_equal('102', v:exception) + try + throw 103 # throw inside nested exception stack + catch + assert_equal('103', v:exception) + endtry + assert_equal('102', v:exception) # restored stack + finally + assert_equal('', v:exception) # finally should clear if it owns the exception + endtry + try + try + throw 104 + catch + try + exec 'nonexistent_cmd' # normal exception inside nested exception stack + catch + assert_match('E492:', v:exception) + endtry + eval [][0] # normal exception inside catch block + endtry + catch + assert_match('E684:', v:exception) + endtry + assert_equal('', v:exception) # All exceptions properly popped enddef def Test_unreachable_after() @@ -1417,11 +1458,23 @@ def Test_throw_line_number() eval 2 + 2 throw 'exception' enddef + def Func2() + eval 1 + 1 + eval 2 + 2 + eval 3 + 3 + throw 'exception' + enddef try Func() catch /exception/ + try + Func2() + catch /exception/ + assert_match('line 4', v:throwpoint) + endtry assert_match('line 3', v:throwpoint) endtry + assert_match('', v:throwpoint) enddef diff --git a/src/version.c b/src/version.c index 49a3523a21b9a..46b7e355958f4 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 999, /**/ 998, /**/ diff --git a/src/vim9execute.c b/src/vim9execute.c index d6962804b361d..c7f0e673b2284 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -3281,7 +3281,15 @@ exec_instructions(ectx_T *ectx) trycmd_T *trycmd = ((trycmd_T *)trystack->ga_data) + trystack->ga_len - 1; if (trycmd->tcd_frame_idx == ectx->ec_frame_idx) - trycmd->tcd_caught = FALSE; + { + if (trycmd->tcd_caught) + { + // Inside a "catch" we need to first discard the caught + // exception. + finish_exception(caught_stack); + trycmd->tcd_caught = FALSE; + } + } } } @@ -4972,6 +4980,12 @@ exec_instructions(ectx_T *ectx) // Reset the index to avoid a return statement jumps here // again. trycmd->tcd_finally_idx = 0; + if (trycmd->tcd_caught) + { + // discard the exception + finish_exception(caught_stack); + trycmd->tcd_caught = FALSE; + } break; } @@ -4986,12 +5000,10 @@ exec_instructions(ectx_T *ectx) trycmd = ((trycmd_T *)trystack->ga_data) + trystack->ga_len; if (trycmd->tcd_did_throw) did_throw = TRUE; - if (trycmd->tcd_caught && current_exception != NULL) + if (trycmd->tcd_caught) { // discard the exception - if (caught_stack == current_exception) - caught_stack = caught_stack->caught; - discard_current_exception(); + finish_exception(caught_stack); } if (trycmd->tcd_return) @@ -5040,12 +5052,10 @@ exec_instructions(ectx_T *ectx) { trycmd_T *trycmd = ((trycmd_T *)trystack->ga_data) + trystack->ga_len - 1; - if (trycmd->tcd_caught && current_exception != NULL) + if (trycmd->tcd_caught) { // discard the exception - if (caught_stack == current_exception) - caught_stack = caught_stack->caught; - discard_current_exception(); + finish_exception(caught_stack); trycmd->tcd_caught = FALSE; } } From ebea31e454b9a1731cde845226f2c28ca5c097b1 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Thu, 9 Jan 2025 22:23:29 +0100 Subject: [PATCH 22/28] patch 9.1.1000: tests: ruby tests fail with Ruby 3.4 Problem: tests: ruby tests fail with Ruby 3.4 Solution: adjust expected output for Ruby 3.4 (Yee Cheng Chin) Vim's Ruby tests relied on explicit matching of output texts which are fragile in design. Ruby 3.4 has changed the output slightly (using 'name' instead of `name', and also using more spaces in dictionary printouts). Modify the Vim tests to be less fragile to such changes. closes: #16411 Signed-off-by: Yee Cheng Chin Signed-off-by: Christian Brabandt --- src/testdir/test_ruby.vim | 6 +++--- src/version.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim index f1551685ca6fe..cc5f4193f7577 100644 --- a/src/testdir/test_ruby.vim +++ b/src/testdir/test_ruby.vim @@ -290,7 +290,7 @@ func Test_ruby_Vim_buffer_get() call assert_match('Xfoo1$', rubyeval('Vim::Buffer[1].name')) call assert_match('Xfoo2$', rubyeval('Vim::Buffer[2].name')) call assert_fails('ruby print Vim::Buffer[3].name', - \ "NoMethodError: undefined method `name' for nil") + \ "NoMethodError") %bwipe endfunc @@ -372,7 +372,7 @@ func Test_ruby_Vim_evaluate_dict() redir => l:out ruby d = Vim.evaluate("d"); print d redir END - call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, "\n")) + call assert_equal(['{"a"=>"foo","b"=>123}'], split(substitute(l:out, '\s', '', 'g'), "\n")) endfunc " Test Vim::message({msg}) (display message {msg}) @@ -391,7 +391,7 @@ func Test_ruby_print() call assert_equal('1.23', RubyPrint('1.23')) call assert_equal('Hello World!', RubyPrint('"Hello World!"')) call assert_equal('[1, 2]', RubyPrint('[1, 2]')) - call assert_equal('{"k1"=>"v1", "k2"=>"v2"}', RubyPrint('({"k1" => "v1", "k2" => "v2"})')) + call assert_equal('{"k1"=>"v1","k2"=>"v2"}', substitute(RubyPrint('({"k1" => "v1", "k2" => "v2"})'), '\s', '', 'g')) call assert_equal('true', RubyPrint('true')) call assert_equal('false', RubyPrint('false')) call assert_equal('', RubyPrint('nil')) diff --git a/src/version.c b/src/version.c index 46b7e355958f4..baebd2b1c560d 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1000, /**/ 999, /**/ From 51754c8a498c39592250a077f56db89dd261995d Mon Sep 17 00:00:00 2001 From: Yochem van Rosmalen Date: Fri, 10 Jan 2025 19:54:13 +0100 Subject: [PATCH 23/28] runtime(editorconfig): set omnifunc to syntaxcomplete func closes: #16419 Signed-off-by: Yochem van Rosmalen Signed-off-by: Riley Bruins Signed-off-by: Christian Brabandt --- runtime/ftplugin/editorconfig.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/ftplugin/editorconfig.vim b/runtime/ftplugin/editorconfig.vim index 6d437351eb055..1693a95c0b315 100644 --- a/runtime/ftplugin/editorconfig.vim +++ b/runtime/ftplugin/editorconfig.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: EditorConfig " Maintainer: Riley Bruins -" Last Change: 2024 Jul 06 +" Last Change: 2025 Jan 10 if exists('b:did_ftplugin') finish @@ -10,4 +10,6 @@ let b:did_ftplugin = 1 setl comments=:#,:; commentstring=#\ %s -let b:undo_ftplugin = 'setl com< cms<' +setl omnifunc=syntaxcomplete#Complete + +let b:undo_ftplugin = 'setl com< cms< ofu<' From 695522dea3703cf1b4cd4a894ca9a745a0d2756f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 10 Jan 2025 20:02:17 +0100 Subject: [PATCH 24/28] runtime(vim): Update base-syntax, highlight literal string quote escape Match the '' escape sequence in literal strings. These were previously ending the current string and starting another concatenated literal string. closes: #16415 Signed-off-by: Christian Brabandt Signed-off-by: Doug Kearns --- runtime/syntax/generator/vim.vim.base | 11 +++--- runtime/syntax/testdir/dumps/vim_expr_00.dump | 2 +- runtime/syntax/testdir/dumps/vim_expr_01.dump | 10 +++--- runtime/syntax/testdir/dumps/vim_expr_02.dump | 32 ++++++++--------- runtime/syntax/testdir/dumps/vim_expr_03.dump | 34 +++++++++---------- runtime/syntax/testdir/dumps/vim_expr_04.dump | 34 +++++++++---------- runtime/syntax/testdir/dumps/vim_expr_05.dump | 20 +++++++++++ runtime/syntax/testdir/input/vim_expr.vim | 14 ++++++++ runtime/syntax/vim.vim | 11 +++--- 9 files changed, 104 insertions(+), 64 deletions(-) create mode 100644 runtime/syntax/testdir/dumps/vim_expr_05.dump diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index 28342680dbce5..b3bc5ca6f72c3 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -558,19 +558,21 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend +syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend +syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ contains=vimQuoteEscape extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ + syn match vimEscape contained "\\." " syn match vimEscape contained +\\[befnrt\"]+ syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}" syn match vimEscape contained "\\<" contains=vimNotation syn match vimEscape contained "\\<\*[^>]*>\=>" +syn match vimQuoteEscape contained "''" -syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend -syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ contains=vimQuoteEscape,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList syn match vimStringInterpolationBrace contained "{{" syn match vimStringInterpolationBrace contained "}}" @@ -1392,6 +1394,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimPattern Type hi def link vimPlainMark vimMark hi def link vimPlainRegister vimRegister + hi def link vimQuoteEscape vimEscape hi def link vimRegister SpecialChar hi def link vimScriptDelim Comment hi def link vimSearchDelim Statement diff --git a/runtime/syntax/testdir/dumps/vim_expr_00.dump b/runtime/syntax/testdir/dumps/vim_expr_00.dump index 899b73cd91a6c..b8ea410bc4a8f 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_00.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_00.dump @@ -1,6 +1,6 @@ >"+0#0000e05#ffffff0| |S|t|r|i|n|g| +0#0000000&@66 @75 -|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|I|t|'@1|s| |a| |s|t|r|i|n|g|'| +0#0000000&@53 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|I|t|'+0#e000e06&@1|s+0#e000002&| |a| |s|t|r|i|n|g|'| +0#0000000&@53 |e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|t|a|b|:| |\|t|,| |n|e|w| |l|i|n|e|:| |\|n|,| |b|a|c|k|s|l|a|s|h|:| |\@1|'| +0#0000000&@31 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|t|a|b|:| |\+0#e000e06&|t|,+0#e000002&| |n|e|w| |l|i|n|e|:| |\+0#e000e06&|n|,+0#e000002&| |b|a|c|k|s|l|a|s|h|:| |\+0#e000e06&@1|"+0#e000002&| +0#0000000&@31 @75 diff --git a/runtime/syntax/testdir/dumps/vim_expr_01.dump b/runtime/syntax/testdir/dumps/vim_expr_01.dump index 81a4e21566c05..7dfc6d4ecb10f 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_01.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_01.dump @@ -12,9 +12,9 @@ |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|C|-|>@1|>+0#e000002&|"| +0#0000000&@60 |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|\+0#e000e06&|<|*|C|-|>@1|>+0#e000002&|"| +0#0000000&@59 @75 -|"+0#0000e05&| |S|t|r|i|n|g| |i|n|t|e|r|p|o|l|a|t|i|o|n| +0#0000000&@52 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|'+0#e000e06&@1|f+0#e000002&|o@1|'| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@59 @75 -|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'@1|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|'| +0#0000000&@22 -|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|D|o|n|'|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|"| +0#0000000&@23 -|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 -@57|1|5|,|1| @9|1|8|%| +@57|1|5|,|1| @9|1|4|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_02.dump b/runtime/syntax/testdir/dumps/vim_expr_02.dump index d1d443ec4cda3..37e5b041198f2 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_02.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_02.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 +| +0&#ffffff0@74 +|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|i|n|c|o|r@1|e|c|t|l|y| |m|a|t|c|h|e|s| |a|s| |v|i|m|S|t|r|i|n|g| |v|i|m|M|a|r|k| |v|i|m|O|p|e|r| |N|O|N|E|)| +0#0000000& +|"+0#0000e05&| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|t|p|o|p|e|/|v|i|m|-|u|n|i|m|p|a|i|r|e|d|/|b|l|o|b|/|6|d|4@1|a|6|d|c|2|e|c|3|4|6|0|7|c|4|1|e|c|7|8|a|c|f|8|1 +|6|5|7|2|4|8|5|8|0|b|f|1|/|p|l|u|g|i|n|/|u|n|i|m|p|a|i|r|e|d|.|v|i|m|#|L|2|3|2| +0#0000000&@35 +|l+0#af5f00255&|e|t| +0#0000000&|c+0#00e0e07&|m|d| +0#0000000&|=+0#af5f00255&| +0#0000000&|'+0#e000002&|p|u|t|!|=|r|e|p|e|a|t|(|n|r|2|c|h|a|r|(|1|0|)|,| |v|:|c|o|u|n|t|1|)|||s|i|l|e|n|t| |'+0#e000e06&@1|]+0#e000002&|+|'| +0#0000000&@16 +> @74 +|"+0#0000e05&| |S|t|r|i|n|g| |i|n|t|e|r|p|o|l|a|t|i|o|n| +0#0000000&@52 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|'+0#e000002&|D|o|n|'+0#e000e06&@1|t+0#e000002&| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|'| +0#0000000&@22 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|D|o|n|'|t| |h|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:| |{@1| |{|1| |+| |2|}| |}@1|"| +0#0000000&@23 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|'+0#e000002&|f|o@1|'|:+0#0000000&| |'+0#e000002&|b|a|r|'|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@8 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|'|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@6 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|"+0#e000002&|f|o@1|"|:+0#0000000&| |"+0#e000002&|b|a|r|"|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@8 |e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|"|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@6 @75 ->"+0#0000e05&| |N|u|m|b|e|r| +0#0000000&@66 -@75 -|"+0#0000e05&| |H|e|x|a|d|e|c|i|m|a|l| +0#0000000&@61 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|x|F@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|X|F@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|x|F@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|X|F@1| +0#0000000&@64 -@75 -|"+0#0000e05&| |D|e|c|i|m|a|l| +0#0000000&@65 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|2+0#e000002&|5@1| +0#0000000&@65 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|2+0#e000002&|5@1| +0#0000000&@65 -@75 -|"+0#0000e05&| |O|c|t|a|l| +0#0000000&@67 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 -@57|3@1|,|1| @9|4|6|%| +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|'+0#e000e06&@1|f+0#e000002&|o@1|'| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|'+0#e000002&| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@58 +@57|3|2|,|0|-|1| @7|3|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_03.dump b/runtime/syntax/testdir/dumps/vim_expr_03.dump index 90cd8c8655c13..178468d477811 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_03.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_03.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|$+0#e000002&|'|f|o@1|'+0#e000e06&@1|b+0#e000002&|a|r|'| +0#0000000&@58 +@75 +|"+0#0000e05&| |N|u|m|b|e|r| +0#0000000&@66 +@75 +|"+0#0000e05&| |H|e|x|a|d|e|c|i|m|a|l| +0#0000000&@61 +>e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|x|F@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|X|F@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|x|F@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|X|F@1| +0#0000000&@64 +@75 +|"+0#0000e05&| |D|e|c|i|m|a|l| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|2+0#e000002&|5@1| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|2+0#e000002&|5@1| +0#0000000&@65 +@75 +|"+0#0000e05&| |O|c|t|a|l| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|3|7@1| +0#0000000&@64 |e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|o|3|7@1| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|O|3|7@1| +0#0000000&@63 |e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|o|3|7@1| +0#0000000&@63 ->e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|O|3|7@1| +0#0000000&@63 -@75 -|"+0#0000e05&| |B|i|n|a|r|y| +0#0000000&@66 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|b|1@7| +0#0000000&@58 -|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|B|1@7| +0#0000000&@58 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|b|1@7| +0#0000000&@58 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|B|1@7| +0#0000000&@58 -@75 -|"+0#0000e05&| |F|l|o|a|t| +0#0000000&@67 -|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@62 -|e+0#af5f00255&|c|h|o| +0#0000000&|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@62 -|e+0#af5f00255&|c|h|o| +0#0000000&|5+0#e000002&@1|.|0| +0#0000000&@65 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@63 -|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 -@57|5|1|,|1| @9|7@1|%| +@57|5|0|,|1| @9|6|1|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_04.dump b/runtime/syntax/testdir/dumps/vim_expr_04.dump index b7737c6420721..1a054e6cda0f4 100644 --- a/runtime/syntax/testdir/dumps/vim_expr_04.dump +++ b/runtime/syntax/testdir/dumps/vim_expr_04.dump @@ -1,20 +1,20 @@ -|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 -|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|0|E|-|6| +0#0000000&@63 -|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@58 -@75 -|"+0#0000e05&| |B|l|o|b| +0#0000000&@68 ->e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z| +0#0000000&@67 -|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55 -|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53 -|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50 +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|o|3|7@1| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|O|3|7@1| +0#0000000&@63 @75 +|"+0#0000e05&| |B|i|n|a|r|y| +0#0000000&@66 +>e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|b|1@7| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|B|1@7| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|b|1@7| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|B|1@7| +0#0000000&@58 @75 -|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 -|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 +|"+0#0000e05&| |F|l|o|a|t| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|5+0#e000002&@1|.|0| +0#0000000&@65 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@61 +|e+0#af5f00255&|c|h|o| +0#0000000&|1+0#e000002&|.|0|E|-|6| +0#0000000&@63 +|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@58 @75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|6|9|,|1| @9|B|o|t| +@57|6|8|,|1| @9|8|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_expr_05.dump b/runtime/syntax/testdir/dumps/vim_expr_05.dump new file mode 100644 index 0000000000000..2c0a189bbac64 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_expr_05.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@74 +|"+0#0000e05&| |B|l|o|b| +0#0000000&@68 +|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z| +0#0000000&@67 +|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55 +|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53 +>e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50 +@75 +@75 +|"+0#0000e05&| |I|s@1|u|e| |#|1|6|2@1|1| |(|v|i|m|S|t|r|i|n|g| |b|e|c|o|m|e|s| |v|i|m|V|a|r| |w|h|e|n| |p|r|e|c|e|d|e|d| |b|y| |!|)| +0#0000000&@14 +|l+0#af5f00255&|e|t| +0#0000000&|b+0#00e0e07&|a|r| +0#0000000&|=+0#af5f00255&| +0#0000000&|!+0#af5f00255&|'+0#e000002&|g|:|b|a|r|'|-+0#af5f00255&|>|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|)| +0#0000000&@46 +@75 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +| +0#0000000&@56|8|6|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index 8d30656ec17da..316f462caeba8 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -21,6 +21,15 @@ echo "\<*C->>" echo "\>>" echo "\<*C->>>" +echo '''' +echo '''foo' +echo 'foo''' +echo 'foo''bar' + +" Unreported issue (incorrectly matches as vimString vimMark vimOper NONE) +" https://github.com/tpope/vim-unimpaired/blob/6d44a6dc2ec34607c41ec78acf81657248580bf1/plugin/unimpaired.vim#L232 +let cmd = 'put!=repeat(nr2char(10), v:count1)|silent '']+' + " String interpolation echo 'Don''t highlight interpolation: {{ {1 + 2} }}' @@ -30,6 +39,11 @@ echo $'Highlight interpolation:\t{{ { $'nested: {{ {1 + 2} }}' } }}' echo $"Highlight interpolation:\t{{ { string({"foo": "bar"}) } }}" echo $"Highlight interpolation:\t{{ { $"nested: {{ {1 + 2} }}" } }}" +echo $'''' +echo $'''foo' +echo $'foo''' +echo $'foo''bar' + " Number " Hexadecimal diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 1a2aa6eb6adf8..04fc8c1fad6ca 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -598,19 +598,21 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend -syn region vimString oneline keepend start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ extend +syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend +syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ contains=vimQuoteEscape extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ + syn match vimEscape contained "\\." " syn match vimEscape contained +\\[befnrt\"]+ syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}" syn match vimEscape contained "\\<" contains=vimNotation syn match vimEscape contained "\\<\*[^>]*>\=>" +syn match vimQuoteEscape contained "''" -syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend -syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ contains=vimQuoteEscape,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList syn match vimStringInterpolationBrace contained "{{" syn match vimStringInterpolationBrace contained "}}" @@ -1438,6 +1440,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimPattern Type hi def link vimPlainMark vimMark hi def link vimPlainRegister vimRegister + hi def link vimQuoteEscape vimEscape hi def link vimRegister SpecialChar hi def link vimScriptDelim Comment hi def link vimSearchDelim Statement From ad409876d9cf7e565f99c5e21b9e2e400a83a4d4 Mon Sep 17 00:00:00 2001 From: glepnir Date: Fri, 10 Jan 2025 20:08:20 +0100 Subject: [PATCH 25/28] patch 9.1.1001: ComplMatchIns highlight hard to read on light background Problem: ComplMatchIns highlight hard to read on light background (after v9.1.0996) Solution: define the highlighting group cleared, it should be configured in colorschemes separately (glepnir) closes: #16414 Signed-off-by: glepnir Signed-off-by: Christian Brabandt --- runtime/doc/options.txt | 5 +++-- src/highlight.c | 2 -- src/optiondefs.h | 2 +- src/version.c | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 489415c780608..780db60aba41f 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2024 Dec 28 +*options.txt* For Vim version 9.1. Last change: 2025 Jan 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4348,7 +4348,7 @@ A jump table for the options with a short description can be found at |Q_op|. #:TabLineSel,_:TabLineFill,!:CursorColumn, .:CursorLine,o:ColorColumn,q:QuickFixLine, z:StatusLineTerm,Z:StatusLineTermNC, - g:MsgArea") + g:MsgArea,h:ComplMatchIns") global This option can be used to set highlighting mode for various occasions. It is a comma-separated list of character pairs. The @@ -4368,6 +4368,7 @@ A jump table for the options with a short description can be found at |Q_op|. |hl-MoreMsg| m |more-prompt| |hl-ModeMsg| M Mode (e.g., "-- INSERT --") |hl-MsgArea| g |Command-line| and message area + |hl-ComplMatchIns| h matched text of currently inserted completion |hl-LineNr| n line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. |hl-LineNrAbove| a line number above the cursor for when the diff --git a/src/highlight.c b/src/highlight.c index f38abd86b6423..1a4c76d9439e3 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -262,8 +262,6 @@ static char *(highlight_init_both[]) = { "default link PmenuMatchSel PmenuSel", "default link PmenuExtra Pmenu", "default link PmenuExtraSel PmenuSel", - CENT("ComplMatchIns ctermfg=DarkGrey cterm=NONE", - "ComplMatchIns guifg=DarkGrey gui=NONE"), CENT("Normal cterm=NONE", "Normal gui=NONE"), NULL }; diff --git a/src/optiondefs.h b/src/optiondefs.h index f9b7eae1ff821..c7c96de298bfa 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -302,7 +302,7 @@ struct vimoption # define ISP_LATIN1 (char_u *)"@,161-255" #endif -# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea" +# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea,h:ComplMatchIns" // Default python version for pyx* commands #if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3) diff --git a/src/version.c b/src/version.c index baebd2b1c560d..77128722bdbd2 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1001, /**/ 1000, /**/ From 668e9f24037fc7c362ffdf5fc1d5c5b1a8b0e855 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 11 Jan 2025 09:19:12 +0100 Subject: [PATCH 26/28] runtime(filetype): don't detect string interpolation as angular fixes: #16375 Signed-off-by: Christian Brabandt --- runtime/autoload/dist/ft.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index f1e6ee272bbb6..47b2fede17708 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: The Vim Project -# Last Change: 2025 Jan 08 +# Last Change: 2025 Jan 11 # Former Maintainer: Bram Moolenaar # These functions are moved here from runtime/filetype.vim to make startup @@ -437,7 +437,7 @@ export def FThtml() while n < 40 && n <= line("$") # Check for Angular - if getline(n) =~ '@\(if\|for\|defer\|switch\)\|\*\(ngIf\|ngFor\|ngSwitch\|ngTemplateOutlet\)\|ng-template\|ng-content\|{{.*}}' + if getline(n) =~ '@\(if\|for\|defer\|switch\)\|\*\(ngIf\|ngFor\|ngSwitch\|ngTemplateOutlet\)\|ng-template\|ng-content' setf htmlangular return endif From c10342da449155b874ddc4b4a5beb92159ee96b7 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sat, 11 Jan 2025 09:39:01 +0100 Subject: [PATCH 27/28] patch 9.1.1002: Vim9: unknown func error with interface declaring func var Problem: Vim9: unknown function error with interface declaring a function variable (lifepillar) Solution: Use correct instruction for getting interface member variables (Yegappan Lakshmanan) fixes: #16345 closes: #16421 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- src/testdir/test_vim9_class.vim | 25 +++++++++++++++++++++++++ src/testdir/test_vim9_disassemble.vim | 25 +++++++++++++++++++++++++ src/version.c | 2 ++ src/vim9expr.c | 11 +++++++++-- 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index 799230a98b00c..c20de25337dc2 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -7257,6 +7257,31 @@ def Test_interface_extends_with_dup_members() v9.CheckSourceSuccess(lines) enddef +" Test for implementing an interface with different ordering for the interface +" member variables. +def Test_implement_interface_with_different_variable_order() + var lines =<< trim END + vim9script + + interface IX + var F: func(): string + endinterface + + class X implements IX + var x: number + var F: func(): string = () => 'ok' + endclass + + def Foo(ix: IX): string + return ix.F() + enddef + + var x0 = X.new(0) + assert_equal('ok', Foo(x0)) + END + v9.CheckSourceSuccess(lines) +enddef + " Test for using "any" type for a variable in a sub-class while it has a " concrete type in the interface def Test_implements_using_var_type_any() diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim index 7746b23b41468..2dc925a3536a2 100644 --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -3586,4 +3586,29 @@ def Test_disassemble_member_initializer() unlet g:instr enddef +" Disassemble the code generated for accessing a interface member variable +def Test_disassemble_interface_variable_access() + var lines =<< trim END + vim9script + interface IX + var F: func(): string + endinterface + + def Foo(ix: IX): string + return ix.F() + enddef + + g:instr = execute('disassemble Foo') + END + v9.CheckScriptSuccess(lines) + assert_match('\d\+_Foo\_s*' .. + 'return ix.F()\_s*' .. + '0 LOAD arg\[-1\]\_s*' .. + '1 ITF_MEMBER 0 on IX\_s*' .. + '2 PCALL top (argc 0)\_s*' .. + '3 PCALL end\_s*' .. + '4 RETURN', g:instr) + unlet g:instr +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/version.c b/src/version.c index 77128722bdbd2..f79eb15f84de9 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1002, /**/ 1001, /**/ diff --git a/src/vim9expr.c b/src/vim9expr.c index cfdea7bc41387..9a96034543f7a 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -392,8 +392,15 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type) } else { - if (generate_GET_OBJ_MEMBER(cctx, m_idx, ocm->ocm_type) == - FAIL) + int status; + + if (IS_INTERFACE(cl)) + status = generate_GET_ITF_MEMBER(cctx, cl, m_idx, + ocm->ocm_type); + else + status = generate_GET_OBJ_MEMBER(cctx, m_idx, + ocm->ocm_type); + if (status == FAIL) return FAIL; } } From 9598a6369bce32d3da831e8968caf4625985ac3c Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 11 Jan 2025 10:14:24 +0100 Subject: [PATCH 28/28] runtime(doc): add package- helptags for included packages Improve how to find the justify package closes: #16420 Co-authored-by: Peter Benjamin Signed-off-by: Christian Brabandt --- runtime/doc/helphelp.txt | 6 +++--- runtime/doc/quickfix.txt | 6 +++--- runtime/doc/tags | 11 +++++++++++ runtime/doc/terminal.txt | 4 ++-- runtime/doc/usr_02.txt | 9 ++++++++- runtime/doc/usr_05.txt | 10 +++++----- runtime/doc/usr_25.txt | 8 ++++---- 7 files changed, 36 insertions(+), 18 deletions(-) diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 3ba0920626591..7b9dd7671c63b 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 9.1. Last change: 2024 Dec 26 +*helphelp.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -247,10 +247,10 @@ command: > (requires write permission there): > :helptags $VIMRUNTIME/doc < - *:HelpToc* *help-TOC* *help-toc-install* + *:HelpToc* *help-TOC* *help-toc-install* *package-helptoc* If you want to access an interactive table of contents, from any position in -the file, you can use the helptoc plugin. Load the plugin with: > +the file, you can use the helptoc plugin. Load the plugin with: >vim packadd helptoc diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index b6d79507ffa4e..834f0e1b6ee86 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2024 Dec 27 +*quickfix.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -550,9 +550,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: < Otherwise it works the same as `:ldo`. FILTERING A QUICKFIX OR LOCATION LIST: - *cfilter-plugin* *:Cfilter* *:Lfilter* + *cfilter-plugin* *:Cfilter* *:Lfilter* *package-cfilter* If you have too many entries in a quickfix list, you can use the cfilter -plugin to reduce the number of entries. Load the plugin with: > +plugin to reduce the number of entries. Load the plugin with: >vim packadd cfilter diff --git a/runtime/doc/tags b/runtime/doc/tags index a2996794f7bcc..2fc28d724165a 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -2129,6 +2129,7 @@ $quote eval.txt /*$quote* :GnatTags ft_ada.txt /*:GnatTags* :HelpToc helphelp.txt /*:HelpToc* :Hexplore pi_netrw.txt /*:Hexplore* +:Justify usr_25.txt /*:Justify* :LP pi_logipat.txt /*:LP* :LPE pi_logipat.txt /*:LPE* :LPF pi_logipat.txt /*:LPF* @@ -5567,6 +5568,7 @@ J change.txt /*J* Japanese mbyte.txt /*Japanese* Job eval.txt /*Job* Jobs eval.txt /*Jobs* +Justify() usr_25.txt /*Justify()* K various.txt /*K* KDE gui_x11.txt /*KDE* KVim gui_x11.txt /*KVim* @@ -8538,6 +8540,7 @@ jump-motions motion.txt /*jump-motions* jumplist motion.txt /*jumplist* jumplist-stack motion.txt /*jumplist-stack* jumpto-diffs diff.txt /*jumpto-diffs* +justify usr_25.txt /*justify* k motion.txt /*k* kcc uganda.txt /*kcc* kde gui_x11.txt /*kde* @@ -9384,9 +9387,17 @@ out_name channel.txt /*out_name* out_timeout channel.txt /*out_timeout* p change.txt /*p* pack-add repeat.txt /*pack-add* +package-cfilter quickfix.txt /*package-cfilter* +package-comment usr_05.txt /*package-comment* package-create repeat.txt /*package-create* package-doc repeat.txt /*package-doc* package-documentation repeat.txt /*package-documentation* +package-editorconfig usr_05.txt /*package-editorconfig* +package-helptoc helphelp.txt /*package-helptoc* +package-justify usr_25.txt /*package-justify* +package-matchit usr_05.txt /*package-matchit* +package-nohlsearch usr_05.txt /*package-nohlsearch* +package-termdebug terminal.txt /*package-termdebug* package-translate_example repeat.txt /*package-translate_example* package-translation repeat.txt /*package-translation* packages repeat.txt /*packages* diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index 7e2d8982458d6..1fcc470db8a12 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 9.1. Last change: 2024 Dec 30 +*terminal.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1254,7 +1254,7 @@ Alternatively, press "s" to swap the first and second dump. Do this several times so that you can spot the difference in the context of the text. ============================================================================== -6. Debugging *terminal-debug* *terminal-debugger* +6. Debugging *terminal-debug* *terminal-debugger* *package-termdebug* The Terminal debugging plugin can be used to debug a program with gdb and view the source code in a Vim window. Since this is completely contained inside diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index 70d24d3dd94c3..a02835d86bed9 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -1,4 +1,4 @@ -*usr_02.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*usr_02.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM USER MANUAL - by Bram Moolenaar @@ -694,6 +694,13 @@ Summary: *help-summary* > :help E128 < takes you to the |:function| command +27) Documenction for packages distributed with Vim have the form package-. + So > + :help package-comment +< + will bring you to the help section for the included comment plugin and how to + enable it. + ============================================================================== diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index ca6b910754e3c..93231f6cd1815 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -1,4 +1,4 @@ -*usr_05.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*usr_05.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM USER MANUAL - by Bram Moolenaar @@ -392,7 +392,7 @@ The ":map" command (with no arguments) lists your current mappings. At least the ones for Normal mode. More about mappings in section |40.1|. ============================================================================== -*05.5* Adding a package *add-package* *matchit-install* +*05.5* Adding a package *add-package* *matchit-install* *package-matchit* A package is a set of files that you can add to Vim. There are two kinds of packages: optional and automatically loaded on startup. @@ -427,7 +427,7 @@ an archive or as a repository. For an archive you can follow these steps: Here "fancytext" is the name of the package, it can be anything else. -Adding the editorconfig package *editorconfig-install* +Adding the editorconfig package *editorconfig-install* *package-editorconfig* Similar to the matchit package, to load the distributed editorconfig plugin when Vim starts, add the following line to your vimrc file: > @@ -437,7 +437,7 @@ After restarting your Vim, the plugin is active and you can read about it at: > :h editorconfig.txt -Adding comment package *comment-install* +Adding comment package *comment-install* *package-comment* Load the plugin with this command: > packadd comment @@ -450,7 +450,7 @@ the package loaded. Once the package is loaded, read about it at: > :h comment.txt -Adding nohlsearch package *nohlsearch-install* +Adding nohlsearch package *nohlsearch-install* *package-nohlsearch* Load the plugin with this command: > packadd nohlsearch diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt index af013bcfe77da..5b4df0d0e6c89 100644 --- a/runtime/doc/usr_25.txt +++ b/runtime/doc/usr_25.txt @@ -1,4 +1,4 @@ -*usr_25.txt* For Vim version 9.1. Last change: 2016 Mar 28 +*usr_25.txt* For Vim version 9.1. Last change: 2025 Jan 11 VIM USER MANUAL - by Bram Moolenaar @@ -190,15 +190,15 @@ This results in the following: story. ~ -JUSTIFYING TEXT +JUSTIFYING TEXT *justify* *:Justify* *Justify()* *package-justify* Vim has no built-in way of justifying text. However, there is a neat macro package that does the job. To use this package, execute the following -command: > +command: >vim :packadd justify -Or put this line in your |vimrc|: > +Or put this line in your |vimrc|: >vim packadd! justify