Monday, August 22, 2011

Re: Tweaking $ command

Reply to message «Re: Tweaking $ command»,
sent 23:08:55 22 August 2011, Monday
by AK:

> I think it's also a particularly bad kludge because it's hard for a user
> to know what to look for in help system.
If I am not mistaking, I found this just as you: from someboby's code.

> Yes, it works fine for me in 7.3 with patches 1-35, 3$, 2$, etc. I
> haven't seen the reason to update so far, is there a list of new stuff
> in vim dev version? I don't know if I should update just to break my
> function :-). -ak
List is in :h version-7.3 in vim-7.3. There is an online version of help
somewhere (or you can use googlecode code browser). I like the following:
1. persistent undo
2. strdisplaywidth()
3. extra argument to maparg() (useful to script writers only)
3. changes to `tC;' behavior

Original message:
> On 08/22/2011 02:56 PM, ZyX wrote:
> > Reply to message «Re: Tweaking $ command»,
> > sent 22:26:44 22 August 2011, Monday
> >
> > by AK:
> >> It does move downward. 3$ moves 2 lines downward, etc.
> >
> > Now see this in help. For some reason it was not working before while
> > testing (perhaps forgot to add more lines).
> >
> >> Ok, I see.. but why does map or function have to do anything with that,
> >> they already get v:count and v:linenumber1 etc (IIRC), why isn't it up
> >> to them to choose how to use or not use them?
> >
> > You choose: by<C-u>. I don't like it either: it cost me much time trying
> > to get rid of this in<expr> mapping for visual mode.
>
> I think it's also a particularly bad kludge because it's hard for a user
> to know what to look for in help system.
>
> >>> I don't said it is *applied*. I said it is *reset* when normal-mode
> >>> command is executed. `normal' does execute the normal-mode command as
> >>> clearly stated by its name.
> >>
> >> Either reset or applied, I don't see the logic in having that happen
> >> with the first normal command in a function.
> >
> > I don't rememeber it applied anywhere (though I don't like :normal! very
> > much so I can't say I tested this on all commands). On my setup it is
> > simply ignored and reset.
> >
> >>> This won't work for {count}$, see above.
> >>
> >> ?? It does work for me in Vim 7.3. For both $ and {count}$ .
> >
> > vim-7.3.266 (~amd64) USE="X acl bash-completion cscope gpm nls perl
> > python ruby
> >
> > vim-pager -debug -minimal", Gentoo
> >
> > With the following script
> >
> > vim -u NONE -N \
> > --cmd 'exe "fu_()\nnorm!$\nif
> > v:count|exe\"norm\".v:count.\"h\"|en\nendf"' \ --cmd 'nnoremap $
> > :<C-u>call _()<CR>' \
> > --cmd 'call setline(".", range(100000, 100500))'
>
> Yes, it works fine for me in 7.3 with patches 1-35, 3$, 2$, etc. I
> haven't seen the reason to update so far, is there a list of new stuff
> in vim dev version? I don't know if I should update just to break my
> function :-). -ak

No comments: