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

73012Issue 165 in vim: Width of line numbers in :hardcopy is hard coded

Expand Messages
  • vim@...
    Sep 3, 2013
      Status: New
      Owner: ----
      Labels: Type-Defect Priority-Medium

      New issue 165 by dale.oys...@...: Width of line numbers in :hardcopy
      is hard coded
      http://code.google.com/p/vim/issues/detail?id=165

      The width of the line numbers (when enabled) in :hardcopy appears to be
      hard coded through #define PRINT_NUMBER_WIDTH 8 in the file structs.h. It
      would be preferrable to have this setting available in printoptions.

      When printing small, 1-page files with <=50 lines, reserving 6 character
      widths for line numbers is IMHO excessive, and in some cases it causes long
      lines below 80 characters to wrap with otherwise default settings.

      Suggested solution:
      Add a new option to printoptions named numberwidth, which takes a
      non-negative integer as parameter, and use this to set the padding of line
      numbers when printing through :hardcopy. Alternatively, make :hardcopy
      respect the existing option :set numberwidth. The latter would be less
      preferable, because that option is not intended to affect printing.
      Defaults should be set so it matches current behavior.

      While the suggested solution above resolves the issue, I'd like to make
      some additional suggestions on how it could be improved.

      Suggested improvement:
      Add the possibility to supply the parameter * to the suggested numberwidth
      option in popt, which would cause the line numbers in :hardcopy to fit the
      largest line number. If the largest line number is 999, 3 character widths
      would be reserved for line numbers.

      Suggested improvement:
      Add an option to printoptions to change the padding between the line number
      and the line itself.

      Suggested improvement:
      Provide an option to have line numbers outside the margin. Some consider it
      good typographic style to leave bullets and numbers of lists outside the
      margin.

      Here's a visual example of the suggestion:
      | 12345 |# This is a line of text
      ^ Edge ^ Margin

      As opposed to the current behavior, which would look like
      | | 12345 # This is a line of text
      ^ Edge ^ Margin

      I'd be willing to submit patches for individual parts of this report if I
      get some pointers on where to start, or manage to find the necessary
      information myself.

      --
      You received this message because this project is configured to send all
      issue notifications to this address.
      You may adjust your notification preferences at:
      https://code.google.com/hosting/settings

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