[vim/vim] Do not run filetype detect for directories in netrw (PR #11290)

9 views
Skip to first unread message

Teo Ljungberg

unread,
Oct 5, 2022, 6:08:19 AM10/5/22
to vim/vim, Subscribed

Resolves #9875


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/11290

Commit Summary

  • 2275ce4 Do not run filetype detect for directories in netrw

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290@github.com>

Bram Moolenaar

unread,
Oct 5, 2022, 6:44:31 AM10/5/22
to vim/vim, Subscribed

I actually think there is never a point in "filetype detect" to try figure out the filetype for a directory.
Or we should just set filetype to "directory".
How about that? Would that break anything?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/c1268262646@github.com>

Bram Moolenaar

unread,
Oct 5, 2022, 6:53:18 AM10/5/22
to vim/vim, Subscribed

Actually, it appears "filetype detect" already rejects directories. In the netrw plugin it uses a buffer to display the directory contents, but that buffer is not a directory itself.

Hmm, I have trouble reproducing the original problem. How do you get the filetype to be something else than "netrw"?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/c1268271105@github.com>

Maxim Kim

unread,
Oct 5, 2022, 7:08:21 AM10/5/22
to vim/vim, Subscribed

I guess this is related to #9099 which is easy to reproduce.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/c1268286123@github.com>

Bram Moolenaar

unread,
Oct 5, 2022, 7:31:33 AM10/5/22
to vim/vim, Subscribed

OK, I'll include it. Let me close the other issues and leave this one open for Charles.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/c1268310802@github.com>

Bram Moolenaar

unread,
Oct 5, 2022, 7:33:07 AM10/5/22
to vim/vim, Subscribed


> I guess this is related to https://github.com/vim/vim/issues/9099

> which is easy to reproduce.

Aha, it requires using ":Explore". I was using ":edit".

--
This is an airconditioned room, do not open Windows.

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/c1268312404@github.com>

Teo Ljungberg

unread,
Oct 5, 2022, 8:27:09 AM10/5/22
to vim/vim, Subscribed

I’ve reproduced this using :Explore and entering a directory under a .vim or .com and then bubbling back up to the parent directory, that corresponds to setting ft={vim,dcl} respectively - while it should be netrw.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/c1268368786@github.com>

Teo Ljungberg

unread,
Oct 11, 2022, 11:42:32 AM10/11/22
to vim/vim, Subscribed

Anything you need from me to push this forward @cecamp ?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/c1274904575@github.com>

Teo Ljungberg

unread,
Oct 17, 2022, 10:33:00 AM10/17/22
to vim/vim, Subscribed

@brammool While resolving the merge conflicts I saw that 3c053a1 was merged into master yesterday.

Which includes the gist of this patch.

Should we then close this PR?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/c1280957827@github.com>

Bram Moolenaar

unread,
Oct 17, 2022, 10:37:33 AM10/17/22
to vim...@googlegroups.com, Teo Ljungberg

> @brammool While resolving the merge conflicts I saw that https://github.com/vim/vim/commit/3c053a1a5ad2a3c924929e11f2b9af20a8b901e2 was merged into master yesterday.
>
> Which includes the gist of this patch.
>
> Should we then close this PR?

I would suggest to keep it open until Charles has replied.
Unfortunately I haven't heard much from him lately.

--
Beer & pretzels can't be served at the same time in any bar or restaurant.
[real standing law in North Dakota, United States of America]

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\

Teo Ljungberg

unread,
Oct 19, 2022, 5:04:43 AM10/19/22
to vim/vim, Subscribed

I tested out 3c053a1 and what’s on main and it works as expected.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/c1283672129@github.com>

Teo Ljungberg

unread,
Oct 19, 2022, 5:04:45 AM10/19/22
to vim/vim, Subscribed

Closed #11290.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11290/issue_event/7619387378@github.com>

Reply all
Reply to author
Forward
0 new messages