Loading ...
Sorry, an error occurred while loading the content.

[FEATURE PATCH] Added FoldedLineNr to allow users customize the highlight of the line number of folded lines.

Expand Messages
  • eXerigumo Clanjor
    Hello, everyone. I m eXerigumo Clanjor (Weiju Lan). I m new to the vim dev and here is my first patch, which is diffed from hg repo r5195. It allows users to
    Message 1 of 2 , Jul 14, 2013
    • 0 Attachment
      Hello, everyone. I'm eXerigumo Clanjor (Weiju Lan). I'm new to the vim dev and here is my first patch, which is diffed from hg repo r5195.
      It allows users to set separate highlight for the line number of folded lines with "hi FoldedLineNr ...".
      Looks like this image: https://gobblin.se/u/cjxgm/m/vim-foldedlinenr/


      ------------------BELOW IS THE PATCH------------------
      diff -r aed1105b7cfd -r b10c844e3e4b src/option.c
      --- a/src/option.c Sun Jul 14 13:41:56 2013 +0200
      +++ b/src/option.c Sun Jul 14 23:09:12 2013 +0800
      @@ -462,7 +462,7 @@
      #if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
      || defined(FEAT_VERTSPLIT) || 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"
      +# 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:FoldedLineNr,G: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
      diff -r aed1105b7cfd -r b10c844e3e4b src/screen.c
      --- a/src/screen.c Sun Jul 14 13:41:56 2013 +0200
      +++ b/src/screen.c Sun Jul 14 23:09:12 2013 +0800
      @@ -2449,10 +2449,10 @@
      if (wp->w_p_rl)
      /* the line number isn't reversed */
      copy_text_attr(off + W_WIDTH(wp) - len - col,
      - (char_u *)" ", len, hl_attr(HLF_FL));
      + (char_u *)" ", len, hl_attr(HLF_FLN));
      else
      # endif
      - copy_text_attr(off + col, (char_u *)" ", len, hl_attr(HLF_FL));
      + copy_text_attr(off + col, (char_u *)" ", len, hl_attr(HLF_FLN));
      col += len;
      }
      }
      @@ -2494,10 +2494,10 @@
      if (wp->w_p_rl)
      /* the line number isn't reversed */
      copy_text_attr(off + W_WIDTH(wp) - len - col, buf, len,
      - hl_attr(HLF_FL));
      + hl_attr(HLF_FLN));
      else
      #endif
      - copy_text_attr(off + col, buf, len, hl_attr(HLF_FL));
      + copy_text_attr(off + col, buf, len, hl_attr(HLF_FLN));
      col += len;
      }
      }
      diff -r aed1105b7cfd -r b10c844e3e4b src/vim.h
      --- a/src/vim.h Sun Jul 14 13:41:56 2013 +0200
      +++ b/src/vim.h Sun Jul 14 23:09:12 2013 +0800
      @@ -1341,6 +1341,7 @@
      , HLF_W /* warning messages */
      , HLF_WM /* Wildmenu highlight */
      , HLF_FL /* Folded line */
      + , HLF_FLN /* Folded line number */
      , HLF_FC /* Fold column */
      , HLF_ADD /* Added diff line */
      , HLF_CHD /* Changed diff line */
      @@ -1369,7 +1370,7 @@
      * 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', '-', '>', \
      + 'f', 'F', 'G', 'A', 'C', 'D', 'T', '-', '>', \
      'B', 'P', 'R', 'L', \
      '+', '=', 'x', 'X', '*', '#', '_', '!', '.', 'o'}


      ------------------ABOVE IS THE PATCH------------------
      --
      Where there is a hacker, there is art.

      --
      --
      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@....
      For more options, visit https://groups.google.com/groups/opt_out.
    Your message has been successfully submitted and would be delivered to recipients shortly.