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

Carets in status line #37

Closed
deniciocode opened this issue Jul 14, 2017 · 16 comments · Fixed by #58
Closed

Carets in status line #37

deniciocode opened this issue Jul 14, 2017 · 16 comments · Fixed by #58

Comments

@deniciocode
Copy link

Something weird happens on the fussy search with ctrl-p
NORD:
image

OTHER:
image

As you can see, the first image shows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@arcticicestudio
Copy link
Contributor

Have you tried with a empty ~/.vimrc? The theme itself doesn't even contain the ^ character so I've no idea how to reproduce this. Is this happening every time or just in specific situations?

@deniciocode
Copy link
Author

deniciocode commented Jul 15, 2017

Hi,

this happens all the time and only with the nord colorscheme.

Still if I empty the vimrc this is still happening.

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Jul 15, 2017

Can you try if this still happens when using the develop branch please? I've merged #33 some hours ago which adds basic token matching color support for CtrlP. Maybe the weird output is produced by a internal regex which needs the specific highlight group to be present on the current theme.

If this still doesn't fix it would you mind to open a issue in ctrlpvim/ctrlp.vim and link back to this issue?

Also which OS and version of Vim/NVim, shell (bash, zsh) and terminal emulator are you running?

@dylnmc
Copy link
Contributor

dylnmc commented Jul 16, 2017

@arcticicestudio @DenniJensen This happened to me in gvim (I have to work in Windows at work), and the cause is that "StatusLine" and "StatusLineNC" are set to the same colors.

If you comment out call s:hi("StatusLineNC", s:nord4_gui, s:nord0_gui, s:nord8_term, "NONE", "NONE", "") in .../nord/colors/nord.vim @DenniJensen then you will get rid of those annoying carets.

(I was getting them in vim-airline on windows. Indeed, commenting out StatusLineNC was the only fix I could find -- first I tried setting different options.)

@arcticicestudio I don't know how most people handle this, but perhaps you can look @ solarized's colors/solarized.vim and look at StatusLine and StatusLineNC (they do not have them set to same values).


You can find some useful info here: https://stackoverflow.com/questions/7223309/vim-statusline-uses-carret-symbols-for-spaces-how-to-switch-to-spaces

Furthermore, that SO post notes that :help StatusLineNC indicates this problem (but it surely is hidden deep in the help).


cheers,
dylnmc


p.s. I should note, that I do not experience this issue on linux (and I assume that Os X would fair similarly since it is "*nix" -- sort of).

@dylnmc
Copy link
Contributor

dylnmc commented Jul 16, 2017

Also, can we change the title to Carets in StatusLine if this is the issue so that it is not misleading and people can find this easier from a search engine?

(sorry if I am being picky.)

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Jul 17, 2017

Thanks @dylnmc for your detailed investigation 👍
The StatusLine and StatusLineNC are actually different, a inactive window has a kind of transparent status line (same background color as all lines) while a active window uses nord1 which is almost the same style like many other color schemes handle it.

Maybe @DenniJensen can try to set the fillchar by adding set fillchars+=stl:\ ,stlnc:\ for the status line to the ~/.vimrc to try to replace the default ^ character with a whitespace.

@arcticicestudio arcticicestudio changed the title CtrlP Carets in status line Jul 17, 2017
@arcticicestudio arcticicestudio modified the milestone: 0.6.0 Jul 17, 2017
@dylnmc
Copy link
Contributor

dylnmc commented Jul 17, 2017

maybe this is for another issue, since this is not related to ctrlp, but...

I left colors/nord.vim alone and opened a split (and then typed :set fillchars+=stl:\ ,stlnc:\ ). Result:

statusnc

I think that if the foreground and background are the same (and the fillchars are the same) (at least on some machines or in some circumstances that I am not quite aware of), then the logic is that you wouldn't know which buffer you're in (if there is a split). So, vim replaces the spaces with carets so that you know which buffer you're in (I didn't really see any documentation on that, but it's what I presume). I wish there were a good way to disable this, but vim seems to force its hand.

The GUI groups are the same. I actually changed to:

call s:hi("StatusLine", s:nord4_gui, s:nord0_gui, s:nord8_term, s:nord1_term, "NONE", "")
call s:hi("StatusLineNC", s:nord4_gui, s:nord8_gui, s:nord8_term, "NONE", "NONE", "")

Which fixes my caret problems.

@dylnmc
Copy link
Contributor

dylnmc commented Jul 17, 2017

Also, I just tried ctrlp.vim in gvim at work. I was getting this:

statusnc

Changing the the "StatusLineNC" guibg to s:nord8_gui fixed it for me here, too.

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Jul 18, 2017

The StatusLine and StatusLineNC groups are actually different:

call s:hi("StatusLine", s:nord4_gui, s:nord0_gui, s:nord8_term, s:nord1_term, "NONE", "")
call s:hi("StatusLineNC", s:nord4_gui, s:nord0_gui, s:nord8_term, "NONE", "NONE", "")

As you can see the inactive status line will have no background color (NONE) while the active one is colorized with nord1 (s:nord1_term) which makes it easily recognizable.

An acceptable solution would be to change the foreground of the StatusLineNC group to nord4 while the nord8 foreground color for active status line would still be fine.

