Yegappan Lakshmanan wrote:

> On Wed, Jan 20, 2016 at 1:00 PM, Christian Brabandt <[email protected]> 
> wrote:
> > Hi Yegappan!
> >
> > On Mi, 20 Jan 2016, Yegappan Lakshmanan wrote:
> >
> >> Hi all,
> >>
> >> A Vim window can use either the global argument list or a local argument
> >> list.  The argv() and argc() functions currently support only the
> >> argument list for the current window. You cannot use these functions to
> >> get the argument list for any window in any tab page.
> >>
> >> I am proposing the following additions to the argv() and argc()
> >> functions to support this:
> >>
> >> argc()
> >>     Return the number of files in the argument list of the current
> >>     window. <already supported>
> >> argc({winnr})
> >>     Return the number of files in the argument list of the specified
> >>     window in the current tab page.
> >> argc({winnr}, {tabnr})
> >>     Return the number of files in the argument list of the specified
> >>     window in the specified tab page.
> >>
> >> argv()
> >>     Return the argument list for the current window. <already supported>
> >> argv({nr})
> >>     Return the {nr}th file in the argument list for the current window.
> >>     <already supported>
> >> argv({nr}, {winnr})
> >>     Return the {nr}th file in the argument list for the specified window
> >>     in the current tab page.
> >> argv({nr}, {winnr}, {tabnr})
> >>     Return the {nr}th file in the argument list for the specified window
> >>     in the specified tab page.
> >> argv(-1, {winnr})
> >>     Return the argument list for the specified window in the current tab 
> >> page.
> >> argv(-1, {winnr}, {tabnr})
> >>     Return the argument list for the specified window in the specified
> >>     tab page.
> >>
> >> Any comments on the proposed enhancements?
> >
> > Since you mention it, shouldn't we than not also have a way to get the
> > global argument list?
> >
> 
> You can switch to the global argument list using ":argglobal" and get the
> argument list using argv(). Are you suggesting adding a separate function to
> get the global argument list?
> 
> If you want to switch between global/local argument lists, you can do
> something like the following (I know this is a workaround):
> 
>      :let l = argv()
>      :argglobal
>      :let g = argv()
>      :arglocal
>      :exe "args " . join(l)

There is a tendency to have functions that get something directly,
specified by the arguments, rather than "go somewhere", "do something"
and "restore".  It's just easier to do.  Thus if it's not too much work,
I would prefer that.

-- 
Don't Panic!
                -- The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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/d/optout.

Raspunde prin e-mail lui