67146Re: Functions with [range] do not preserve the cursor line
- Nov 19, 2012Am 20.11.2012 01:29, schrieb Nate Soares:
> That's a nifty command and mapping, but I had no trouble with getting aYou have to do it outside.
> custom command to use the range correctly. (You can just use -range, pass
> <line1> and <line2> to the function, and have the function do winsaveview()
> and winrestview(), which is what I do now.)
> Then you can also default to the whole file much cleaner e.g. with
> -range=%. But I'm not trying to write a command, I'm trying to write a
> The question is, is there any way to do this in a function that takes a
> range, called like:
> %call SomeUniformApiFunction()
> I'm not struggling to get the functionality, I'm struggling to expose a
> sane (function) API for the functionality.
Prepend :KeepView or surround the :call with your own code.
(own code works better with script-local functions).
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
- << Previous post in topic Next post in topic >>