To: vim-dev@vim.org Subject: Patch 6.2.516 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.516 Problem: The sign column cannot be seen, looks like there are two spaces before the text. (Rob Retter) Solution: Add the SignColumn highlight group. Files: runtime/doc/options.txt, runtime/doc/sign.txt, src/option.c, src/screen.c, src/syntax.c, src/vim.h *** ../vim-6.2.515/runtime/doc/options.txt Mon Apr 19 17:00:44 2004 --- runtime/doc/options.txt Thu Apr 29 15:51:04 2004 *************** *** 1,4 **** ! *options.txt* For Vim version 6.2. Last change: 2004 Apr 18 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *options.txt* For Vim version 6.2. Last change: 2004 Apr 29 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 3052,3058 **** M:ModeMsg,n:LineNr,r:Question, s:StatusLine,S:StatusLineNC,c:VertSplit t:Title,v:Visual,w:WarningMsg,W:WildMenu, ! f:Folded,F:FoldColumn") global {not in Vi} This option can be used to set highlighting mode for various --- 3076,3084 ---- M:ModeMsg,n:LineNr,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") global {not in Vi} This option can be used to set highlighting mode for various *************** *** 3084,3089 **** --- 3110,3116 ---- |hl-WildMenu| W wildcard matches displayed for 'wildmenu' |hl-Folded| f line used for closed folds |hl-FoldColumn| F 'foldcolumn' + |hl-SignColumn| > column used for |signs| The display modes are: r reverse (termcap entry "mr" and "me") *** ../vim-6.2.515/runtime/doc/sign.txt Sun Jun 1 12:20:35 2003 --- runtime/doc/sign.txt Thu Apr 29 15:53:36 2004 *************** *** 1,4 **** ! *sign.txt* For Vim version 6.2. Last change: 2003 Apr 19 VIM REFERENCE MANUAL by Gordon Prieur --- 1,4 ---- ! *sign.txt* For Vim version 6.2. Last change: 2004 Apr 29 VIM REFERENCE MANUAL by Gordon Prieur *************** *** 14,20 **** {only available when compiled with the |+signs| feature} ============================================================================== ! 1. Introduction *sign-intro* When a debugger or other IPE tool is driving an editor it needs to be able to give specific highlights which quickly tell the user useful information --- 14,20 ---- {only available when compiled with the |+signs| feature} ============================================================================== ! 1. Introduction *sign-intro* *signs* When a debugger or other IPE tool is driving an editor it needs to be able to give specific highlights which quickly tell the user useful information *************** *** 45,51 **** When signs are defined for a file, Vim will automatically add a column of two characters to display them in. When the last sign is unplaced the column ! disappears again. ============================================================================== 2. Commands *sign-commands* *:sig* *:sign* --- 45,54 ---- When signs are defined for a file, Vim will automatically add a column of two characters to display them in. When the last sign is unplaced the column ! disappears again. The color of the column is set with the SignColumn group ! |hl-SignColumn|. Example to set the color: > ! ! :highlight SignColumn guibg=darkgrey ============================================================================== 2. Commands *sign-commands* *:sig* *:sign* *** ../vim-6.2.515/src/option.c Mon Apr 19 20:26:43 2004 --- src/option.c Thu Apr 29 15:48:51 2004 *************** *** 1072,1078 **** {(char_u *)FALSE, (char_u *)0L}}, {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP, (char_u *)&p_hl, PV_NONE, ! {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,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", (char_u *)0L}}, {"history", "hi", P_NUM|P_VIM, (char_u *)&p_hi, PV_NONE, --- 1072,1078 ---- {(char_u *)FALSE, (char_u *)0L}}, {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP, (char_u *)&p_hl, PV_NONE, ! {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,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", (char_u *)0L}}, {"history", "hi", P_NUM|P_VIM, (char_u *)&p_hi, PV_NONE, *** ../vim-6.2.515/src/screen.c Mon Apr 19 20:26:43 2004 --- src/screen.c Thu Apr 29 16:25:40 2004 *************** *** 1864,1869 **** --- 1864,1887 ---- #endif } + #ifdef FEAT_SIGNS + static int draw_signcolumn __ARGS((win_T *wp)); + + /* + * Return TRUE when window "wp" has a column to draw signs in. + */ + static int + draw_signcolumn(wp) + win_T *wp; + { + return (wp->w_buffer->b_signlist != NULL + # ifdef FEAT_NETBEANS_INTG + || usingNetbeans + # endif + ); + } + #endif + /* * Clear the rest of the window and mark the unused lines with "c1". use "c2" * as the filler character. *************** *** 1877,1883 **** int endrow; enum hlf_value hl; { ! #if defined(FEAT_FOLDING) || defined(FEAT_CMDWIN) int n = 0; # define FDC_OFF n #else --- 1895,1901 ---- int endrow; enum hlf_value hl; { ! #if defined(FEAT_FOLDING) || defined(FEAT_SIGNS) || defined(FEAT_CMDWIN) int n = 0; # define FDC_OFF n #else *************** *** 1901,1906 **** --- 1919,1938 ---- ' ', ' ', hl_attr(HLF_FC)); } # endif + # ifdef FEAT_SIGNS + if (draw_signcolumn(wp)) + { + int nn = n + 2; + + /* draw the sign column left of the fold column */ + if (nn > wp->w_width) + nn = wp->w_width; + screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, + W_ENDCOL(wp) - nn, (int)W_ENDCOL(wp) - n, + ' ', ' ', hl_attr(HLF_SC)); + n = nn; + } + # endif screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, W_WINCOL(wp), W_ENDCOL(wp) - 1 - FDC_OFF, c2, c2, hl_attr(hl)); *************** *** 1937,1942 **** --- 1969,1988 ---- n = nn; } #endif + #ifdef FEAT_SIGNS + if (draw_signcolumn(wp)) + { + int nn = n + 2; + + /* draw the sign column after the fold column */ + if (nn > W_WIDTH(wp)) + nn = W_WIDTH(wp); + screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, + W_WINCOL(wp) + n, (int)W_WINCOL(wp) + nn, + ' ', ' ', hl_attr(HLF_SC)); + n = nn; + } + #endif screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, W_WINCOL(wp) + FDC_OFF, (int)W_ENDCOL(wp), c1, c2, hl_attr(hl)); *************** *** 2032,2038 **** #ifdef FEAT_SIGNS /* If signs are being displayed, add two spaces. */ ! if (wp->w_buffer->b_signlist != NULL) { len = W_WIDTH(wp) - col; if (len > 0) --- 2078,2084 ---- #ifdef FEAT_SIGNS /* If signs are being displayed, add two spaces. */ ! if (draw_signcolumn(wp)) { len = W_WIDTH(wp) - col; if (len > 0) *************** *** 2963,2973 **** draw_state = WL_SIGN; /* Show the sign column when there are any signs in this * buffer or when using Netbeans. */ ! if ((wp->w_buffer->b_signlist != NULL ! # ifdef FEAT_NETBEANS_INTG ! || usingNetbeans ! # endif ! ) # ifdef FEAT_DIFF && filler_todo <= 0 # endif --- 3009,3015 ---- draw_state = WL_SIGN; /* Show the sign column when there are any signs in this * buffer or when using Netbeans. */ ! if (draw_signcolumn(wp) # ifdef FEAT_DIFF && filler_todo <= 0 # endif *************** *** 2980,2986 **** /* Draw two cells with the sign value or blank. */ c_extra = ' '; ! char_attr = 0; n_extra = 2; if (row == startrow) --- 3022,3028 ---- /* Draw two cells with the sign value or blank. */ c_extra = ' '; ! char_attr = hl_attr(HLF_SC); n_extra = 2; if (row == startrow) *** ../vim-6.2.515/src/syntax.c Wed Apr 28 19:45:29 2004 --- src/syntax.c Thu Apr 29 15:54:32 2004 *************** *** 5940,5945 **** --- 5940,5946 ---- "WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black", "Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue", "FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue", + "SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue", "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue", "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta", "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan", *************** *** 5960,5965 **** --- 5961,5967 ---- "WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black", "Folded term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=DarkGrey guifg=Cyan", "FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan", + "SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan", "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue", "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta", "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan", *** ../vim-6.2.515/src/vim.h Tue Apr 20 12:52:53 2004 --- src/vim.h Thu Apr 29 15:48:18 2004 *************** *** 1074,1086 **** , HLF_CHD /* Changed diff line */ , HLF_DED /* Deleted diff line */ , HLF_TXD /* Text Changed in diff line */ , HLF_COUNT /* MUST be the last one */ }; /* the HL_FLAGS must be in the same order as the HLF_ enums! */ #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \ 'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \ ! 'f', 'F', 'A', 'C', 'D', 'T'} /* * Boolean constants --- 1074,1087 ---- , HLF_CHD /* Changed diff line */ , HLF_DED /* Deleted diff line */ , HLF_TXD /* Text Changed in diff line */ + , HLF_SC /* Sign column */ , HLF_COUNT /* MUST be the last one */ }; /* the HL_FLAGS must be in the same order as the HLF_ enums! */ #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \ 'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \ ! 'f', 'F', 'A', 'C', 'D', 'T', '>'} /* * Boolean constants *** ../vim-6.2.515/src/version.c Thu Apr 29 14:49:12 2004 --- src/version.c Thu Apr 29 16:33:00 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 516, /**/ -- hundred-and-one symptoms of being an internet addict: 61. Your best friends know your e-mail address, but neither your phone number nor the address where you live. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///