To: vim_dev@googlegroups.com Subject: Patch 7.4.2213 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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) Files: runtime/doc/options.txt, runtime/doc/syntax.txt, src/option.c, src/screen.c, src/syntax.c, src/vim.h *** ../vim-7.4.2212/runtime/doc/options.txt 2016-08-12 18:29:36.602738392 +0200 --- runtime/doc/options.txt 2016-08-14 19:40:52.436256938 +0200 *************** *** 3945,3961 **** *'highlight'* *'hl'* 'highlight' 'hl' string (default (as a single string): ! "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, ! w:WarningMsg,W:WildMenu, ! f:Folded,F:FoldColumn,A:DiffAdd, ! C:DiffChange,D:DiffDelete,T:DiffText, ! >:SignColumn,B:SpellBad,P:SpellCap, ! R:SpellRare,L:SpellLocal,-:Conceal, ! +:Pmenu,=:PmenuSel, x:PmenuSbar,X:PmenuThumb") global {not in Vi} --- 3945,3960 ---- *'highlight'* *'hl'* 'highlight' 'hl' string (default (as a single string): ! "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,w:WarningMsg,W:WildMenu,f:Folded, ! F:FoldColumn,A:DiffAdd,C:DiffChange, ! D:DiffDelete,T:DiffText,>:SignColumn, ! B:SpellBad,P:SpellCap,R:SpellRare, ! L:SpellLocal,-:Conceal,+:Pmenu,=:PmenuSel, x:PmenuSbar,X:PmenuThumb") global {not in Vi} *************** *** 3964,3970 **** first character in a pair gives the occasion, the second the mode to use for that occasion. The occasions are: |hl-SpecialKey| 8 Meta and special keys listed with ":map" ! |hl-NonText| @ '~' and '@' at the end of the window and characters from 'showbreak' |hl-Directory| d directories in CTRL-D listing and other special things in listings --- 3963,3970 ---- first character in a pair gives the occasion, the second the mode to use for that occasion. The occasions are: |hl-SpecialKey| 8 Meta and special keys listed with ":map" ! |hl-EndOfBuffer| ~ lines after the last line in the buffer ! |hl-NonText| @ '@' at the end of the window and characters from 'showbreak' |hl-Directory| d directories in CTRL-D listing and other special things in listings *** ../vim-7.4.2212/runtime/doc/syntax.txt 2016-01-19 22:28:54.611593027 +0100 --- runtime/doc/syntax.txt 2016-08-14 19:40:52.436256938 +0200 *************** *** 4725,4730 **** --- 4870,4878 ---- DiffDelete diff mode: Deleted line |diff.txt| *hl-DiffText* 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* ErrorMsg error messages on the command line *hl-VertSplit* *************** *** 4753,4762 **** *hl-MoreMsg* MoreMsg |more-prompt| *hl-NonText* ! NonText '~' and '@' at the end of the window, characters from ! 'showbreak' and other characters that do not really exist in ! the text (e.g., ">" displayed when a double-wide character ! doesn't fit at the end of the line). *hl-Normal* Normal normal text *hl-Pmenu* --- 4901,4910 ---- *hl-MoreMsg* MoreMsg |more-prompt| *hl-NonText* ! NonText '@' at the end of the window, characters from 'showbreak' ! and other characters that do not really exist in the text ! (e.g., ">" displayed when a double-wide character doesn't ! fit at the end of the line). *hl-Normal* Normal normal text *hl-Pmenu* *** ../vim-7.4.2212/src/option.c 2016-08-14 16:07:44.721705396 +0200 --- src/option.c 2016-08-14 19:40:52.436256938 +0200 *************** *** 471,477 **** #if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \ || defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \ || 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" #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" #endif --- 471,477 ---- #if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \ || defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \ || defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) || defined(FEAT_CONCEAL) ! # 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 # 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 *** ../vim-7.4.2212/src/screen.c 2016-08-12 18:29:36.614738284 +0200 --- src/screen.c 2016-08-14 19:40:52.436256938 +0200 *************** *** 2205,2211 **** /* 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); } /* Reset the type of redrawing required, the window has been updated. */ --- 2205,2211 ---- /* 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_EOB); } /* Reset the type of redrawing required, the window has been updated. */ *** ../vim-7.4.2212/src/syntax.c 2016-08-14 16:07:44.721705396 +0200 --- src/syntax.c 2016-08-14 19:40:52.440256901 +0200 *************** *** 6789,6794 **** --- 6789,6795 ---- "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", #ifdef FEAT_WINDOWS CENT("VertSplit term=reverse cterm=reverse", "VertSplit term=reverse cterm=reverse gui=reverse"), *** ../vim-7.4.2212/src/vim.h 2016-08-10 20:53:01.679116172 +0200 --- src/vim.h 2016-08-14 19:40:52.440256901 +0200 *************** *** 1363,1369 **** { 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 don't really exist in the text */ , HLF_D /* directories in CTRL-D listing */ , HLF_E /* error messages */ --- 1363,1370 ---- { HLF_8 = 0 /* Meta & special keys listed with ":map", text that is displayed different from what it is */ ! , 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 */ *************** *** 1410,1416 **** /* 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', 'h', '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', \ --- 1411,1417 ---- /* 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', 'h', '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', \ *** ../vim-7.4.2212/src/version.c 2016-08-14 19:08:41.842022237 +0200 --- src/version.c 2016-08-14 19:43:06.987019098 +0200 *************** *** 765,766 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2213, /**/ -- Far back in the mists of ancient time, in the great and glorious days of the former Galactic Empire, life was wild, rich and largely tax free. Mighty starships plied their way between exotic suns, seeking adventure and reward among the furthest reaches of Galactic space. In those days, spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri. And all dared to brave unknown terrors, to do mighty deeds, to boldly split infinitives that no man had split before -- and thus was the Empire forged. -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///