romainl/Apprentice

debugPC highlight group

gagbo opened this issue · 7 comments

gagbo commented

:Termdebug comes with a feature to insert breakpoints in vim from the editor.

According to the manual, the sign used in the sidebar to show breakpoints is in the highlight group "debugBreakpoint".

For the time being, there is apparently no specific setting for this group, and the "default" I get is Foreground fg with 9 bg in terminal, which is pretty ugly. I think the normal red would be better as a background.

Also, there is a "debugPC" highlight group, which shows the current debugged line in the vim window. The default I get is just a 4 or 12 (I'd say 12) bg on the normal text, which can be a little hard to read with the type keywords being purple.

I don't really know what colours would be good here, hopefully you'll have better taste than me.

EDIT : This may be a terminal colorscheme issue, because it doesn't show at all in the asciinema I uploaded ( here ). The red is a lot darker here than on my laptop. The blue is not exactly the same either, but the readability is still not optimal

I've never use that feature and didn't really have the curiosity to look at what it added/changed/removed.

I'll checkout a recent revision to see what new highlight groups I'll have to add in my colorscheme.

Thanks for the heads-up.

gagbo commented

I stopped reading help 1 line above the interesting part last night :

  • The defaults are, when 'background' is "light":
  hi debugPC term=reverse ctermbg=lightblue guibg=lightblue
  hi debugBreakpoint term=reverse ctermbg=red guibg=red
  • When 'background' is "dark":
  hi debugPC term=reverse ctermbg=darkblue guibg=darkblue
  hi debugBreakpoint term=reverse ctermbg=red guibg=red

@gagbo, take a look at the latest commit. I followed the defaults but with my the apprentice palette.

gagbo commented

Screenshot with purple fg
Screenshot with green fg
Screenshot with overridden black bg

Looks good to me. String litterals in green and special keywords in purple are not especially easy to read, but they'll never be, and at that point I know the code so it doesn't matter if the readbility is not perfect.

Thanks :)

On an unrelated note, I do think that the best hl for a break line would be an "overline" effect (since the execution is stopped just before executing the break line, so visually we would just have a thin line above the next instruction). But if default is changing bg (mostly to have better support I guess), I don't think we'll have anything better than this.

Hmm… I don't like that at all. How about a single foreground color on debugPC instead? Or maybe one of the greys from the palette?

This is the same bg as folds:

screenshot

gagbo commented

It looks much better this way, but it's harder to see where the code is at a glance. The blue is offensive, but I don't have to squint at the code to see where I am. I don't think there's a real good solution here :/

If it were possible to change the colorscheme for one line, having the debugPC line highlighted as sorcerer would be nice. But the code overhead may be prohibitive

gagbo commented

Closed by fdd5935 by the way. I kind of forgot all about this and just arrived on this PR.

The highlights groups are present now so the issue should be closed.