I've also tried to reproduce the problem, but even with GVim on Windows 7 (VirtualBox) everything works fine.

gh-37-scrot-window-7-gvim

gh-37-scrot-windows7-gvim

At the moment I am somewhat questioned what exactly causes the problem. If it really depends on a different background color of both status line groups I need to think on how to change these without totally messing up the theme ambiance.

@dylnmc Have you tried to add set fillchars+=stl:\ ,stlnc:\ (note that there is a whitespace at the end!) to your ~/.vimrc instead of setting it manually when Vim is already running?

@dylnmc
Copy link
Contributor

dylnmc commented Jul 18, 2017

Yes, I did try to set fillchars (with whitespace at end). I think it's because in you set gui colors (not term colors) to same. GUI is set to s:nord4_gui, s:nord0_gui and NONE for guifg, guibg, and guisp (respectively) for both StatusLine and StatusLineNC, are they not?

The term is fine since you set the atts differently. But GUI is same .. I think(?).

ps I'm not using vim in mingw; I'm using gvim (somewhat unfortunately).

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Sep 14, 2017

I must have been totally thought blocking to not see that this issue is related to the GUI mode only 😵

@skrobul opened PR #46 some days ago which improves the visibility of the status line in GUI mode, but this would also fix this issue.

I've already prepared a change/fix for this issue some time ago and would like to start a poll which solution would fit the best. Both solutions will use nord8 as foreground color for active status lines and nord4 for inactive ones to ensure users can easily see the which window is focused.

Solution 1 - Different background colors for active- and inactive status lines

This solution makes use of contrast difference by using different background colors for active (focused windows)- and inactive (unfocused windows) status lines.

call s:hi("StatusLine", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "NONE", "")
call s:hi("StatusLineNC", s:nord4_gui, s:nord1_gui, "NONE", s:nord1_term, "NONE", "")

gh-37-scrot-preview-diff_bg

One really small drawback would be that the background color of inactive status lines would collide with the background color for the cursor line (:set cursorline), but this would only be noticeable when the cursor position is right next to the status line.

gh-37-scrot-preview-diff_bg-cursorline

Solution 2 - Uniform background colors for active- and inactive status lines

This solution makes use of the same background color for active (focused windows)- and inactive (unfocused windows) status lines to achieve a uniform style while the nord8 foreground color indicates which window is focused.

call s:hi("StatusLine", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "NONE", "")
call s:hi("StatusLineNC", s:nord4_gui, s:nord3_gui, "NONE", s:nord3_term, "NONE", "")

gh-37-scrot-preview

It works fine with the cursor line background color (:set cursorline).

gh-37-scrot-preview-cursorline

My personal choice is solution 1 since the small drawback is hardly noticeable and the contrast difference increases the UX by keeping the focus of the user to the active window while fading out currently unused UI elements.

I'd like to hear some opinions which solution would fit the best so this issue can finally be fixed which would include @skrobul propose to improve the status line visibility.

@dylnmc
Copy link
Contributor

dylnmc commented Sep 14, 2017

I'm voting for option 2 because it's easier to differentiate the cursorline (something I use). I also haven't been using nord as much recently, so don't weight my vote as much as current heavy users. It also seems more consistent (to me) to have the statusline be same color.

Although, in option 1 the window does stand out more..

At least StatusLine and StatusLineNC will be different now and visible! 👍 That's the most important issue—and both solutions look great!

@skrobul
Copy link

skrobul commented Sep 14, 2017

I think my vote goes towards option 1, but it's also somehow skewed because I stopped using cursorline (due to slowness with tmux).
Also, as you said this is noticeable only if your cursor happens to be just next to the status line. In my opinion your eye still can figure out where the cursor line is pretty quickly because it's the only line that is in different color AND empty.

One more thing - if in doubt, why not make it an option?

edit: by option I mean a setting like g:nord_italic_comments

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Sep 16, 2017

@skrobul Making it configurable sounds like a nice approach to support both styles. We should go with option 1 as default and make option 2 opt-in.

@arcticicestudio arcticicestudio added this to the 0.7.0 milestone Sep 22, 2017
@dylnmc
Copy link
Contributor

dylnmc commented Sep 26, 2017

I created pull req for new statusline following exactly what you laid out.

Configure with

let g:nord_statusline_uniform = 1

screenshot (left: uniform=1; right: uniform=0 (default)):

screenshot from 2017-09-25 20-42-34

Please note that this may not work exactly as desired in airline or lightline; I'm just trying to get this into develop so that I can use plug 'arcticicestudio/nord-vim', { 'branch': 'develop' }

ps, I am not sure why things can't be merged automagically, but there are a lot of commits to develop (many of which fix issues I have been experiencing—especially in gvim, which I must use for work), so I do hope that these can be merged soon-ish.

Thanks again for everything and hopefully this saved you a couple minutes 😛

pps, I also like the default option best (option 1) 😃

ppps, I think there was a merge conflict with something; I didn't thoroughly review, as I should have, but hopefully, it is merely the readme.

@deniciocode
Copy link
Author

It is fixed. Thx 👍

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

Successfully merging a pull request may close this issue.

5 participants