Bjorn Winckler wrote:

> 2008/8/22 Gary Johnson <[EMAIL PROTECTED]>:
> >
> > On 2008-08-22, bjrn <[EMAIL PROTECTED]> wrote:
> >>
> >> This may not be the right place for this post, but it seems like I've
> >> come across a bug so I am posting here.
> >>
> >> If I type
> >>
> >> :args file1.m file1.h file2.m
> >>
> >> then I expect the arglist to have the file appear in the order I
> >> specified, but instead the arglist is in this order:
> >>
> >> file1.m file2.m file1.h
> >>
> >> For some reason the arglist groups files with the same extension
> >> together and thus completely breaks the order I so carefully specified
> >> to :args.
> >>
> >> Is this a "feature" or a bug?  It feels like I must have overlooked
> >> something, but what?
> >
> > I don't have the complete answer, but it appears to be a "feature".
> > ":help {arglist}" says, in part,
> >
> >   The wildcards in the argument list are expanded and the file
> >   names are sorted.
> >
> > Nowhere, however, can I find where "sorted" is defined.
> 
> Thanks for that clue.  It still kind of confused me since I was
> actually passing the files in a (lexicographically) sorted order so
> why Vim would "re-sort" an already sorted list seemed weird.  It turns
> out that the 'suffixes' option is the cause of this; if I "set su="
> then my sorted list of files will not get rearranged.
> 
> Still, this behaviour of :args is very counterintuitive: if I start
> Vim with "gvim file1.m file1.h file2.m" then the arglist will be the
> order I specified, whereas if I start Vim, then type ":args file1.m
> file1.h file2.m" the arglist will be in a different order (unless I
> ":set su=" first).
> 
> So this still makes me wonder if there isn't a way force :args _not_
> to rearrange the filenames you pass to it?  What is the rationale
> behind making :args perform this kind of "sorting"?

":args" works like giving the arguments on the Vim command line, where
the shell does the wildcard expansion.  Then Vim handles 'suffixes' to
move less important files to the end.  But the list isn't sorted, only
the matches from expanded arguments are sorted.

It has always been this way and changing it may go against the
expectations of long time users.

-- 
An alien life briefly visits earth.  Just before departing it leaves a
message in the dust on the back of a white van.  The world is shocked
and wants to know what it means.  After months of studies the worlds
best linguistic scientists are able to decipher the message: "Wash me!".

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui