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

Re: New feature: absolute line number in relativenumber for the current line

Expand Messages
  • Bram Moolenaar
    ... This looks like a good solution. I ll include it. With Christian s addition. ... Sounds like it. -- BLACK KNIGHT: I move for no man. ARTHUR: So
    Message 1 of 47 , Jan 30, 2013
    • 0 Attachment
      Nazri Ramliy wrote:

      > On Tue, Jan 29, 2013 at 10:51 PM, Nazri Ramliy <ayiehere@...> wrote:
      > > For better distinction the current line number ca be left-aligned
      > > (for left-to-right text orientation) to make it look different than the
      > > relative-line-numbers (I made no attempt at this in the patch below).
      >
      > Here's a new patch that makes an attempt at the above. When rnu is on,
      > the current line number is flushed left, like this:
      >
      > 1 diff --git a/src/screen.c b/src/screen.c << Cursor at this line
      > 1 --- a/src/screen.c
      > 2 +++ b/src/screen.c
      > 3 @@ -2319,6 +2319,7 @@
      >
      > Which distinguishes the current line number from the relative ones -
      > this makes it much much easier to differentiate between the two.
      >
      > In this new patch the logic for deciding whether to show the current
      > line or '0' is done outside of get_cursor_rel_lnum() which preserves
      > the function's original purpose.
      >
      > I'm attaching the patch (instead of inlining it just so that gmail
      > doesnt' change the tabs into spaces).

      This looks like a good solution. I'll include it. With Christian's
      addition.

      > While coming up with this patch I noticed that the formatting of the
      > line numbers (regardless of whether 'nu' or 'rnu' are set) are not
      > changed at all in right-to-left ('rl') mode - the single space that
      > separates the line numbers and the text are not placed in between the
      > two in right-left mode. I'm guessing that this is a bug.

      Sounds like it.

      --
      BLACK KNIGHT: I move for no man.
      ARTHUR: So be it!
      [hah] [parry thrust]
      [ARTHUR chops the BLACK KNIGHT's left arm off]
      ARTHUR: Now stand aside, worthy adversary.
      BLACK KNIGHT: 'Tis but a scratch.
      The Quest for the Holy Grail (Monty Python)

      /// 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.
    • sxc4244@...
      Ah, I understand now; sorry for the confusion -- I didn t know that patch 1115 changed the behavior of relativenumber/number. I know what I have to do now to
      Message 47 of 47 , Jun 29, 2013
      • 0 Attachment
        Ah, I understand now; sorry for the confusion -- I didn't know that patch 1115 changed the behavior of relativenumber/number. I know what I have to do now to modify my vimrc to behave like it used to for older versions by using the has("patch#") check.

        I do indeed like this new behavior better though :)
        Thanks very much for your help!

        --Stan

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