On 21-Nov-12 10:18:01 +0100, Andy Wokula wrote: > Am 20.11.2012 20:14, schrieb Nate Soares: >> In that case I'd like to make a feature request for a way to handle >> functions with ranges without moving the cursor. My suggestion would be >> adding a [save] argument to :function which calls winsaveview() before >> entering and winrestview() after exiting the function, as this has >> potential applications beyond just [range] functions. >> >> Thoughts on the proposed api? > > Could you say more on your use case? > > Earlier you said mappings are not involved -- it should be easy to pass > line numbers as function arguments ... but you don't want that -- why? > > Why can't you just surround winsaveview()/winrestview()?
Christian, Nate, and I have all struggled with the current behavior of [range] (and the documentation didn't help). Though the issue can be worked around (e.g. with winsaveview()), maybe changing the behavior or introducing a new special function argument would make this easier in the future. > [3 lines deleted] > What's wrong with :KeepView (btw, it's prepared for nesting)? I like your utility library (though the generic "plugin/cmds.vim" script is prone to naming clashes), but as a plugin writer I wouldn't consider adding a dependency to it just for this little piece of functionality. -- regards, ingo -- 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