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

:GoCoverage highlight colors broken on xterm #863

Closed
SpComb opened this issue May 19, 2016 · 1 comment
Closed

:GoCoverage highlight colors broken on xterm #863

SpComb opened this issue May 19, 2016 · 1 comment

Comments

@SpComb
Copy link

SpComb commented May 19, 2016

Actual behavior

Running vim on a remote machine over SSH from an Ubuntu laptop's xterm or gnome-terminal:

20160519-vim-go-coverage-xterm-editing

Using :GoCoverage to highlight covered/uncovered lines in a trivial .go file, all syntax highlighting for the file disappears:

20160519-vim-go-coverage-xterm-broken

Expected behavior

I am expecting to see covered/uncovered lines highlighted in different colors.

I suspect the highlight ctermfg=... colors used in coverage.go are somehow wrong, with the following patch:

diff --git a/autoload/go/coverage.vim b/autoload/go/coverage.vim
index 5a0c012..1d0afd1 100644
--- a/autoload/go/coverage.vim
+++ b/autoload/go/coverage.vim
@@ -219,8 +219,8 @@ function! go#coverage#overlay(file)

     syntax manual
     highlight normaltext term=bold ctermfg=59 guifg=#75715E
-    highlight covered term=bold ctermfg=118 guifg=#A6E22E
-    highlight uncover term=bold ctermfg=197 guifg=#F92672
+    highlight covered term=bold ctermfg=green guifg=#A6E22E
+    highlight uncover term=bold ctermfg=red guifg=#F92672

     " clear the matches if we leave the buffer
     autocmd BufWinLeave <buffer> call go#coverage#Clear()

The highlighting seems to work better:

20160519-vim-go-coverage-xterm-working

I have no idea how color terminals are supposed to behave in vim, so I don't know if this is an appropriate fix.

Configuration

  • vim version: 2:7.4.712-2ubuntu4
  • vim-go version: v1.6
  • go version: go1.5.1 linux/amd64
@fatih fatih closed this as completed in 46da9d3 May 21, 2016
@fatih
Copy link
Owner

fatih commented May 21, 2016

Hi @SpComb

Thanks for the feedback. I've pushed the fix to master as you said. It's due xterm and vim problems (check out :help ctermfg for more info).

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

2 participants