[vim/vim] update diff colors for environments with <=256 colors (PR #20711)

1 view
Skip to first unread message

Maxim Kim

unread,
2:56 AM (2 hours ago) 2:56 AM
to vim/vim, Subscribed

It is hard to read "transparent" diff colors in environments where number of colors are limited.
Make sure foreground color is set, so that diff colors are not clashing with syntax colors.

Closes #4071


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20711

Commit Summary

  • d03d1af update diff colors for environments with <=256 colors

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20711@github.com>

Maxim Kim

unread,
3:06 AM (2 hours ago) 3:06 AM
to vim/vim, Subscribed
habamax left a comment (vim/vim#20711)

@chrisbra this would be a slightly breaking change for people relying on the current Diff* groups not setting foreground color. Same way it was with Visual back when you did a similar change.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20711/c4885185047@github.com>

Maxim Kim

unread,
3:10 AM (2 hours ago) 3:10 AM
to vim/vim, Subscribed
habamax left a comment (vim/vim#20711)

Additionally, I am not sure what foreground color would be better to set black or white.
It might be better to set black for &background == "light" and white for &background == "dark".


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20711/c4885193071@github.com>

Maxim Kim

unread,
4:08 AM (1 hour ago) 4:08 AM
to vim/vim, Subscribed
habamax left a comment (vim/vim#20711)

I am not sure how to fix this test:

Failures: 
	From test_highlight.vim:
	Found errors in Test_highlight_eol_on_diff():
	command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_highlight_eol_on_diff line 18: Expected 2093 but got 2143
func Test_highlight_eol_on_diff()
  call setline(1, ['abcd', ''])
  call matchadd('Search', '\n')
  let attrs0 = ScreenAttrs(1, 10)[0]

  diffthis
  botright new
  diffthis

  " expected:
  " '  abcd    '
  "  ^^           sign
  "    ^^^^ ^^^   'DiffAdd' highlight
  "        ^      'Search' highlight
  let attrs = ScreenAttrs(1, 10)[0]
  call assert_equal(repeat([attrs[0]], 2), attrs[0:1])
  call assert_equal(repeat([attrs[2]], 4), attrs[2:5])
  call assert_equal(repeat([attrs[2]], 3), attrs[7:9])
  call assert_equal(attrs0[4], attrs[6])
  call assert_notequal(attrs[0], attrs[2])
  call assert_notequal(attrs[0], attrs[6])
  call assert_notequal(attrs[2], attrs[6])
  call Check_lcs_eol_attrs(attrs, 1, 10)

  bwipe!
  diffoff
endfunc


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20711/c4885335246@github.com>

Reply all
Reply to author
Forward
0 new messages