patch 7.4.2213

Problem:    Cannot highlight the "~" lines at the end of a window differently.
Solution:   Add the EndOfBuffer highlighting. (Marco Hinz, James McCoy)
This commit is contained in:
Bram Moolenaar
2016-08-14 19:54:54 +02:00
parent e59215c7dc
commit 58b853460a
8 changed files with 167 additions and 158 deletions

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2016 Aug 12 *eval.txt* For Vim version 7.4. Last change: 2016 Aug 14
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -140,10 +140,10 @@ You will not get an error if you try to change the type of a variable.
1.2 Function references ~ 1.2 Function references ~
*Funcref* *E695* *E718* *Funcref* *E695* *E718*
A Funcref variable is obtained with the |function()| function or created with A Funcref variable is obtained with the |function()| function, the |funcref()|
the lambda expression |expr-lambda|. It can be used in an expression in the function or created with the lambda expression |expr-lambda|. It can be used
place of a function name, before the parenthesis around the arguments, to in an expression in the place of a function name, before the parenthesis
invoke the function it refers to. Example: > around the arguments, to invoke the function it refers to. Example: >
:let Fn = function("MyFunc") :let Fn = function("MyFunc")
:echo Fn() :echo Fn()
@@ -175,8 +175,8 @@ arguments: >
*Partial* *Partial*
A Funcref optionally binds a Dictionary and/or arguments. This is also called A Funcref optionally binds a Dictionary and/or arguments. This is also called
a Partial. This is created by passing the Dictionary and/or arguments to a Partial. This is created by passing the Dictionary and/or arguments to
function(). When calling the function the Dictionary and/or arguments will be function() or funcref(). When calling the function the Dictionary and/or
passed to the function. Example: > arguments will be passed to the function. Example: >
let Cb = function('Callback', ['foo'], myDict) let Cb = function('Callback', ['foo'], myDict)
call Cb() call Cb()
@@ -1120,8 +1120,10 @@ A string constant accepts these special characters:
\\ backslash \\ backslash
\" double quote \" double quote
\<xxx> Special key named "xxx". e.g. "\<C-W>" for CTRL-W. This is for use \<xxx> Special key named "xxx". e.g. "\<C-W>" for CTRL-W. This is for use
in mappings, the 0x80 byte is escaped. Don't use <Char-xxxx> to get a in mappings, the 0x80 byte is escaped.
utf-8 character, use \uxxxx as mentioned above. To use the double quote character it must be escaped: "<M-\">".
Don't use <Char-xxxx> to get a utf-8 character, use \uxxxx as
mentioned above.
Note that "\xff" is stored as the byte 255, which may be invalid in some Note that "\xff" is stored as the byte 255, which may be invalid in some
encodings. Use "\u00ff" to store character 255 according to the current value encodings. Use "\u00ff" to store character 255 according to the current value
@@ -2081,7 +2083,7 @@ garbagecollect([{atexit}]) none free memory, breaking cyclic references
get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def} get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def} get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
get({func}, {what}) any get property of funcref/partial {func} get({func}, {what}) any get property of funcref/partial {func}
getbufinfo( [{expr}]) List information about buffers getbufinfo([{expr}]) List information about buffers
getbufline({expr}, {lnum} [, {end}]) getbufline({expr}, {lnum} [, {end}])
List lines {lnum} to {end} of buffer {expr} List lines {lnum} to {end} of buffer {expr}
getbufvar({expr}, {varname} [, {def}]) getbufvar({expr}, {varname} [, {def}])
@@ -2112,12 +2114,12 @@ getqflist([{what}]) List list of quickfix items
getreg([{regname} [, 1 [, {list}]]]) getreg([{regname} [, 1 [, {list}]]])
String or List contents of register String or List contents of register
getregtype([{regname}]) String type of register getregtype([{regname}]) String type of register
gettabinfo( [{expr}]) List list of tab pages gettabinfo([{expr}]) List list of tab pages
gettabvar({nr}, {varname} [, {def}]) gettabvar({nr}, {varname} [, {def}])
any variable {varname} in tab {nr} or {def} any variable {varname} in tab {nr} or {def}
gettabwinvar({tabnr}, {winnr}, {name} [, {def}]) gettabwinvar({tabnr}, {winnr}, {name} [, {def}])
any {name} in {winnr} in tab page {tabnr} any {name} in {winnr} in tab page {tabnr}
getwininfo( [{winid}]) List list of windows getwininfo([{winid}]) List list of windows
getwinposx() Number X coord in pixels of GUI Vim window getwinposx() Number X coord in pixels of GUI Vim window
getwinposy() Number Y coord in pixels of GUI Vim window getwinposy() Number Y coord in pixels of GUI Vim window
getwinvar({nr}, {varname} [, {def}]) getwinvar({nr}, {varname} [, {def}])
@@ -3983,7 +3985,7 @@ get({func}, {what})
*getbufinfo()* *getbufinfo()*
getbufinfo([{expr}]) getbufinfo([{expr}])
getbufinfo([{dict}]) getbufinfo([{dict}])
Get information aobut buffers as a List of Dictionaries. Get information about buffers as a List of Dictionaries.
Without an argument information about all the buffers is Without an argument information about all the buffers is
returned. returned.
@@ -4375,7 +4377,7 @@ getline({lnum} [, {end}])
< To get lines from another buffer see |getbufline()| < To get lines from another buffer see |getbufline()|
getloclist({nr},[, {what}]) *getloclist()* getloclist({nr}[, {what}]) *getloclist()*
Returns a list with all the entries in the location list for Returns a list with all the entries in the location list for
window {nr}. {nr} can be the window number or the window ID. window {nr}. {nr} can be the window number or the window ID.
When {nr} is zero the current window is used. When {nr} is zero the current window is used.
@@ -4640,7 +4642,7 @@ glob2regpat({expr}) *glob2regpat()*
< When {expr} is an empty string the result is "^$", match an < When {expr} is an empty string the result is "^$", match an
empty string. empty string.
Note that the result depends on the system. On MS-Windows Note that the result depends on the system. On MS-Windows
a backslash usually means a patch separator. a backslash usually means a path separator.
*globpath()* *globpath()*
globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]]) globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
@@ -6657,7 +6659,7 @@ setline({lnum}, {text}) *setline()*
:endfor :endfor
< Note: The '[ and '] marks are not set. < Note: The '[ and '] marks are not set.
setloclist({nr}, {list} [, {action}[, {what}]) *setloclist()* setloclist({nr}, {list}[, {action}[, {what}]]) *setloclist()*
Create or replace or add to the location list for window {nr}. Create or replace or add to the location list for window {nr}.
{nr} can be the window number or the window ID. {nr} can be the window number or the window ID.
When {nr} is zero the current window is used. When {nr} is zero the current window is used.
@@ -7347,9 +7349,9 @@ substitute({expr}, {pat}, {sub}, {flags}) *substitute()*
optional argument. Example: > optional argument. Example: >
:echo substitute(s, '%\(\x\x\)', SubNr, 'g') :echo substitute(s, '%\(\x\x\)', SubNr, 'g')
< The optional argument is a list which contains the whole < The optional argument is a list which contains the whole
matched string and up to nine submatches,like what matched string and up to nine submatches, like what
|submatch()| returns. Example: > |submatch()| returns. Example: >
:echo substitute(s, '\(\x\x\)', {m -> '0x' . m[1]}, 'g') :echo substitute(s, '%\(\x\x\)', {m -> '0x' . m[1]}, 'g')
synID({lnum}, {col}, {trans}) *synID()* synID({lnum}, {col}, {trans}) *synID()*
The result is a Number, which is the syntax ID at the position The result is a Number, which is the syntax ID at the position
@@ -8207,7 +8209,7 @@ dialog_con Compiled with console dialog support.
dialog_gui Compiled with GUI dialog support. dialog_gui Compiled with GUI dialog support.
diff Compiled with |vimdiff| and 'diff' support. diff Compiled with |vimdiff| and 'diff' support.
digraphs Compiled with support for digraphs. digraphs Compiled with support for digraphs.
directx Compiled with support for Direct-X and 'renderoptions'. directx Compiled with support for DirectX and 'renderoptions'.
dnd Compiled with support for the "~ register |quote_~|. dnd Compiled with support for the "~ register |quote_~|.
ebcdic Compiled on a machine with ebcdic character set. ebcdic Compiled on a machine with ebcdic character set.
emacs_tags Compiled with support for Emacs tags. emacs_tags Compiled with support for Emacs tags.

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.4. Last change: 2016 Aug 12 *options.txt* For Vim version 7.4. Last change: 2016 Aug 14
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3945,17 +3945,16 @@ A jump table for the options with a short description can be found at |Q_op|.
*'highlight'* *'hl'* *'highlight'* *'hl'*
'highlight' 'hl' string (default (as a single string): 'highlight' 'hl' string (default (as a single string):
"8:SpecialKey,@:NonText,d:Directory, "8:SpecialKey,~:EndOfBuffer,@:NonText,
e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg, d:Directory,e:ErrorMsg,i:IncSearch,
M:ModeMsg,n:LineNr,N:CursorLineNr, l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,
r:Question,s:StatusLine,S:StatusLineNC, N:CursorLineNr,r:Question,s:StatusLine,
c:VertSplit, t:Title,v:Visual, S:StatusLineNC,c:VertSplit,t:Title,
w:WarningMsg,W:WildMenu, v:Visual,w:WarningMsg,W:WildMenu,f:Folded,
f:Folded,F:FoldColumn,A:DiffAdd, F:FoldColumn,A:DiffAdd,C:DiffChange,
C:DiffChange,D:DiffDelete,T:DiffText, D:DiffDelete,T:DiffText,>:SignColumn,
>:SignColumn,B:SpellBad,P:SpellCap, B:SpellBad,P:SpellCap,R:SpellRare,
R:SpellRare,L:SpellLocal,-:Conceal, L:SpellLocal,-:Conceal,+:Pmenu,=:PmenuSel,
+:Pmenu,=:PmenuSel,
x:PmenuSbar,X:PmenuThumb") x:PmenuSbar,X:PmenuThumb")
global global
{not in Vi} {not in Vi}
@@ -3964,7 +3963,8 @@ A jump table for the options with a short description can be found at |Q_op|.
first character in a pair gives the occasion, the second the mode to first character in a pair gives the occasion, the second the mode to
use for that occasion. The occasions are: use for that occasion. The occasions are:
|hl-SpecialKey| 8 Meta and special keys listed with ":map" |hl-SpecialKey| 8 Meta and special keys listed with ":map"
|hl-NonText| @ '~' and '@' at the end of the window and |hl-EndOfBuffer| ~ lines after the last line in the buffer
|hl-NonText| @ '@' at the end of the window and
characters from 'showbreak' characters from 'showbreak'
|hl-Directory| d directories in CTRL-D listing and other special |hl-Directory| d directories in CTRL-D listing and other special
things in listings things in listings
@@ -7936,8 +7936,8 @@ A jump table for the options with a short description can be found at |Q_op|.
"xterm", "xterm2", "urxvt" or "sgr" (because dec mouse codes conflict "xterm", "xterm2", "urxvt" or "sgr" (because dec mouse codes conflict
with them). with them).
This option is automatically set to "xterm", when the 'term' option is This option is automatically set to "xterm", when the 'term' option is
set to a name that starts with "xterm", "mlterm", or "screen", and set to a name that starts with "xterm", "mlterm", "screen", "st" (full
'ttymouse' is not set already. match only), "st-" or "stterm", and 'ttymouse' is not set already.
Additionally, if vim is compiled with the |+termresponse| feature and Additionally, if vim is compiled with the |+termresponse| feature and
|t_RV| is set to the escape sequence to request the xterm version |t_RV| is set to the escape sequence to request the xterm version
number, more intelligent detection process runs. number, more intelligent detection process runs.

View File

@@ -4870,6 +4870,9 @@ DiffChange diff mode: Changed line |diff.txt|
DiffDelete diff mode: Deleted line |diff.txt| DiffDelete diff mode: Deleted line |diff.txt|
*hl-DiffText* *hl-DiffText*
DiffText diff mode: Changed text within a changed line |diff.txt| DiffText diff mode: Changed text within a changed line |diff.txt|
*hl-EndofBuffer*
EndOfBuffer filler lines (~) after the last line in the buffer.
By default, this is highlighted like |hl-NonText|.
*hl-ErrorMsg* *hl-ErrorMsg*
ErrorMsg error messages on the command line ErrorMsg error messages on the command line
*hl-VertSplit* *hl-VertSplit*
@@ -4898,10 +4901,10 @@ ModeMsg 'showmode' message (e.g., "-- INSERT --")
*hl-MoreMsg* *hl-MoreMsg*
MoreMsg |more-prompt| MoreMsg |more-prompt|
*hl-NonText* *hl-NonText*
NonText '~' and '@' at the end of the window, characters from NonText '@' at the end of the window, characters from 'showbreak'
'showbreak' and other characters that do not really exist in and other characters that do not really exist in the text
the text (e.g., ">" displayed when a double-wide character (e.g., ">" displayed when a double-wide character doesn't
doesn't fit at the end of the line). fit at the end of the line).
*hl-Normal* *hl-Normal*
Normal normal text Normal normal text
*hl-Pmenu* *hl-Pmenu*

View File

@@ -471,7 +471,7 @@ struct vimoption
#if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \ #if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
|| defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \ || defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \
|| defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) || defined(FEAT_CONCEAL) || defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) || defined(FEAT_CONCEAL)
# 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,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,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn" # define HIGHLIGHT_INIT "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,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn"
#else #else
# 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,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill" # 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,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
#endif #endif

View File

@@ -2205,7 +2205,7 @@ win_update(win_T *wp)
/* make sure the rest of the screen is blank */ /* make sure the rest of the screen is blank */
/* put '~'s on rows that aren't part of the file. */ /* 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. */ /* Reset the type of redrawing required, the window has been updated. */

View File

@@ -6789,6 +6789,7 @@ static char *(highlight_init_both[]) =
"StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold"), "StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold"),
CENT("StatusLineNC term=reverse cterm=reverse", CENT("StatusLineNC term=reverse cterm=reverse",
"StatusLineNC term=reverse cterm=reverse gui=reverse"), "StatusLineNC term=reverse cterm=reverse gui=reverse"),
"default link EndOfBuffer NonText",
#ifdef FEAT_WINDOWS #ifdef FEAT_WINDOWS
CENT("VertSplit term=reverse cterm=reverse", CENT("VertSplit term=reverse cterm=reverse",
"VertSplit term=reverse cterm=reverse gui=reverse"), "VertSplit term=reverse cterm=reverse gui=reverse"),

View File

@@ -763,6 +763,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2213,
/**/ /**/
2212, 2212,
/**/ /**/

View File

@@ -1363,7 +1363,8 @@ typedef enum
{ {
HLF_8 = 0 /* Meta & special keys listed with ":map", text that is HLF_8 = 0 /* Meta & special keys listed with ":map", text that is
displayed different from what it 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 */ don't really exist in the text */
, HLF_D /* directories in CTRL-D listing */ , HLF_D /* directories in CTRL-D listing */
, HLF_E /* error messages */ , HLF_E /* error messages */
@@ -1410,7 +1411,7 @@ typedef enum
/* The HL_FLAGS must be in the same order as the HLF_ enums! /* The HL_FLAGS must be in the same order as the HLF_ enums!
* When changing this also adjust the default for 'highlight'. */ * When changing this also adjust the default for 'highlight'. */
#define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \ #define HL_FLAGS {'8', '~', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
'n', 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \ 'n', 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
'f', 'F', 'A', 'C', 'D', 'T', '-', '>', \ 'f', 'F', 'A', 'C', 'D', 'T', '-', '>', \
'B', 'P', 'R', 'L', \ 'B', 'P', 'R', 'L', \