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"?

Björn

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

Raspunde prin e-mail lui