Tuesday, September 2, 2014

Re: [bug? doc clarification?] starting position of cursor

On 2014-09-02 20:55, Christian Brabandt wrote:
> On Di, 02 Sep 2014, Tim Chase wrote:
> > The documentation for 'sol' does mention "buffer changing
> > commands" which could ambiguously be interpreted to mean that it
> > should take effect when a file is opened for the first time
> > (after all, it's changing from no-loaded-buffer to a
> > now-loaded-buffer). I'm not sure I'd go so far as to call it a
> > bug, but perhaps an unfortunate inconsistency or documentation
> > ambiguity.
> >
> > And I suspect that anybody who flies with 'nosol' set would be
> > irked by the behavior much as you mention.
>
> I am not sure I follow. What exactly would you call a bug here?
>
> I have set 'nosol' in my .vimrc for years and haven't noticed any
> wrong behaviour.

To reproduce the OP's issue:

1) create a new file with leading whitespace:

$ echo " x space at the beginning of this line" > example.txt
$ vim -u NONE example.txt

2) notice that the cursor opens on the first non-whitespace character
(the "x") with a bunch of whitespace to the left of the cursor.
Cool, whatever.

3) create a "nosol" vimrc and try using that:

$ echo "set nocp nosol" > nosol.vim
$ vim -u nosol.vim example.txt

4) notice that the cursor still lands on the first non-whitespace
character rather than in column 0 (or 1 depending on how you count).

My "vim intuition" tells me that in example #4 with 'nosol' set, the
cursor *shouldn't* move to the first non-whitespace. I'm not exactly
sure it's a *bug*, but it does run against that intuition and the
documentation doesn't speak clearly one way or the other regarding
the intended behavior in this situation. The documentation for 'sol'
does describe that the cursor should be kept in the same column when
using "buffer changing commands (CTRL-^, :bnext, bNext, etc.)".

Additionally, in ":help editing.txt", under the argument-list section
(with most of the buffer-manipulation commands such as ":wn",
":args", ":n", etc), the help says that

"""
If no [+cmd] argument is present, the cursor is positioned at the
last known cursor position for the file. If 'startofline' is set,
the cursor will be positioned at the first non-blank in the line,
otherwise the last know column is used. If there is no last known
cursor position the cursor will be in the first line (the last line
in Ex mode).
"""

which hints that 'nosol' will *not* position the cursor on the
first non-blank in the line. It may not explicitly say so, but it
does does waggle its eyebrows suggestively and gesture
furtively[1]. ;-)

-tim


[1] alluding to http://xkcd.com/552/ hover-text







.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment