Commit: patch 9.1.0275: filetype: R history files are not recognized
patch 9.1.0275: filetype: R history files are not recognized Commit: https://github.com/vim/vim/commit/fc21b6437ce91368c2d53437177083b8bc375720 Author: Wu, Zhenyu Date: Mon Apr 8 20:26:29 2024 +0200 patch 9.1.0275: filetype: R history files are not recognized Problem: filetype: R history files are not recognized Solution: Detect '.Rhistory' files as r filetype (Wu, Zhenyu) closes: #14440 Signed-off-by: Wu, Zhenyu Signed-off-by: Christian Brabandt diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 99a12d996..b3f3c4d22 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1841,7 +1841,7 @@ else endif " R profile file -au BufNewFile,BufRead .Rprofile,Rprofile,Rprofile.site setf r +au BufNewFile,BufRead .Rhistory,.Rprofile,Rprofile,Rprofile.site setf r " RSS looks like XML au BufNewFile,BufRead *.rsssetf xml diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index a26a3f08f..6021e960c 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -570,7 +570,7 @@ def s:GetFilenameChecks(): dict> qmldir: ['qmldir'], quake: ['anybaseq2/file.cfg', 'anyid1/file.cfg', 'quake3/file.cfg', 'baseq2/file.cfg', 'id1/file.cfg', 'quake1/file.cfg', 'some-baseq2/file.cfg', 'some-id1/file.cfg', 'some-quake1/file.cfg'], quarto: ['file.qmd'], -r: ['file.r', '.Rprofile', 'Rprofile', 'Rprofile.site'], +r: ['file.r', '.Rhistory', '.Rprofile', 'Rprofile', 'Rprofile.site'], racket: ['file.rkt', 'file.rktd', 'file.rktl'], radiance: ['file.rad', 'file.mat'], raku: ['file.pm6', 'file.p6', 'file.t6', 'file.pod6', 'file.raku', 'file.rakumod', 'file.rakudoc', 'file.rakutest'], diff --git a/src/version.c b/src/version.c index c54ec96a9..fb72324df 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 */ +/**/ +275, /**/ 274, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/E1rttkt-00GFGt-St%40256bit.org.
Commit: patch 9.1.0277: Cannot highlight the Command-line
patch 9.1.0277: Cannot highlight the Command-line Commit: https://github.com/vim/vim/commit/be2b03c6eecea3eae5d460e3c19ee43b73b29928 Author: Shougo Matsushita Date: Mon Apr 8 22:11:50 2024 +0200 patch 9.1.0277: Cannot highlight the Command-line Problem: Cannot highlight the Command-line Solution: Add the MsgArea highlighting group (Shougo Matsushita) closes: #14327 Signed-off-by: Shougo Matsushita Signed-off-by: Christian Brabandt diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 3dcbdbf2e..5e290ecb1 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -2485,7 +2485,7 @@ To specify elements that should not be concealed, set the following variable: > This is a list of the rules wich can be used here: - - titleblock + - titleblock - image - block - subscript @@ -5585,6 +5585,9 @@ MessageWindow Messages popup window used by `:echowindow`. If not defined |hl-WarningMsg| is used. *hl-ModeMsg* ModeMsg'showmode' message (e.g., "-- INSERT --"). + *hl-MsgArea* +MsgAreaCommand-line area, also used for outputting messages, see also + 'cmdheight' *hl-MoreMsg* MoreMsg|more-prompt| *hl-NonText* diff --git a/runtime/doc/tags b/runtime/doc/tags index a0d744f31..fa1ea2b2f 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -8050,6 +8050,7 @@ hl-Menu syntax.txt /*hl-Menu* hl-MessageWindow syntax.txt /*hl-MessageWindow* hl-ModeMsg syntax.txt /*hl-ModeMsg* hl-MoreMsg syntax.txt /*hl-MoreMsg* +hl-MsgArea syntax.txt /*hl-MsgArea* hl-NonText syntax.txt /*hl-NonText* hl-Normal syntax.txt /*hl-Normal* hl-Pmenu syntax.txt /*hl-Pmenu* diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt index 587cdd532..30fd79148 100644 --- a/runtime/doc/version9.txt +++ b/runtime/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2024 Mar 28 +*version9.txt* For Vim version 9.1. Last change: 2024 Apr 08 VIM REFERENCE MANUALby Bram Moolenaar @@ -41581,6 +41581,10 @@ Autocommands: ~ |WinNewPre|before creating a new window +Highlighting: ~ + +|hl-MsgArea| highlighting of the Command-line and messages area. + Commands: ~ diff --git a/src/message.c b/src/message.c index 80d6a18b5..03c7072a7 100644 --- a/src/message.c +++ b/src/message.c @@ -1637,6 +1637,9 @@ msg_outtrans_len_attr(char_u *msgstr, int len, int attr) // Only quit when got_int was set in here. got_int = FALSE; +if (attr == 0) + attr = HL_ATTR(HLF_MSG); + // if MSG_HIST flag set, add message to history if (attr & MSG_HIST) { @@ -2230,6 +2233,9 @@ msg_puts_attr_len(char *str, int maxlen, int attr) if (msg_silent != 0) return; +if (attr == 0) + attr = HL_ATTR(HLF_MSG); + // if MSG_HIST flag set, add message to history if ((attr & MSG_HIST) && maxlen < 0) { @@ -2678,13 +2684,15 @@ msg_scroll_up(void) // Scrolling up doesn't result in the right background. Set the // background here. It's not efficient, but avoids that we have to do // it all over the code. - screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0); + screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, + ' ', ' ', HL_ATTR(HLF_MSG)); // Also clear the last char of the last but one line if it was not // cleared before to avoid a scroll-up. if (ScreenAttrs[LineOffset[Rows - 2] + Columns - 1] == (sattr_T)-1) screen_fill((int)Rows - 2, (int)Rows - 1, -(int)Columns - 1, (int)Columns, ' ', ' ', 0); +(int)Columns - 1, (int)Columns, +' ', ' ', HL_ATTR(HLF_MSG)); } } @@ -2963,7 +2971,8 @@ disp_sb_line(int row, msgchunk_T *smp, int clear_to_eol) // If clearing the screen did not work (e.g. because of a background // color and t_ut isn't set) clear until the last column here. if (clear_to_eol) - screen_fill(row, row + 1, msg_col, (int)Columns, ' ', ' ', 0); + screen_fill(row, row + 1, msg_col, (int)Columns, + ' ', ' ', HL_ATTR(HLF_MSG)); if (mp->sb_eol || mp->sb_next == NULL) break; @@ -3131,6 +3140,9 @@ do_more_prompt(int typed_char) msgchunk_T *mp_last = NULL; msgchunk_T *mp; inti; +intmsg_attr; + +msg_attr = HL_ATTR(HLF_MSG); // We get called recursively when a timer callback outputs a message. In // that
Commit: patch 9.1.0278: filetype: zathurarc files not recognized
patch 9.1.0278: filetype: zathurarc files not recognized Commit: https://github.com/vim/vim/commit/72d81a66edd835aeff3f539ccd0f97afb1ebd63c Author: Wu, Zhenyu Date: Mon Apr 8 22:19:06 2024 +0200 patch 9.1.0278: filetype: zathurarc files not recognized Problem: filetype: zathurarc files not recognized Solution: Detect '.zathurarc' files as zathurarc filetype, add zathurarc filetype (Wu, Zhenyu) closes: #14380 Signed-off-by: Wu, Zhenyu Signed-off-by: Christian Brabandt diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 8e96e15f2..30996f794 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -2980,6 +2980,8 @@ au filetypedetect BufNewFile,BufRead,StdinReadPost * " Yarn lock au BufNewFile,BufRead yarn.locksetf yaml +" Zathurarc +au BufNewFile,BufRead zathurarcsetf zathurarc " If the GUI is already running, may still need to install the Syntax menu. " Don't do it when the 'M' flag is included in 'guioptions'. diff --git a/runtime/ftplugin/zathurarc.vim b/runtime/ftplugin/zathurarc.vim new file mode 100644 index 0..259fb137a --- /dev/null +++ b/runtime/ftplugin/zathurarc.vim @@ -0,0 +1,22 @@ +" Vim filetype plugin file +" Language: Zathurarc +" Maintainer: Wu, Zhenyu +" Documentation:https://pwmt.org/projects/zathura/documentation/ +" Upstream: https://github.com/Freed-Wu/zathurarc.vim +" Latest Revision: 2024-04-02 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = +set cpoptions + +let b:undo_ftplugin = 'setlocal comments< commentstring< include<' +setlocal comments=:# +setlocal commentstring=#\ %s +setlocal include=^\sinclude + +let = s:save_cpoptions +unlet s:save_cpoptions diff --git a/runtime/syntax/zathurarc.vim b/runtime/syntax/zathurarc.vim new file mode 100644 index 0..5e0526d02 --- /dev/null +++ b/runtime/syntax/zathurarc.vim @@ -0,0 +1,37 @@ +" Vim syntax file +" Language: Zathurarc +" Maintainer: Wu, Zhenyu +" Documentation:https://pwmt.org/projects/zathura/documentation/ +" Upstream: https://github.com/Freed-Wu/zathurarc.vim +" Latest Revision: 2024-04-02 + +if exists('b:current_syntax') + finish +endif +let b:current_syntax = 'zathurarc' + +syntax case match +syntax iskeyword @,48-57,_,192-255,- + +syntax region zathurarcComment start="\%([ ]*\&\([^\]\zs\|^\)\)#" end="$" +syntax match zathurarcBracket /[<>]/ contained +syntax match zathurarcNotation `<[A-Z][a-z0-9]\+>` contains=zathurarcBracket +syntax match zathurarcNumber `\<[0-9.]\>` +syntax region zathurarcString start=`"` skip=`\"` end=`"` +syntax region zathurarcString start=`'` skip=`\'` end=`'` +syntax keyword zathurarcMode normal fullscreen presentation index +syntax keyword zathurarcBoolean true false +syntax keyword zathurarcCommand include map set unmap +syntax keyword zathurarcOption abort-clear-search adjust-open advance-pages-per-row completion-bg completion-fg completion-group-bg completion-group-fg completion-highlight-bg completion-highlight-fg continuous-hist-save database dbus-raise-window dbus-service default-bg default-fg exec-command filemonitor first-page-column font guioptions highlight-active-color highlight-color highlight-fg highlight-transparency incremental-search index-active-bg index-active-fg index-bg index-fg inputbar-bg inputbar-fg link-hadjust link-zoom n-completion-items notification-bg notification-error-bg notification-error-fg notification-fg notification-warning-bg notification-warning-fg page-cache-size page-padding page-right-to-left page-thumbnail-size pages-per-row recolor recolor-darkcolor recolor-keephue recolor-lightcolor recolor-reverse-video render-loading render-loading-bg render-loading-fg sandbox scroll-full-overlap scroll-hstep scroll-page-aware scroll-step scroll-wrap search-hadjust selection-clipboard selection-notification show-directories show-hidden show-recent statusbar-basename statusbar-bg statusbar-fg statusbar-h-padding statusbar-home-tilde statusbar-page-percent statusbar-v-padding synctex synctex-editor-command vertical-center window-height window-icon window-icon-document window-title-basename window-title-home-tilde window-title-page window-width zoom-center zoom-max zoom-min zoom-step + +highlight default link zathurarcComment Comment +highlight default link zathurarcNumber Number +highlight default link zathurarcMode Macro +highlight default link zathurarcString String +highlight default link zathurarcBoolean Boolean +" same as vim +highlight default link zathurarcBracket Delimiter +highlight default link zathurarcNotation Special +highlight default link zathurarcCommand Statement +highlight default link zathurarcOption PreProc +" ex: nowrap diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 03af29770..3b94f96c6 100644 ---
Commit: patch 9.1.0279: filetype: roc files are not recognized
patch 9.1.0279: filetype: roc files are not recognized Commit: https://github.com/vim/vim/commit/196b6678c5483217ea5bc7d047b02c915615dae6 Author: nat-418 <93013864+nat-...@users.noreply.github.com> Date: Mon Apr 8 22:23:22 2024 +0200 patch 9.1.0279: filetype: roc files are not recognized Problem: filetype: roc files are not recognized Solution: Detect '*.roc' files as roc filetype, add a basic filetype plugin (nat-418) closes: #14416 Signed-off-by: nat-418 <93013864+nat-...@users.noreply.github.com> Signed-off-by: Christian Brabandt diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 30996f794..911ca1ee3 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1888,6 +1888,9 @@ au BufNewFile,BufRead *.robot,*.resource setf robot " Robots.txt au BufNewFile,BufRead robots.txt setf robots +" Roc +au BufNewFile,BufRead *.rocsetf roc + " RON (Rusty Object Notation) au BufNewFile,BufRead *.ronsetf ron diff --git a/runtime/ftplugin/roc.vim b/runtime/ftplugin/roc.vim new file mode 100644 index 0..c66510874 --- /dev/null +++ b/runtime/ftplugin/roc.vim @@ -0,0 +1,14 @@ +" Roc filetype plugin file +" Language: Roc +" Maintainer: nat-418 <93013864+nat-...@users.noreply.github.com> +" Latest Revision: 2024-04-5 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:##,:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setl com< cms<" diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 3b94f96c6..19c8a2afe 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -597,6 +597,7 @@ def s:GetFilenameChecks(): dict> rpgle: ['file.rpgle', 'file.rpgleinc'], robot: ['file.robot', 'file.resource'], robots: ['robots.txt'], +roc: ['file.roc'], ron: ['file.ron'], routeros: ['file.rsc'], rpcgen: ['file.x'], diff --git a/src/version.c b/src/version.c index 93f6634e4..6f49e116b 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 */ +/**/ +279, /**/ 278, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/E1rtvd0-00GPbn-TU%40256bit.org.
Commit: patch 9.1.0280: several issues with 'smoothscroll' support
patch 9.1.0280: several issues with 'smoothscroll' support Commit: https://github.com/vim/vim/commit/9148ba8a46baa3934c44164989cdcdec5d01d9e3 Author: Luuk van Baal Date: Mon Apr 8 22:27:41 2024 +0200 patch 9.1.0280: several issues with 'smoothscroll' support Problem: Logic to make sure cursor is in visible part of the screen after scrolling the text with 'smoothscroll' is scattered, asymmetric and contains bugs. Solution: Adjust and create helper function for 'smoothscroll' cursor logic. (Luuk van Baal) closes: #14410 Signed-off-by: Luuk van Baal Signed-off-by: Christian Brabandt diff --git a/src/misc1.c b/src/misc1.c index 666cd5847..7ee471233 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -519,6 +519,8 @@ plines_m_win(win_T *wp, linenr_T first, linenr_T last, int limit_winheight) #endif { #ifdef FEAT_DIFF + if (first == wp->w_buffer->b_ml.ml_line_count) + count += diff_check_fill(wp, first + 1); if (first == wp->w_topline) count += plines_win_nofill(wp, first, limit_winheight) + wp->w_topfill; diff --git a/src/move.c b/src/move.c index f9e5cf72a..0bf59c9f9 100644 --- a/src/move.c +++ b/src/move.c @@ -59,7 +59,7 @@ adjust_plines_for_skipcol(win_T *wp) * the window height. */ static int -plines_correct_topline(win_T *wp, linenr_T lnum) +plines_correct_topline(win_T *wp, linenr_T lnum, int limit_winheight) { int n; #ifdef FEAT_DIFF @@ -70,7 +70,7 @@ plines_correct_topline(win_T *wp, linenr_T lnum) n = plines_win(wp, lnum, FALSE); if (lnum == wp->w_topline) n -= adjust_plines_for_skipcol(wp); -if (n > wp->w_height) +if (limit_winheight && n > wp->w_height) n = wp->w_height; return n; } @@ -119,7 +119,7 @@ comp_botline(win_T *wp) else #endif { - n = plines_correct_topline(wp, lnum); + n = plines_correct_topline(wp, lnum, TRUE); } if ( #ifdef FEAT_FOLDING @@ -921,7 +921,7 @@ curs_rows(win_T *wp) else #endif { - wp->w_cline_row += plines_correct_topline(wp, lnum); + wp->w_cline_row += plines_correct_topline(wp, lnum, TRUE); ++lnum; } } @@ -1601,6 +1601,127 @@ f_virtcol2col(typval_T *argvars UNUSED, typval_T *rettv) } #endif +/* + * Make sure the cursor is in the visible part of the topline after scrolling + * the screen with 'smoothscroll'. + */ +static void cursor_correct_sms(void) +{ +if (!curwin->w_p_sms ||!curwin->w_p_wrap + || curwin->w_cursor.lnum != curwin->w_topline) + return; + +longso = get_scrolloff_value(); +intwidth1 = curwin->w_width - curwin_col_off(); +intwidth2 = width1 + curwin_col_off2(); +intso_cols = so == 0 ? 0 : width1 + (so - 1) * width2; +intspace_cols = (curwin->w_height - 1) * width2; +intsize = so == 0 ? 0 : win_linetabsize(curwin, curwin->w_topline, + ml_get(curwin->w_topline), (colnr_T)MAXCOL); + +if (curwin->w_topline == 1 && curwin->w_skipcol == 0) + so_cols = 0; // Ignore 'scrolloff' at top of buffer. +else if (so_cols > space_cols / 2) + so_cols = space_cols / 2; // Not enough room: put cursor in the middle. + +// Not enough screen lines in topline: ignore 'scrolloff'. +while (so_cols > size && so_cols - width2 >= width1) + so_cols -= width2; +if (so_cols >= width1 && so_cols > size) + so_cols -= width1; + +// If there is no marker or we have non-zero scrolloff, just ignore it. +int overlap = (curwin->w_skipcol == 0 || so_cols != 0) ? 0 + : sms_marker_overlap(curwin, -1); +int top = curwin->w_skipcol + overlap + so_cols; +int bot = curwin->w_skipcol + width1 + (curwin->w_height - 1) * width2 + - so_cols; +validate_virtcol(); +colnr_T col = curwin->w_virtcol; + +if (col < top) +{ + if (col < width1) + col += width1; + while (width2 > 0 && col < top) + col += width2; +} +else + while (width2 > 0 && col >= bot) + col -= width2; + +if (col != curwin->w_virtcol) +{ + curwin->w_curswant = col; + coladvance(curwin->w_curswant); + // validate_virtcol() marked various things as valid, but after + // moving the cursor they need to be recomputed + curwin->w_valid &= + ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW|VALID_VIRTCOL); +} +} + +/* + * Scroll "count" lines up or down, and redraw. + */ +void +scroll_redraw(int up, long count) +{ +linenr_T prev_topline = curwin->w_topline; +intprev_skipcol =
Commit: patch 9.1.0281: CI: fails Test_compiler_completion
patch 9.1.0281: CI: fails Test_compiler_completion Commit: https://github.com/vim/vim/commit/d33cb3f65e112bdb2d57139e9a308b1a9c8ffcc2 Author: Christian Brabandt Date: Mon Apr 8 22:54:16 2024 +0200 patch 9.1.0281: CI: fails Test_compiler_completion Problem: CI: fails Test_compiler_completion Solution: Add pandoc compiler Signed-off-by: Christian Brabandt diff --git a/src/testdir/test_compiler.vim b/src/testdir/test_compiler.vim index 4b710df07..26404c610 100644 --- a/src/testdir/test_compiler.vim +++ b/src/testdir/test_compiler.vim @@ -71,10 +71,10 @@ func Test_compiler_completion() call assert_match('^"compiler ' .. clist .. '$', @:) call feedkeys(":compiler p\\\"\", 'tx') - call assert_match('"compiler pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:) + call assert_match('"compiler pandoc pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:) call feedkeys(":compiler! p\\\"\", 'tx') - call assert_match('"compiler! pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:) + call assert_match('"compiler! pandoc pbx perl\( p[a-z]\+\)\+ pylint pyunit', @:) endfunc func Test_compiler_error() diff --git a/src/version.c b/src/version.c index 5f0c90984..1acc1a8db 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 */ +/**/ +281, /**/ 280, /**/ -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/E1rtw5z-00GSKj-Cu%40256bit.org.
Commit: runtime(cuda): Update cuda keywords, remove uncommonly used enumeration constants
runtime(cuda): Update cuda keywords, remove uncommonly used enumeration constants Commit: https://github.com/vim/vim/commit/a2385c23349935d4bd6780a538f3a8f46a29d952 Author: jiangyinzuo Date: Mon Apr 8 22:48:43 2024 +0200 runtime(cuda): Update cuda keywords, remove uncommonly used enumeration constants closes: https://github.com/vim/vim/issues/14406 Signed-off-by: jiangyinzuo Signed-off-by: Christian Brabandt diff --git a/runtime/syntax/cuda.vim b/runtime/syntax/cuda.vim index 13d70e343..8306d096a 100644 --- a/runtime/syntax/cuda.vim +++ b/runtime/syntax/cuda.vim @@ -1,7 +1,8 @@ " Vim syntax file " Language:CUDA (NVIDIA Compute Unified Device Architecture) " Maintainer: Timothy B. Terriberry -" Last Change: 2018 Feb 06 +" Last Change: 2024 Apr 04 +" Contributor: jiangyinzuo " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -11,12 +12,13 @@ endif " Read the C++ syntax to start with runtime! syntax/cpp.vim -" CUDA extentions -syn keyword cudaStorageClass __device__ __global__ __host__ -syn keyword cudaStorageClass __constant__ __shared__ -syn keyword cudaStorageClass __inline__ __align__ __thread__ +" CUDA extentions. +" Reference: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#c-language-extensions +syn keyword cudaStorageClass __device__ __global__ __host__ __managed__ +syn keyword cudaStorageClass __constant__ __grid_constant__ __shared__ +syn keyword cudaStorageClass __inline__ __noinline__ __forceinline__ __inline_hint__ +syn keyword cudaStorageClass __align__ __thread__ __restrict__ "syn keyword cudaStorageClass __import__ __export__ __location__ -syn keyword cudaStructure template syn keyword cudaType char1 char2 char3 char4 syn keyword cudaType uchar1 uchar2 uchar3 uchar4 syn keyword cudaType short1 short2 short3 short4 @@ -25,37 +27,23 @@ syn keyword cudaTypeint1 int2 int3 int4 syn keyword cudaType uint1 uint2 uint3 uint4 syn keyword cudaType long1 long2 long3 long4 syn keyword cudaType ulong1 ulong2 ulong3 ulong4 +syn keyword cudaType longlong1 longlong2 longlong3 longlong4 +syn keyword cudaType ulonglong1 ulonglong2 ulonglong3 ulonglong4 syn keyword cudaType float1 float2 float3 float4 -syn keyword cudaType ufloat1 ufloat2 ufloat3 ufloat4 +syn keyword cudaType double1 double2 double3 double4 syn keyword cudaType dim3 texture textureReference syn keyword cudaType cudaError_t cudaDeviceProp cudaMemcpyKind syn keyword cudaType cudaArray cudaChannelFormatKind syn keyword cudaType cudaChannelFormatDesc cudaTextureAddressMode syn keyword cudaType cudaTextureFilterMode cudaTextureReadMode -syn keyword cudaVariable gridDim blockIdx blockDim threadIdx +syn keyword cudaVariable gridDim blockIdx blockDim threadIdx warpSize +syn keyword cudaConstant __CUDA_ARCH__ syn keyword cudaConstant __DEVICE_EMULATION__ +" There are too many CUDA enumeration constants. We only define a subset of commonly used constants. +" Reference: https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html syn keyword cudaConstant cudaSuccess -" Many more errors are defined, but only these are listed in the maunal -syn keyword cudaConstant cudaErrorMemoryAllocation -syn keyword cudaConstant cudaErrorInvalidDevicePointer -syn keyword cudaConstant cudaErrorInvalidSymbol -syn keyword cudaConstant cudaErrorMixedDeviceExecution -syn keyword cudaConstant cudaMemcpyHostToHost -syn keyword cudaConstant cudaMemcpyHostToDevice -syn keyword cudaConstant cudaMemcpyDeviceToHost -syn keyword cudaConstant cudaMemcpyDeviceToDevice -syn keyword cudaConstant cudaReadModeElementType -syn keyword cudaConstant cudaReadModeNormalizedFloat -syn keyword cudaConstant cudaFilterModePoint -syn keyword cudaConstant cudaFilterModeLinear -syn keyword cudaConstant cudaAddressModeClamp -syn keyword cudaConstant cudaAddressModeWrap -syn keyword cudaConstant cudaChannelFormatKindSigned -syn keyword cudaConstant cudaChannelFormatKindUnsigned -syn keyword cudaConstant cudaChannelFormatKindFloat hi def link cudaStorageClass StorageClass -hi def link cudaStructure Structure hi def link cudaType Type hi def link cudaVariable Identifier hi def link cudaConstant Constant -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this
Commit: patch 9.1.0282: Finding highlighting attributes is inefficient
patch 9.1.0282: Finding highlighting attributes is inefficient Commit: https://github.com/vim/vim/commit/34f00dd4abd011ce750e273b747915ae2f3b6e48 Author: John Marriott Date: Mon Apr 8 23:28:12 2024 +0200 patch 9.1.0282: Finding highlighting attributes is inefficient Problem: Finding highlighting attributes is inefficient Solution: Use binary search to find highlighting attributes and color names (John Marriott) closes: #14426 Signed-off-by: John Marriott Signed-off-by: Christian Brabandt diff --git a/src/highlight.c b/src/highlight.c index 9b3b07244..d874032fb 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -24,19 +24,110 @@ * The "term", "cterm" and "gui" arguments can be any combination of the * following names, separated by commas (but no spaces!). */ -static char *(hl_name_table[]) = -{"bold", "standout", "underline", - "undercurl", "underdouble", "underdotted", "underdashed", - "italic", "reverse", "inverse", "nocombine", "strikethrough", "NONE"}; -static int hl_attr_table[] = -{HL_BOLD, HL_STANDOUT, HL_UNDERLINE, - HL_UNDERCURL, HL_UNDERDOUBLE, HL_UNDERDOTTED, HL_UNDERDASHED, - HL_ITALIC, HL_INVERSE, HL_INVERSE, HL_NOCOMBINE, HL_STRIKETHROUGH, 0}; +// must be sorted by the 'value' field because it is used by bsearch()! +// note: inverse and reverse use the same key +static keyvalue_T highlight_tab[] = { +KEYVALUE_ENTRY(HL_BOLD, "bold"), // index 0 +KEYVALUE_ENTRY(HL_INVERSE, "inverse"), // index 1 +KEYVALUE_ENTRY(HL_ITALIC, "italic"), // index 2 +KEYVALUE_ENTRY(HL_NOCOMBINE, "nocombine"), // index 3 +KEYVALUE_ENTRY(HL_NORMAL, "NONE"), // index 4 +KEYVALUE_ENTRY(HL_INVERSE, "reverse"), // index 5 +KEYVALUE_ENTRY(HL_STANDOUT, "standout"), // index 6 +KEYVALUE_ENTRY(HL_STRIKETHROUGH, "strikethrough"), // index 7 +KEYVALUE_ENTRY(HL_UNDERCURL, "undercurl"), // index 8 +KEYVALUE_ENTRY(HL_UNDERDASHED, "underdashed"), // index 9 +KEYVALUE_ENTRY(HL_UNDERDOTTED, "underdotted"), // index 10 +KEYVALUE_ENTRY(HL_UNDERDOUBLE, "underdouble"), // index 11 +KEYVALUE_ENTRY(HL_UNDERLINE, "underline") // index 12 +}; + +// this table is used to display highlight names in the "correct" sequence. +// keep this in sync with highlight_tab[]. +static keyvalue_T *highlight_index_tab[] = { +_tab[0], // HL_BOLD +_tab[6], // HL_STANDOUT +_tab[12],// HL_UNDERLINE +_tab[8], // HL_UNDERCURL +_tab[11],// HL_UNDERDOUBLE +_tab[10],// HL_UNDERDOTTED +_tab[9], // HL_UNDERDASHED +_tab[2], // HL_ITALIC +_tab[5], // HL_REVERSE +_tab[1], // HL_INVERSE +_tab[3], // HL_NOCOMBINE +_tab[7], // HL_STRIKETHROUGH +_tab[4] // HL_NORMAL +}; + // length of all attribute names, plus commas, together (and a bit more) #define MAX_ATTR_LEN 120 #define ATTR_COMBINE(attr_a, attr_b) attr_b) & HL_NOCOMBINE) ? (attr_b) : (attr_a)) | (attr_b)) +enum { +BLACK = 0, +DARKBLUE, +DARKGREEN, +DARKCYAN, +DARKRED, +DARKMAGENTA, +BROWN, +DARKYELLOW, +GRAY, +GREY, +LIGHTGRAY, +LIGHTGREY, +DARKGRAY, +DARKGREY, +BLUE, +LIGHTBLUE, +GREEN, +LIGHTGREEN, +CYAN, +LIGHTCYAN, +RED, +LIGHTRED, +MAGENTA, +LIGHTMAGENTA, +YELLOW, +LIGHTYELLOW, +WHITE, +NONE +}; + +// must be sorted by the 'value' field because it is used by bsearch()! +static keyvalue_T color_name_tab[] = { +KEYVALUE_ENTRY(BLACK, "Black"), +KEYVALUE_ENTRY(BLUE, "Blue"), +KEYVALUE_ENTRY(BROWN, "Brown"), +KEYVALUE_ENTRY(CYAN, "Cyan"), +KEYVALUE_ENTRY(DARKBLUE, "DarkBlue"), +KEYVALUE_ENTRY(DARKCYAN, "DarkCyan"), +KEYVALUE_ENTRY(DARKGRAY, "DarkGray"), +KEYVALUE_ENTRY(DARKGREEN, "DarkGreen"), +KEYVALUE_ENTRY(DARKGREY, "DarkGrey"), +KEYVALUE_ENTRY(DARKMAGENTA, "DarkMagenta"), +KEYVALUE_ENTRY(DARKRED, "DarkRed"), +KEYVALUE_ENTRY(DARKYELLOW, "DarkYellow"), +KEYVALUE_ENTRY(GRAY, "Gray"), +KEYVALUE_ENTRY(GREEN, "Green"), +KEYVALUE_ENTRY(GREY, "Grey"), +KEYVALUE_ENTRY(LIGHTBLUE, "LightBlue"), +KEYVALUE_ENTRY(LIGHTCYAN, "LightCyan"), +KEYVALUE_ENTRY(LIGHTGRAY, "LightGray"), +KEYVALUE_ENTRY(LIGHTGREEN, "LightGreen"), +KEYVALUE_ENTRY(LIGHTGREY, "LightGrey"), +