Skip to content

fix(files): stop nvim.dir from showing if files is default explorer#2493

Open
abeldekat wants to merge 1 commit into
nvim-mini:mainfrom
abeldekat:mini_fix_files_default
Open

fix(files): stop nvim.dir from showing if files is default explorer#2493
abeldekat wants to merge 1 commit into
nvim-mini:mainfrom
abeldekat:mini_fix_files_default

Conversation

@abeldekat

@abeldekat abeldekat commented Jul 1, 2026

Copy link
Copy Markdown
Member

Details:

  • See PR 40507 in neovim/neovim

Tests that failed:

  • Default explorer | works on startup:
  • Default explorer | works in :edit .`
  • Default explorer | works in :tabfind .`
  • Default explorer | handles close without opening file

Surprisingly, test Default explorer works in :vsplit did not fail. Probably because of the vsplit...)

Before the fix, vim.fn.getbufinfo(1):

    ...
    variables = {                                                                                                                                                                            
      changedtick = 4,                                                                                                                                                                       
      current_syntax = "directory",                                                                                                                                                          
      minifiles_processed_dir = true,                                                                                                                                                        
      nvim_dir = "/home/user/.config/repro"                                                                                                                                                 
    }, 
    ...       

After:

    ...
    variables = {                                                                                                                                                                            
      changedtick = 3,                                                                                                                                                                       
      minifiles_processed_dir = true                                                                                                                                                         
    }, 
    ... 

@abeldekat

Copy link
Copy Markdown
Member Author

In my config, <C-s> is revealing....)

1782899271

<C-s>....

1782899454

@barrettruth

Copy link
Copy Markdown

I am skeptical of this. dir.lua will change shape a lot in the upcoming months, and the (in)ability to easily disable it will likely be fixed. for now, we're going to restore loading the plugin guard and disabling with vim.g like other (neo)vim plugins.

I'd wait for that to merge and simply set the flag instead.

@abeldekat

Copy link
Copy Markdown
Member Author

I'd wait for that to merge and simply set the flag instead.

Is mini.files able to set that flag reliably? The user might load mini.files later...

Previously, nvim.dir registered its callbacks as part of the FileExplorer group. That was working fine, as the group is cleared by mini.files

@barrettruth

barrettruth commented Jul 1, 2026

Copy link
Copy Markdown

I apologize for my short-sightedness. Basically, we're trying to figure out a new way to handle builtin neovim plugins more ergonomically and dir.lua is kind of the guinea pig.

The FileExplorer group will likely be removed soon. None of this surface is stable.

FileExplorer is inherited from vim :browse which is entirely out of date and I'm about to work on this soon. I would not rely on it.

Is mini.files able to set that flag reliably? The user might load mini.files later...

I believe so? If you're talking about "dynamically" disabling dir.lua after startup, that should work...

@echasnovski

Copy link
Copy Markdown
Member

Is mini.files able to set that flag reliably? The user might load mini.files later...

I believe so? If you're talking about "dynamically" disabling dir.lua after startup, that should work...

The to-be-maybe-restored documentation about g:loaded_nvim_dir_plugin says this:

To disable the built-in directory browser, set this before startup: >lua
vim.g.loaded_nvim_dir_plugin = 1
<

I.e. this will only work if 'mini.files' is loaded during startup. This might not be the case if it is lazy loaded (i.e. after startup).

What is needed for 'mini.files' is the way to disable 'dir.lua' from hijacking directory buffers. The netrw went the route of "delete this autocommand which we promise will remain named like this forever". This worked fine and might still work fine for 'dir.lua'.

@barrettruth

Copy link
Copy Markdown

Working on a solution for this now. I will comment on this thread when it's done. Disabling nvim.dir will be simple.

Thanks for your patience.

echasnovski added a commit that referenced this pull request Jul 2, 2026
Details:
- There is some work being done upstream on better default explorer
  (instead of `netrw`). Reacting to each its change is a bit too much
  for now. Temporarily disable tests for 'mini.files' as default
  explorer, but check on the upstream progress regularly to adjust
  'mini.files' behavior and re-enable tests as soon as reasonably
  possible.

Related to #2493
@echasnovski

Copy link
Copy Markdown
Member

I've temporarily disabled the default explorer 'mini.files' tests on Nightly. Hopefully for not too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants