Sunday, May 19, 2013

Re: The :next command with directories (bug?)

On 5/19/13 7:04 PM, Ben Fritz wrote:
> On Sunday, May 19, 2013 11:06:36 AM UTC-5, Manpreet Singh wrote:
>>
>>> This works fine with files, but this fails in weird ways with directories when I do this:
>>
>>>
>>
>>> % mkdir tk11
>>
>>> % mkdir tk22
>>
>>> % mkdir tk33
>>
>>> % mkdir tk44
>>
>>> % vim tk??
>>
>>>
>>
>>> And then once inside vim
>>
>>>
>>
>>> :NT
>>
>>>
>>
>>> This opens tk11, tk22, tk22, tk33 and tk33 instead ok the usual tk11, tk22, tk33 and tk44 sequence. I've reproduced this with Vim 7.3 on Mac and FreeBSD (and probably Ubuntu also) and see the same behavior everywhere, with or without plugins disabled. What am I doing wrong here or is it a bug?
>>
>>> Also, vim -p tk?? works just fine.
>>
>
> I don't know why it's not working, and I don't have time to try debugging the script, but I do know that Vim doesn't really edit directories at all.
>
> There is a standard plugin distributed with Vim called netrw which hooks into Vim to allow it to :edit a directory by calling netrw's :Explore command instead. Or at least, that's how i understand it...I may be wrong. Without netrw or a similar plugin, editing a directory gives an error.
>
> You can try invoking :Explore or :Sexplore or :Texplore directly from your script, if isdirectory() is true for the file path. I'm not sure whether that would work better or not.
>

Thanks for that Ben. Using :Sexplore worked just fine.

Thanks
Manpreet

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: