Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor readability in vimdiff with cursorline #40

Closed
AndroidOatmeal opened this issue Dec 17, 2014 · 12 comments
Closed

Poor readability in vimdiff with cursorline #40

AndroidOatmeal opened this issue Dec 17, 2014 · 12 comments

Comments

@AndroidOatmeal
Copy link

Hello,

I've noticed that when I have :set cursorline in my vimrc and I try to vimdiff something, my cursor line makes diffed text quite hard to read. See picture for an example.

Any ideas on how to solve this?

screen shot 2014-12-17 at 15 48 55

@morhetz
Copy link
Owner

morhetz commented Dec 17, 2014

Hmm, that's weird. Is this iterm? Could your reproduce that without vimdiff? And if this is iterm, what's your g:gruvbox_termcolors?

@AndroidOatmeal
Copy link
Author

Yeah, I'm using iTerm2. I am using the default 256 g:gruvbox_termcolors, since I have a line in my zshrc that runs the gruvbox_256palette_osx.sh script. The only other relevant lines in my vimrc are:

let g:gruvbox_contrast_dark="soft"
if !has("gui_running")
    let g:gruvbox_italicize_comments=0
endif
set background=dark
colorscheme gruvbox

Unfortunately, I cannot reproduce this issue without vimdiff, since the issue only occurs the highlighted green/orange lines created by vimdiff. Gruvbox + cursorline works just fine on regular lines.

@morhetz
Copy link
Owner

morhetz commented Dec 17, 2014

I'm pretty sure that's not causing this issue, but you'd better change let g:gruvbox_italicize_comments=0 to let g:gruvbox_italic=0.
Ok, I'll try to investigate that stuff, thanks for reporting.

@AndroidOatmeal
Copy link
Author

If it helps anyone, I've come up with a workaround that disables cursorline in vimdiff mode. I added the following to my vimrc:

if !&diff
    set cursorline
endif

AndroidOatmeal pushed a commit to AndroidOatmeal/dotfiles that referenced this issue Jan 12, 2015
@ikcalB
Copy link

ikcalB commented Mar 9, 2015

+1 having the exact same Problem w/ xfce4-terminal.

imho, the lightish gray, that is normally a perfect cursorline color, has very poor contrast to fg/text color (black?) when vimdiffing.

@morhetz
Copy link
Owner

morhetz commented Mar 10, 2015

@ikcalB I'm sorry, I can't reproduce it with xfce4-terminal 0.6.3

vim from *buntu lts 14.04:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2014 19:39:59)

@ikcalB
Copy link

ikcalB commented Mar 10, 2015

Debian Jessie (testing)
vim 7.4.488:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 30 2014 04:22:27)
Included patches: 1-488
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by jamessan@
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
+acl             -ebcdic          +localmap        +printer         +title
+arabic          +emacs_tags      +lua             +profile         +toolbar
+autocmd         +eval            +menu            +python          +user_commands
+balloon_eval    +ex_extra        +mksession       -python3         +vertsplit
+browse          +extra_search    +modify_fname    +quickfix        +virtualedit
++builtin_terms  +farsi           +mouse           +reltime         +visual
+byte_offset     +file_in_path    +mouseshape      +rightleft       +visualextra
+cindent         +find_in_path    +mouse_dec       +ruby            +viminfo
+clientserver    +float           +mouse_gpm       +scrollbind      +vreplace
+clipboard       +folding         -mouse_jsbterm   +signs           +wildignore
+cmdline_compl   -footer          +mouse_netterm   +smartindent     +wildmenu
+cmdline_hist    +fork()          +mouse_sgr       -sniff           +windows
+cmdline_info    +gettext         -mouse_sysmouse  +startuptime     +writebackup
+comments        -hangul_input    +mouse_urxvt     +statusline      +X11
+conceal         +iconv           +mouse_xterm     -sun_workshop    -xfontset
+cryptv          +insert_expand   +multi_byte      +syntax          +xim
+cscope          +jumplist        +multi_lang      +tag_binary      +xsmp_interact
+cursorbind      +keymap          -mzscheme        +tag_old_static  +xterm_clipboard
+cursorshape     +langmap         +netbeans_intg   -tag_any_white   -xterm_save
+dialog_con_gui  +libcall         +path_extra      +tcl             +xpm
+diff            +linebreak       +perl            +terminfo
+digraphs        +lispindent      +persistent_undo +termresponse
+dnd             +listcmds        +postscript      +textobjects

I could upload another screenshot (which would look almost identical to the above)
What does it look like on your side!? @morhetz

@morhetz
Copy link
Owner

morhetz commented Mar 11, 2015

@ikcalB
Well that's urxvt actually, but xfce-terminal would be just the same
screenshot - 12 03 2015 - 00 43 09
There is just blinking cursor, color line is only visible at the line-number columns.
I'm confused a little bit. Could you try reproducing this with some clean vimrc like tpope's vim-sensible?

@ikcalB
Copy link

ikcalB commented Mar 25, 2015

@morhetz
tracked it down to :set cursorline (is really handy imho)
any chance to fix that by either

  • having custom cursorline/textstyle at the position of the cursurline? (i.e. for each line highlighted, because it differs, use the BG color as the FG color if it is the cursorline)
  • or disabling cursorline when in diff-mode?

@morhetz
Copy link
Owner

morhetz commented Sep 4, 2015

@AndroidOatmeal, @ikcalB:
That issue should be finally fixed with the latest release

@morhetz morhetz closed this as completed Sep 4, 2015
@ikcalB
Copy link

ikcalB commented Sep 9, 2015

@morhetz Thank you for your effort! Now, the cursorline is "behind" the highlighting of the diff - it seems to vanish.

Can you think of a good possibility, to have a cursorline with good visibility in diff mode?

@morhetz
Copy link
Owner

morhetz commented Sep 9, 2015

@ikcalB That's how it currently works as I suppose that fixes issue
Imgur

Is highlighted line number not enough to distinguish current line?
Currently I have no good idea on how to have a cursorline AND highlighted bg (diff mode) at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants