-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add optional feature: alternating line colors #2903
base: master
Are you sure you want to change the base?
Conversation
internal/display/bufwindow.go
Outdated
@@ -489,6 +489,23 @@ func (w *BufWindow) displayBuffer() { | |||
bloc.X = bslice | |||
|
|||
draw := func(r rune, combc []rune, style tcell.Style, highlight bool, showcursor bool) { | |||
if b.Settings["altlinecolors"].(bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TL;DR I believe this code is messy and buggy. Please see my below descriptions of the bugs I've found. But instead of addressing them individually, I suggest to simply replace this implementation with dmaluka@18d9c5c (which not only simplifies the code but also makes these bugs go away).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great refactor, thank you! Can I replace my changes with it in this pull request? (I'm new to github, sorry if it's silly question)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can use git push --force
. (I'm assuming you are using git, not just github UI?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, replaced with proposed refactor.
To me personally, in your truecolor colorschemes, the difference between alt-line and normal line colors is barely noticeable (unless I look closely). Is it just me? |
I tried making them brighter, but they would become very similar to |
Hello. I really like micro editor and wanted to add this feature. It alternates line colors like in old printer terminals or like excel spreadsheets - it makes navigation easier, especially with long lines:
Code introduces a new bool option:
altlinecolors
, it's set tofalse
by default. If it's set totrue
andalt-line
color is given in the colorscheme, then it would change every other line's bg color to a specified one. I've included a demo colorscheme as well. I also posted a video demo in the Gitter group.