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

66810Re: Feature Request: A special value for softtabstop that makes it equal to tabstop

Expand Messages
  • So8res
    Oct 16, 2012
    • 0 Attachment
      That's certainly a possibility, though then I'd want "sts=-1" to make "sts" fall back to the "tabstop" value or we still have the problem of setting the same thing in two places. The original patch actually had sts falling back to tabstop, but Bram thought it was better to have sts fall back to shiftwidth.

      On Tuesday, October 16, 2012 4:12:26 PM UTC-7, Andy Wokula wrote:
      > Am 17.10.2012 00:53, schrieb So8res:
      >
      > >> Er, again, what's the deal with sts=-1 ?
      >
      > >
      >
      > > sts=-1 would mean that sts takes on the same value as the shiftwidth.
      >
      > >
      >
      > > This means you can change your shiftwidth and have the softtabstop
      >
      > > change automatically. I (and I imagine most users with sts on) want
      >
      > > the softtabstop to be one shiftwidth wide, but I often forget to
      >
      > > update it.
      >
      > >
      >
      > > The most common use case is deleting multiple spaces at a time.
      >
      > > Imagine &sw=4 and &sts=4 and you have a file with 'expand' tab. You
      >
      > > 'set sw=8'. Now when your cursor is sitting behind 16 spaces and you
      >
      > > hit backspace you expect 8 spaces to be deleted, but only 4 are
      >
      > > deleted because you forgot to update 'sts'. This is incredibly
      >
      > > annoying.
      >
      > >
      >
      > >> So is sw=-1 (not needed, for consistency).
      >
      > >
      >
      > > sw=0 has a similar effect to sts=-1, i.e. sw=0 makes sw take on the
      >
      > > same value as tabstop. It's a bit strange to have one start falling
      >
      > > back on the '-1' value and the other on the '0' value, which is why I
      >
      > > put the second patch up; it makes sw behave a little more consistently
      >
      > > with sts. I'm not sure it's a good idea, but it's something to think
      >
      > > about.
      >
      >
      >
      > There is another option, what about
      >
      > ts=8
      >
      > sts=4
      >
      > sw=0
      >
      > with effective shiftwidth = 4? I think 'shiftwidth' has a stronger
      >
      > connection to 'softtabstop' than to 'tabstop' ... Is it useful to get
      >
      > an effective shiftwidth of 8 in this case?
      >
      >
      >
      > If not then negative values for sw / sts should be avoided.
      >
      >
      >
      > But you have to change 'softtabstop' instead of 'shiftwidth'.
      >
      >
      >
      > --
      >
      > Andy

      --
      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
    • Show all 16 messages in this topic