Adding RelLineAbove and RelLineBelow highlight groups#624
Adding RelLineAbove and RelLineBelow highlight groups#624shaunbrady wants to merge 1 commit intovim:masterfrom
Conversation
src/screen.c
Outdated
| char_attr, hl_attr(HLF_RNA)); | ||
|
|
||
| if (wp->w_p_rnu && (lnum > wp->w_cursor.lnum)) | ||
| /* high light relative above (<) cursor */ |
There was a problem hiding this comment.
This comment is exactly the same as the above comment.
There was a problem hiding this comment.
Taryn,
Thank you. I have added another commit to fix this obvious issue. I
can leave things as they are, fixup the branch as it sits (rewriting
history), or submit a new PR. Let me know what the project prefers.
Thanks!
SB
On Thu, Feb 4, 2016 at 11:27 PM, Taryn Hill vim-dev-github@256bit.org
wrote:
In src/screen.c #624 (comment)
:@@ -3724,6 +3724,16 @@ win_line(
if ((wp->w_p_cul || wp->w_p_rnu)
&& lnum == wp->w_cursor.lnum)
char_attr = hl_attr(HLF_CLN);
+
if (wp->w_p_rnu && (lnum < wp->w_cursor.lnum))/\* high light relative above (<) cursor */char_attr = hl_combine_attr(char_attr, hl_attr(HLF_RNA));
if (wp->w_p_rnu && (lnum > wp->w_cursor.lnum))/\* high light relative above (<) cursor */This comment is exactly the same as the above comment.
—
Reply to this email directly or view it on GitHub
https://github.com/vim/vim/pull/624/files#r51976064.You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to vim_dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
|
I think it is easier for Bram to apply if you squash it into a single commit, so there is only one single patch. BTW: could you please provide a screenshot? |
b3abac6 to
90e2775
Compare
|
@chrisbra Thanks, I have squashed everything in to one commit, which hopefully should by typo free. Here is a screenshot of the syntax group in action. Please ignore my tortured and hacked .vimrc. The lines used to change the colors are highlighted in purple. |
|
Thanks. This looks useful. Can you please also add some documentation at syntax.txt below |
RelLineAbove is applied to relative line numbers above the cursor line (and Below below). These are added in addition to LineNr so as to not break backwards compatibility. The idea behind these highlight groups is to color relative line numbers above and below the cursor differently.
90e2775 to
bbac91d
Compare
|
@chrisbra I have added some documentation for the new highlight groups. Thanks! |
|
@chrisbra Is there any thing else that is needed? Github tells me no conflicts have crept up since I authored the PR. Thanks! |
|
🎉 |
…ntly Problem: Cannot color number column above/below cursor differently. Solution: Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim#624)
Problem: Cannot color number column above/below cursor differently. Solution: Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624) vim/vim@efae76a
Problem: Cannot color number column above/below cursor differently. Solution: Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624) vim/vim@efae76a
Problem: Cannot color number column above/below cursor differently. Solution: Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624) vim/vim@efae76a

I wanted my relative line numbers to be colored differently above and below the
cursor line. I believe a highlight group applied conditionally is the correct
way to achieve this.
This is my first foray in to the vim sources, so please let me know if I missed
the mark or could do things differently/better.