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

New fold column customization options

Expand Messages
  • Thiago Alves
    Hi guys, I m trying to add new options to allow users tweak their fold columns. The first option is: foldcolshowlvl fsl : Show a number representing the
    Message 1 of 3 , Feb 14, 2013
    • 0 Attachment
      Hi guys, I'm trying to add new options to allow users tweak their fold columns. The first option is:

      'foldcolshowlvl' 'fsl': Show a number representing the fold level.

      This allow user to "hide" the numbers representing the fold level. It is very useful is the `foldcolumn` is 1.

      My second option is the definition of custom characters to use while drawing the fold column. This way users can have characters representing folders other than `+`, `-` and `|`.

      So far I could make this works very well with one exception: multi-bytes.

      If I define the new characters to be like this:

      set fds=fa:\ ,fo:▾,fc:▸

      Nothing is shown on the fold column. I notice that on `screen.c` we have a function called `fill_foldcolumn` where those characters are defined, and there is where I tried to use the new characts, but since it has code like this:

      p[i] = fds_fo;

      This means that since `p` is a `char_u`, anything that is hold after the first 8 bits will be truncated. I tried to force the copy of the rest of the bits but had no luck on that!

      Any one have a clue about this?

      --
      --
      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.
    • Thiago Alves
      Hi guys, I finally cracked it down! I m attaching the full patch now. This contains the two options I worked on, I hope you guys like it. Let me know if you
      Message 2 of 3 , Feb 16, 2013
      • 0 Attachment
        Hi guys, I finally cracked it down!

        I'm attaching the full patch now. This contains the two options I worked on, I hope you guys like it. Let me know if you find anything wrong with it!

        Thanks,

        On Thursday, February 14, 2013 11:23:13 PM UTC-6, Thiago Alves wrote:
        > Hi guys, I'm trying to add new options to allow users tweak their fold columns. The first option is:
        >
        >
        >
        > 'foldcolshowlvl' 'fsl': Show a number representing the fold level.
        >
        >
        >
        > This allow user to "hide" the numbers representing the fold level. It is very useful is the `foldcolumn` is 1.
        >
        >
        >
        > My second option is the definition of custom characters to use while drawing the fold column. This way users can have characters representing folders other than `+`, `-` and `|`.
        >
        >
        >
        > So far I could make this works very well with one exception: multi-bytes.
        >
        >
        >
        > If I define the new characters to be like this:
        >
        >
        >
        > set fds=fa:\ ,fo:▾,fc:▸
        >
        >
        >
        > Nothing is shown on the fold column. I notice that on `screen.c` we have a function called `fill_foldcolumn` where those characters are defined, and there is where I tried to use the new characts, but since it has code like this:
        >
        >
        >
        > p[i] = fds_fo;
        >
        >
        >
        > This means that since `p` is a `char_u`, anything that is hold after the first 8 bits will be truncated. I tried to force the copy of the rest of the bits but had no luck on that!
        >
        >
        >
        > Any one have a clue about this?

        --
        --
        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.
      • Thiago Alves
        I created a clone of Vim repository in case you want to try these changes: https://code.google.com/r/talk-foldcolumnoptions/ I don t know if this patch can be
        Message 3 of 3 , Feb 17, 2013
        • 0 Attachment
          I created a clone of Vim repository in case you want to try these changes:

          https://code.google.com/r/talk-foldcolumnoptions/

          I don't know if this patch can be integrated into main vim repository or not, but if there is anything I can do to make this happen, let me know.

          On Thursday, February 14, 2013 11:23:13 PM UTC-6, Thiago Alves wrote:
          > Hi guys, I'm trying to add new options to allow users tweak their fold columns. The first option is:
          >
          >
          >
          > 'foldcolshowlvl' 'fsl': Show a number representing the fold level.
          >
          >
          >
          > This allow user to "hide" the numbers representing the fold level. It is very useful is the `foldcolumn` is 1.
          >
          >
          >
          > My second option is the definition of custom characters to use while drawing the fold column. This way users can have characters representing folders other than `+`, `-` and `|`.
          >
          >
          >
          > So far I could make this works very well with one exception: multi-bytes.
          >
          >
          >
          > If I define the new characters to be like this:
          >
          >
          >
          > set fds=fa:\ ,fo:▾,fc:▸
          >
          >
          >
          > Nothing is shown on the fold column. I notice that on `screen.c` we have a function called `fill_foldcolumn` where those characters are defined, and there is where I tried to use the new characts, but since it has code like this:
          >
          >
          >
          > p[i] = fds_fo;
          >
          >
          >
          > This means that since `p` is a `char_u`, anything that is hold after the first 8 bits will be truncated. I tried to force the copy of the rest of the bits but had no luck on that!
          >
          >
          >
          > Any one have a clue about this?

          --
          --
          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.