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

54142Re: Add support for guidecolumn in VIM

Expand Messages
  • Gary Johnson
    May 1 11:42 AM
    • 0 Attachment
      On 2009-05-01, Bram Moolenaar wrote:
      > Pankaj Garg wrote:
      >
      > > On Apr 30, 9:30=A0am, Ben Fritz <fritzophre...@...> wrote:
      > > > On Apr 29, 11:42=A0am, Bram Moolenaar <B...@...> wrote:
      > > >
      > > > > The name 'guidecolumn' starts with "gui", which is confusing, since it
      > > > > also works in a terminal. 'margincolumn' perhaps?
      > > >
      > > > I agree. If a user uses :help gui<C-D> for example, they would NOT be
      > > > expecting 'guidecolumn' to show up!
      > > >
      > > > > I think the value "0" should be used to have a column at 'textwidth'.
      > > > > That way you can see where a line will be broken when it's formatted,
      > > > > without having to set two options. =A0A negative value can be used to
      > > > > disable the column.
      > > >
      > > > I think we should try to make this option consistent with other
      > > > options. 'textwidth' and 'wrapmargin' and others use a value of 0 to
      > > > disable it, and making this one use negative numbers may get
      > > > confusing.
      > > >
      > > > Is it possible to use string or character values, or can only numbers
      > > > be entered? I can't think of any options that do this, but things like
      > > > line() can take several strings with special meaning. Perhaps the
      > > > guidecolumn could be disabled when set to 0, set to the textwidth when
      > > > set to "tw", and set to the wrap margin when set to "wm"? I think
      > > > something like this would be more consistent with other options and
      > > > therefore more intuitive for users.
      > > >
      > > > > I didn't have time to check for any problems with this patch, I hope
      > > > > others have tried it out and report any problems noticed.
      > > >
      > > > I haven't tried the patch, but I'm certainly interested in the
      > > > feature. I'd probably use this instead of the autocmds I have set up
      > > > to use a matchadd() on long lines.
      > > >
      > > > What is this option local to? If it's just global at the moment, I
      > > > think it should be local either to the buffer (because that's what
      > > > textwidth is local to) or the window. I could see a use case where a
      > > > user might want a guidecolumn for the file in one window, but turn it
      > > > off for a window in diff mode in another tab or something.
      > >
      > > The option is local to window. I agree margincolumn is a better name.
      > > I am also fine with a value of 0 meaning textwidth, however as Ben
      > > mentioned, that seems a little unintuitive. Should we convert it to
      > > string?
      > > Are there other example where numeric options are taking string?
      > >
      > > Please let me know what you prefer and I can do whatever option
      > > everyone agrees to.
      >
      > It's possible to use a string, but more difficult to handle. And easier
      > to set a wrong value, thus more error checking is needed.
      > If we want to use zero for "off", we could use -1 for using the
      > 'textwidth' value.

      If we use any special value, whether character or numeric, to set
      guidecolumn/margincolumn to the right margin, I suggest that the
      column be 'textwidth + 1 rather than 'textwidth'. I've been using
      this patch for a few weeks now and it looks better to me to have the
      highlighting at the first out-of-bounds column rather than at the
      last in-bounds column.

      As for the name, I don't see 'guidecolumn' as being a problem. I
      doubt that anyone would confuse it with a GUI command. There are
      lots of English words having the same initial letters but unrelated
      meanings. ":help comm^D" shows some examples of this.

      I see two problems with 'margincolumn'. The first is that
      highlighting the right margin is but one application for this
      feature. The second is that 'margincolumn' implies to me that its
      location automatically tracks the right margin (i.e., 'textwidth' or
      'wrapmargin') which it currently doesn't. While that tracking
      feature may be added following the discussions in this thread, the
      highlighting will be of the right margin only for a particular value
      of 'margincolumn'.

      Regards,
      Gary



      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Show all 55 messages in this topic