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

[PATCH] Right-aligned signs

Expand Messages
  • James
    Right now, there can t be right-aligned one-character signs(like sign define rightsign text= r ), because prefixing a sign with a space breaks the define
    Message 1 of 3 , Sep 23, 2013
    • 0 Attachment
      Right now, there can't be right-aligned one-character signs(like "sign define rightsign text=\ r"), because prefixing a sign with a space breaks the define statement.

      The "text=" argument for signs uses skiptowhite_esc, which forces whitespace in the argument to be escaped, but then never actually unescapes the whitespace. This patch unescapes the whitespace, so that right aligned signs can function correctly.

      -James

      --- vim74/src/ex_cmds.c 2013-08-07 09:15:51.000000000 -0400
      +++ vim74-mod/src/ex_cmds.c 2013-09-23 19:54:33.902516135 -0400
      @@ -6972,6 +6972,11 @@
      cells = 0;
      for (s = arg; s < p; s += (*mb_ptr2len)(s))
      {
      + if (s < p - 1 && (*mb_ptr2char)(s) == '\\')
      + {
      + STRMOVE(s, s + 1);
      + --p;
      + }
      if (!vim_isprintc((*mb_ptr2char)(s)))
      break;
      cells += (*mb_ptr2cells)(s);
      @@ -6981,8 +6986,15 @@
      #endif
      {
      for (s = arg; s < p; ++s)
      + {
      + if ( s < p - 1 && *s == '\\')
      + {
      + STRMOVE(s, s + 1);
      + --p;
      + }
      if (!vim_isprintc(*s))
      break;
      + }
      cells = (int)(s - arg);
      }
      /* Currently must be one or two display cells */

      --
      --
      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.
    • Bram Moolenaar
      ... Thanks, I ll add it in the todo list. Can I have your full name please? -- Edison s greatest achievement came in 1879, when he invented the electric
      Message 2 of 3 , Sep 25, 2013
      • 0 Attachment
        James wrote:

        > Right now, there can't be right-aligned one-character signs(like "sign
        > define rightsign text=\ r"), because prefixing a sign with a space
        > breaks the define statement.
        >
        > The "text=" argument for signs uses skiptowhite_esc, which forces
        > whitespace in the argument to be escaped, but then never actually
        > unescapes the whitespace. This patch unescapes the whitespace, so that
        > right aligned signs can function correctly.

        Thanks, I'll add it in the todo list.

        Can I have your full name please?


        --
        Edison's greatest achievement came in 1879, when he invented the
        electric company. Edison's design was a brilliant adaptation of the
        simple electrical circuit: the electric company sends electricity
        through a wire to a customer, then immediately gets the electricity
        back through another wire

        /// Bram Moolenaar -- Bram@... -- 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 ///

        --
        --
        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.
      • James Kolb
        Yep, I m James Kolb. ... -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are replying to. For
        Message 3 of 3 , Sep 26, 2013
        • 0 Attachment
          Yep,

          I'm James Kolb.


          On Wed, Sep 25, 2013 at 7:53 AM, Bram Moolenaar <Bram@...> wrote:

          James wrote:

          > Right now, there can't be right-aligned one-character signs(like "sign
          > define rightsign text=\ r"), because prefixing a sign with a space
          > breaks the define statement.
          >
          > The "text=" argument for signs uses skiptowhite_esc, which forces
          > whitespace in the argument to be escaped, but then never actually
          > unescapes the whitespace. This patch unescapes the whitespace, so that
          > right aligned signs can function correctly.

          Thanks, I'll add it in the todo list.

          Can I have your full name please?


          --
          Edison's greatest achievement came in 1879, when he invented the
          electric company.  Edison's design was a brilliant adaptation of the
          simple electrical circuit: the electric company sends electricity
          through a wire to a customer, then immediately gets the electricity
          back through another wire

           /// Bram Moolenaar -- Bram@... -- 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    ///

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