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

Re: Add support for guidecolumn in VIM

Expand Messages
  • Tony Mechelynck
    ... [...] The problem with that approach is that the option would then be a String option, with the consequence that set+= and set-= etc. would work in a way
    Message 1 of 55 , May 2, 2009
    • 0 Attachment
      On 30/04/09 18:30, Ben Fritz wrote:
      >
      >
      >
      > On Apr 29, 11:42 am, 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. A 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.
      [...]

      The problem with that approach is that the option would then be a String
      option, with the consequence that set+= and set-= etc. would work in a
      way which is unexpected for a numeric value. Examples, each of them with
      a starting value of 60:

      :set margincolumn+=5

      makes it become 605, not 65

      :set margincolumn-=6

      makes it become 0, not 54

      :set margincolumn^=2

      makes it become 260, not 120

      OTOH, you could use an algebraic number, always relative to the
      textwidth/wrapmargin. Then use a very large negative value to disable
      it, i.e.

      :set margincolumn=0

      use 'textwidth' if set, otherwise use (window width - 'wrapmargin') if
      set, otherwise use column zero (disabled).

      :set margincolumn=-10

      use 'textwidth' - 10 if set, otherwise use (window width - wrapmargin -
      10) if set, otherwise disabled

      :set margincolumn=-9999

      always disabled (assuming you won't have 9999 columns of window width).

      Just a thought: Maybe use the opposite sign convention, and subtract
      from 'tw' when this option is positive -- since we'll more often want to
      be warned when we approach the margin, as with a typewriter bell, rather
      than when we exceed it by a given amount?


      Best regards,
      Tony.
      --
      "I am the mother of all things, and all things should wear a sweater."

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • _Lone
      On Jun 1, 6:28 pm, Tony Mechelynck ... Sorry for going off and on, the paying job is keeping me extremely busy. The
      Message 55 of 55 , Jun 12, 2009
      • 0 Attachment
        On Jun 1, 6:28 pm, Tony Mechelynck <antoine.mechely...@...>
        wrote:
        > On 28/05/09 05:10, _Lone wrote:
        > [...]
        >
        > > I looked at adding 1px highlighting instead of whole character
        > > background. But it seems it would be very difficult. The reason is
        > > that the way highlighting works is by storing the background color for
        > > character which is how various highlights are done.
        >
        > When talking aboiut the background, yes; but there are a lot other kinds
        > of highlights, especially in the GUI:
        >
        >         gui=NONE
        >         gui=reverse
        >         gui=bold
        >         gui=italic
        >         gui=underline
        >         gui=undercurl
        >
        >         guibg=<color>
        >         guifg=<color>
        >         guisp=<color>
        >
        > What about extending these categories? (with appropriate ifdefs in the
        > source)? For term and cterm (including GUI-enabled Linux Vim in Console
        > mode) the choice would be more limited, probably by default term=reverse
        > and ctermbg=<color>, or somesuch. Of course a new highlight group would
        > have to be created, perhaps with a new 'highlight' option setting and
        > default -- or maybe not, after all I don't see CursorLine and
        > CursorColumn listed there.
        >
        >
        >
        > > I also looked at wide-character problem and that too looks very hard
        > > to sovle though I would spend some more time this week if I can fix
        > > that.
        >
        > As I think had been noted, there are several kinds of multicell characters:
        >   - hard tabs (with and without 'list' and/or 'listchars')
        >   - control characters (^X, ~Y, |Z, see :help 'isprint')
        >   - CJK wide
        >   - non-printable Unicode codepoints (at least <xx> and <xxxx>, see
        > :help 'display' and the last sentence under 'isprint').
        >
        > It might be hard to highlight "just" the one cell in the column in
        > question, but maybe you could look how Vim displays the CursorColumn
        > highlight. (I think this has also been mentioned).
        >
        >
        >
        > > Thanks
        > > _Lone
        >
        > Best regards,
        > Tony.
        > --
        > Without ice cream life and fame are meaningless.

        Sorry for going off and on, the paying job is keeping me extremely
        busy. The CursorColumn and MarginColumn behaves in exactly the same
        manner. So whatever problems exist for CursorColumn, also exists for
        MarginColumn, including multi-cell characters.

        Thanks
        _Lone
        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.