diff options
author | James McCoy <jamessan@jamessan.com> | 2022-03-05 15:00:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-05 15:00:07 -0500 |
commit | c365de1d22de3e70e785267fe19cb9c43b42d355 (patch) | |
tree | eedb8f3597ba982066a11b9f39f94e16f25f31d6 /runtime | |
parent | d557a4557100e3ab48a504dafcf53f544196595c (diff) | |
parent | 7fd1182c62d6e969ac15b3891bfcc4ff480d6953 (diff) | |
download | rneovim-c365de1d22de3e70e785267fe19cb9c43b42d355.tar.gz rneovim-c365de1d22de3e70e785267fe19cb9c43b42d355.tar.bz2 rneovim-c365de1d22de3e70e785267fe19cb9c43b42d355.zip |
Merge pull request #17589 from kchibisov/add-dashed-dotted-underline
Add support for double, dashed, and dotted underlines
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 5 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 15 | ||||
-rw-r--r-- | runtime/doc/ui.txt | 36 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 20 |
4 files changed, 46 insertions, 30 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 03a5f98c6d..b0859d1cea 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -7937,8 +7937,11 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()* "inverse" "1" if inverse (= reverse) "standout" "1" if standout "underline" "1" if underlined + "underlineline" "1" if double underlined "undercurl" "1" if undercurled - "strikethrough" "1" if struckthrough + "underdot" "1" if dotted underlined + "underdash" "1" if dashed underlined + "strikethrough" "1" if struckthrough Example (echoes the color of the syntax item under the cursor): > diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 778f829a4e..9084c5315a 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -4875,7 +4875,8 @@ the same syntax file on all UIs. 1. TUI highlight arguments - *bold* *underline* *undercurl* + *bold* *underline* *underlineline* + *undercurl* *underdot* *underdash* *inverse* *italic* *standout* *nocombine* *strikethrough* cterm={attr-list} *attr-list* *highlight-cterm* *E418* @@ -4883,7 +4884,10 @@ cterm={attr-list} *attr-list* *highlight-cterm* *E418* following items (in any order): bold underline + underlineline double underline undercurl curly underline + underdot dotted underline + underdash dashed underline strikethrough reverse inverse same as reverse @@ -4894,8 +4898,9 @@ cterm={attr-list} *attr-list* *highlight-cterm* *E418* Note that "bold" can be used here and by using a bold font. They have the same effect. - "undercurl" falls back to "underline" in a terminal that does not - support it. The color is set using |highlight-guisp|. + "underlineline", "undercurl", "underdot", and "underdash" fall back + to "underline" in a terminal that does not support them. The color is + set using |highlight-guisp|. start={term-list} *highlight-start* *E422* stop={term-list} *term-list* *highlight-stop* @@ -5028,8 +5033,8 @@ guifg={color-name} *highlight-guifg* guibg={color-name} *highlight-guibg* guisp={color-name} *highlight-guisp* These give the foreground (guifg), background (guibg) and special - (guisp) color to use in the GUI. "guisp" is used for undercurl - and underline. + (guisp) color to use in the GUI. "guisp" is used for various + underlines. There are a few special names: NONE no color (transparent) bg use normal background color diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index e7be14e732..c5e3b60079 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -283,19 +283,24 @@ numerical highlight ids to the actual attributes. attributes specified by the `rgb_attr` and `cterm_attr` dicts, with the following (all optional) keys. - `foreground`: foreground color. - `background`: background color. - `special`: color to use for underline and undercurl, when present. - `reverse`: reverse video. Foreground and background colors are - switched. - `italic`: italic text. - `bold`: bold text. - `strikethrough`: struckthrough text. - `underline`: underlined text. The line has `special` color. - `undercurl`: undercurled text. The curl has `special` color. - `blend`: Blend level (0-100). Could be used by UIs to support - blending floating windows to the background or to - signal a transparent cursor. + `foreground`: foreground color. + `background`: background color. + `special`: color to use for various underlines, when + present. + `reverse`: reverse video. Foreground and background colors + are switched. + `italic`: italic text. + `bold`: bold text. + `strikethrough`: struckthrough text. + `underline`: underlined text. The line has `special` color. + `underlineline`: double underlined text. The lines have `special` + color. + `undercurl`: undercurled text. The curl has `special` color. + `underdot`: underdotted text. The dots have `special` color. + `underdash`: underdashed text. The dashes have `special` color. + `blend`: Blend level (0-100). Could be used by UIs to + support blending floating windows to the + background or to signal a transparent cursor. For absent color keys the default color should be used. Don't store the default value in the table, rather a sentinel value, so that @@ -444,14 +449,17 @@ is not active. New UIs should implement |ui-linegrid| instead. `foreground`: foreground color. `background`: background color. - `special`: color to use for underline and undercurl, when present. + `special`: color to use for various underlines, when present. `reverse`: reverse video. Foreground and background colors are switched. `italic`: italic text. `bold`: bold text. `strikethrough`: struckthrough text. `underline`: underlined text. The line has `special` color. + `underlineline`: double underlined text. The lines have `special` color. `undercurl`: undercurled text. The curl has `special` color. + `underdot`: underdotted text. The dots have `special` color. + `underdash`: underdashed text. The dashes have `special` color. ["put", text] The (utf-8 encoded) string `text` is put at the cursor position diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 41993b65b0..0bc233fc2a 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -46,14 +46,14 @@ syn match vimTermOption contained "t_%i" syn match vimTermOption contained "t_k;" " unsupported settings: these are supported by vi but don't do anything in vim {{{2 -syn keyword vimErrSetting contained hardtabs ht w1200 w300 w9600 +syn keyword vimErrSetting contained hardtabs ht w1200 w300 w9600 "}}}2 syn case ignore " Highlight commonly used Groupnames {{{2 -syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo +syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo " Default highlighting groups {{{2 -syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineFold CursorLineNr CursorLineSign DiffAdd DiffChange DiffDelete DiffText Directory EndOfBuffer ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question QuickFixLine Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual WarningMsg WildMenu +syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineFold CursorLineNr CursorLineSign DiffAdd DiffChange DiffDelete DiffText Directory EndOfBuffer ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question QuickFixLine Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual WarningMsg WildMenu syn match vimHLGroup contained "Conceal" syn keyword vimOnlyHLGroup contained LineNrAbove LineNrBelow StatusLineTerm Terminal VisualNOS syn keyword nvimHLGroup contained Substitute TermCursor TermCursorNC @@ -88,10 +88,10 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]' else com! -nargs=* VimFoldm <args> endif - if g:vimsyn_folding =~# 'p' - com! -nargs=* VimFoldp <args> fold - else - com! -nargs=* VimFoldp <args> + if g:vimsyn_folding =~# 'p' + com! -nargs=* VimFoldp <args> fold + else + com! -nargs=* VimFoldp <args> endif if g:vimsyn_folding =~# 'P' com! -nargs=* VimFoldP <args> fold @@ -148,8 +148,8 @@ syn match vimNumber '-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=' skipwhite nextgro syn match vimNumber '\<0[xX]\x\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment syn match vimNumber '\<0[zZ][a-zA-Z0-9.]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment -syn match vimNumber '0[0-7]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment -syn match vimNumber '0[bB][01]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment +syn match vimNumber '0[0-7]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment +syn match vimNumber '0[bB][01]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment " All vimCommands are contained by vimIsCommand. {{{2 syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimEcho,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd @@ -574,7 +574,7 @@ syn match vimHiBang contained "!" skipwhite nextgroup=@vimHighlightCluster syn match vimHiGroup contained "\i\+" syn case ignore -syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl +syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline underlineline undercurl underdot underdash syn keyword vimFgBgAttrib contained none bg background fg foreground syn case match syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib |