Am 04.06.2013 08:06, schrieb Christian Brabandt:
On Mon, June 3, 2013 22:54, Matthew Winn wrote:
On Mon, 3 Jun 2013 18:34:37 +0200, "Christian Brabandt" wrote:

Oh, well. I'll just carry it around for myself and keep working on
it.  I already saw one problem, that when variable tabstops are
enabled, the 'tabstop' setting is ignored, but it still looks
active.  This is confusing for the user and he might wonder, why the
'ts' setting isn't honored.

There's no way around that. Variable tabstops add more functionality
than can possibly be expressed in the 'tabstop' option.

When I originally wrote the patch I did it as a change to the
'tabstop' setting so that if you set it to a value which was a
comma-separated list then it set multiple tab positions, while
setting it to a single numeric value gave the existing behaviour. But
people pointed out that if someone was expecting to be able to do
numeric calculations with the value of 'tabstop' then suddenly
finding that it contained non-numeric characters might cause
problems. So it was implemented as a new option that takes priority
over the older option.

There are other options in Vim that behave in the same way, so
there's a precedent. For example, if you set 'textwidth' then the
value of 'wrapmargin' is ignored, and if you set 'binary' then a
whole host of options are ignored.

Yes, but there are other options, that reset dependent options, just
like 'rnu' resets 'nu' currently (well there is a patch pending that
changes it) Or the 'diff' option resetting a whole bunch of dependent
options.

And this is what I have now changed in your patch. If setting 'vts' or
'vsts' the dependent 'ts' and 'sts' options will be reset and when
clearing the 'vts'/'vsts' option the dependent 'ts' and 'sts' options
will be reset to their value before variable tabstops where active.
Also setting 'ts'/'sts' when 'vsts'/'vts' is active will disable it.
This seems to work so far.

I'll need to update the test for this change, and then I'll post an
updated patch soon.

regards,
Christian

Why did you decide against just ignoring the value of 'tabstop'?  In
other words, why is it necessary to set ts=0 when 'vts' is non-empty?

You said it will be confusing for the user.  I don't think so.
First: if 'vts' isn't set behind the scenes, the user won't notice
anything.
Second: if 'vts' is set behind the scenes, the user will notice some
tabstop magic going on.  The normal reaction would be "how is this
possible with the normal 'ts' setting?"  The next step would be
    :set ts?
=> "strange, it's still a number"
    :h 'ts
=> "ah, there is a new option"
and he's done ...
So, there will be some temporary confusion, but nothing that I'd admit
would go beyond everyday Vim experience.


Some more points:

* I think existing scripts (not aware of the new options) would behave a
little saner with ts>=1 (instead of proposed ts=0 -- which is also not
backwards compatible).
(you will often find calculations involving modulo &tabstop ...)

* A script (while 'vts' is non-empty) might also be interested in the
original value of 'ts'.

* A newer script could check for non-empty 'vts' and act accordingly
(ignoring 'ts').  So there should not be technical reason for ts=0.

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

--- 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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui