diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2015-02-01 20:28:23 -0300 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-02-02 01:16:41 -0500 |
commit | 4d70aae770e33c45a194634d11b9c49e866dd84b (patch) | |
tree | bb0373a3f6eecd9b7a6dc2c10d29b2250d385319 /src | |
parent | 84ca5f973de7e9ce0fe60d7e3b39d6724dc8af8c (diff) | |
download | rneovim-4d70aae770e33c45a194634d11b9c49e866dd84b.tar.gz rneovim-4d70aae770e33c45a194634d11b9c49e866dd84b.tar.bz2 rneovim-4d70aae770e33c45a194634d11b9c49e866dd84b.zip |
Add EndOfBuffer hl group for ~ lines after the last line in buffers
This makes it possible to highlight the lines starting with ~ at the end
of buffers and other elements highlighted using NonText.
As proposed by mhinz at
https://groups.google.com/forum/#!topic/vim_dev/p3de1iU1GXI/discussion
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/globals.h | 11 | ||||
-rw-r--r-- | src/nvim/option.c | 4 | ||||
-rw-r--r-- | src/nvim/screen.c | 2 | ||||
-rw-r--r-- | src/nvim/syntax.c | 1 |
4 files changed, 10 insertions, 8 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 73bcdea226..1aa90777fa 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -405,7 +405,8 @@ EXTERN int no_check_timestamps INIT(= 0); /* Don't check timestamps */ typedef enum { HLF_8 = 0 /* Meta & special keys listed with ":map", text that is displayed different from what it is */ - , HLF_AT /* @ and ~ characters at end of screen, characters that + , HLF_EOB // after the last line in the buffer + , HLF_AT /* @ characters at end of screen, characters that don't really exist in the text */ , HLF_D /* directories in CTRL-D listing */ , HLF_E /* error messages */ @@ -451,10 +452,10 @@ typedef enum { /* The HL_FLAGS must be in the same order as the HLF_ enums! * When changing this also adjust the default for 'highlight'. */ -#define HL_FLAGS {'8', '@', 'd', 'e', 'i', 'l', 'm', 'M', 'n', 'N', 'r', 's', \ - 'S', 'c', 't', 'v', 'V', 'w', 'W', 'f', 'F', 'A', 'C', 'D', \ - 'T', '-', '>', 'B', 'P', 'R', 'L', '+', '=', 'x', 'X', '*', \ - '#', '_', '!', '.', 'o'} +#define HL_FLAGS {'8', '~', '@', 'd', 'e', 'i', 'l', 'm', 'M', 'n', 'N', 'r', \ + 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', 'f', 'F', 'A', 'C', \ + 'D', 'T', '-', '>', 'B', 'P', 'R', 'L', '+', '=', 'x', 'X', \ + '*', '#', '_', '!', '.', 'o'} EXTERN int highlight_attr[HLF_COUNT]; /* Highl. attr for each context. */ # define USER_HIGHLIGHT diff --git a/src/nvim/option.c b/src/nvim/option.c index 0199c5fc6c..2d16c0fa71 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -365,8 +365,8 @@ typedef struct vimoption { # define ISP_LATIN1 (char_u *)"@,161-255" #define HIGHLIGHT_INIT \ - "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search," \ - "m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine," \ + "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch," \ + "l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine," \ "S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg," \ "W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete," \ "T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare," \ diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 6d25c4359b..9deaa7979f 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1651,7 +1651,7 @@ static void win_update(win_T *wp) /* make sure the rest of the screen is blank */ /* put '~'s on rows that aren't part of the file. */ - win_draw_end(wp, '~', ' ', row, wp->w_height, HLF_AT); + win_draw_end(wp, '~', ' ', row, wp->w_height, HLF_EOB); } /* Reset the type of redrawing required, the window has been updated. */ diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index f24b2aa80a..3c4b45c436 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5781,6 +5781,7 @@ static char *(highlight_init_both[]) = "StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold"), CENT("StatusLineNC term=reverse cterm=reverse", "StatusLineNC term=reverse cterm=reverse gui=reverse"), + "default link EndOfBuffer NonText", CENT("VertSplit term=reverse cterm=reverse", "VertSplit term=reverse cterm=reverse gui=reverse"), CENT("DiffText term=reverse cterm=bold ctermbg=Red", |