mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
vim-patch:9.1.0016: default diff highlighting is too noisy
Problem: default diff highlighting is too noisy
Solution: Link diff highlighting groups to new
Added/Removed/Changed, revert previous change
(Romain Lafourcade)
Remove diff* links added in vim/vim#13776 and doc added in commit b1392be
The links added in vim/vim#13776 are way too noisy for the contexts in which
the `diff` syntax is applied (git commits, patches, etc.).
This commit:
- removes those links
- adds new default highlighting groups Added, Changed and
Removed
- links the diff highlighting groups to those new defaults
- removes the doc changes
- adjusts the syntax_completion test for those newly added group
names
Note: Changes to the default color schemes will be handled separately,
by adding links to those newly created Added/Removed/Changed
highlighting groups.
related: vim/vim#13776
closes vim/vim#13825
124371c5a1
Co-authored-by: Romain Lafourcade <romain.lafourcade@razorfish.fr>
This commit is contained in:
parent
3bcf8e5622
commit
f46ae13685
@ -243,6 +243,10 @@ Error any erroneous construct
|
||||
Todo anything that needs extra attention; mostly the
|
||||
keywords TODO FIXME and XXX
|
||||
|
||||
Added added line in a diff
|
||||
Changed changed line in a diff
|
||||
Removed removed line in a diff
|
||||
|
||||
The names marked with * are the preferred groups; the others are minor groups.
|
||||
For the preferred groups, the "syntax.vim" file contains default highlighting.
|
||||
The minor groups are linked to the preferred groups, so they get the same
|
||||
@ -1224,7 +1228,7 @@ To highlight KDE-reserved features, set >
|
||||
g:desktop_enable_kde follows g:desktop_enable_nonstd if not supplied
|
||||
|
||||
|
||||
DIFF *diff.vim* *ft-diff-syntax*
|
||||
DIFF *diff.vim*
|
||||
|
||||
The diff highlighting normally finds translated headers. This can be slow if
|
||||
there are very long lines in the file. To disable translations: >
|
||||
@ -1233,15 +1237,6 @@ there are very long lines in the file. To disable translations: >
|
||||
|
||||
Also see |diff-slow|.
|
||||
|
||||
Since the Vim 9.1 release the diff filetype links the diffAdded,
|
||||
diffRemoved and diffChanged highlighting groups to |hl-DiffAdd|,
|
||||
|hl-DiffDelete| and |hl-DiffChange| by default. If you do not want this, you
|
||||
can change it to the previous groups like this in your |vimrc| >
|
||||
|
||||
hi link diffRemoved Special
|
||||
hi link diffChanged PreProc
|
||||
hi link diffAdded Identifier
|
||||
<
|
||||
DIRCOLORS *dircolors.vim* *ft-dircolors-syntax*
|
||||
|
||||
The dircolors utility highlighting definition has one option. It exists to
|
||||
|
@ -378,9 +378,9 @@ hi def link diffBDiffer Constant
|
||||
hi def link diffIsA Constant
|
||||
hi def link diffNoEOL Constant
|
||||
hi def link diffCommon Constant
|
||||
hi def link diffRemoved DiffDelete
|
||||
hi def link diffChanged DiffChange
|
||||
hi def link diffAdded DiffAdd
|
||||
hi def link diffRemoved Removed
|
||||
hi def link diffChanged Changed
|
||||
hi def link diffAdded Added
|
||||
hi def link diffLine Statement
|
||||
hi def link diffSubname PreProc
|
||||
hi def link diffComment Comment
|
||||
|
@ -136,6 +136,10 @@ syn match helpTodo "\t[* ]Todo\t\+[a-z].*"
|
||||
|
||||
syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-zA-Z0-9/]`
|
||||
|
||||
syn match helpDiffAdded "\t[* ]Added\t\+[a-z].*"
|
||||
syn match helpDiffChanged "\t[* ]Changed\t\+[a-z].*"
|
||||
syn match helpDiffRemoved "\t[* ]Removed\t\+[a-z].*"
|
||||
|
||||
" Additionally load a language-specific syntax file "help_ab.vim".
|
||||
let s:i = match(expand("%"), '\.\a\ax$')
|
||||
if s:i > 0
|
||||
@ -209,6 +213,9 @@ hi def link helpUnderlined Underlined
|
||||
hi def link helpError Error
|
||||
hi def link helpTodo Todo
|
||||
hi def link helpURL String
|
||||
hi def link helpDiffAdded Added
|
||||
hi def link helpDiffChanged Changed
|
||||
hi def link helpDiffRemoved Removed
|
||||
|
||||
let b:current_syntax = "help"
|
||||
|
||||
|
@ -313,6 +313,8 @@ static const char *highlight_init_light[] = {
|
||||
"Normal guifg=NvimDarkGrey2 guibg=NvimLightGrey2 ctermfg=NONE ctermbg=NONE",
|
||||
|
||||
// UI
|
||||
"Added guifg=NvimDarGreen ctermfg=2",
|
||||
"Changed guifg=NvimDarkCyan ctermfg=6",
|
||||
"ColorColumn guibg=NvimLightGrey4 cterm=reverse",
|
||||
"Conceal guifg=NvimLightGrey4",
|
||||
"CurSearch guifg=NvimLightGrey1 guibg=NvimDarkYellow ctermfg=15 ctermbg=3",
|
||||
@ -341,6 +343,7 @@ static const char *highlight_init_light[] = {
|
||||
"RedrawDebugClear guibg=NvimLightYellow ctermfg=15 ctermbg=3",
|
||||
"RedrawDebugComposed guibg=NvimLightGreen ctermfg=15 ctermbg=2",
|
||||
"RedrawDebugRecompose guibg=NvimLightRed ctermfg=15 ctermbg=1",
|
||||
"Removed guifg=NvimDarkRed ctermfg=1",
|
||||
"Search guifg=NvimDarkGrey1 guibg=NvimLightYellow ctermfg=15 ctermbg=3",
|
||||
"SignColumn guifg=NvimLightGrey4",
|
||||
"SpecialKey guifg=NvimLightGrey4",
|
||||
@ -382,6 +385,8 @@ static const char *highlight_init_dark[] = {
|
||||
"Normal guifg=NvimLightGrey2 guibg=NvimDarkGrey2 ctermfg=NONE ctermbg=NONE",
|
||||
|
||||
// UI
|
||||
"Added guifg=NvimLightGreen ctermfg=10",
|
||||
"Changed guifg=NvimLightCyan ctermfg=14",
|
||||
"ColorColumn guibg=NvimDarkGrey4 cterm=reverse",
|
||||
"Conceal guifg=NvimDarkGrey4",
|
||||
"CurSearch guifg=NvimDarkGrey1 guibg=NvimLightYellow ctermfg=0 ctermbg=11",
|
||||
@ -410,6 +415,7 @@ static const char *highlight_init_dark[] = {
|
||||
"RedrawDebugClear guibg=NvimDarkYellow ctermfg=0 ctermbg=11",
|
||||
"RedrawDebugComposed guibg=NvimDarkGreen ctermfg=0 ctermbg=10",
|
||||
"RedrawDebugRecompose guibg=NvimDarkRed ctermfg=0 ctermbg=9",
|
||||
"Removed guifg=NvimLightRed ctermfg=9",
|
||||
"Search guifg=NvimLightGrey1 guibg=NvimDarkYellow ctermfg=0 ctermbg=11",
|
||||
"SignColumn guifg=NvimDarkGrey4",
|
||||
"SpecialKey guifg=NvimDarkGrey4",
|
||||
|
@ -431,11 +431,11 @@ func Test_highlight_completion()
|
||||
|
||||
" A cleared group does not show up in completions.
|
||||
hi Anders ctermfg=green
|
||||
call assert_equal(['Aardig', 'Anders'], getcompletion('A', 'highlight'))
|
||||
call assert_equal(['Aardig', 'Added', 'Anders'], getcompletion('A', 'highlight'))
|
||||
hi clear Aardig
|
||||
call assert_equal(['Anders'], getcompletion('A', 'highlight'))
|
||||
call assert_equal(['Added', 'Anders'], getcompletion('A', 'highlight'))
|
||||
hi clear Anders
|
||||
call assert_equal([], getcompletion('A', 'highlight'))
|
||||
call assert_equal(['Added'], getcompletion('A', 'highlight'))
|
||||
endfunc
|
||||
|
||||
func Test_getcompletion()
|
||||
|
Loading…
Reference in New Issue
Block a user