fix(init): skip WinNew split handler before VimEnter (#172)

Problem: running `nvim oil-ssh://host/` from the command line sometimes
emits "Oil split could not find parent window" immediately on startup.
The `WinNew` autocmd that transfers oil window vars to new splits fires
during startup before `BufEnter` has set `oil_did_enter` on any window,
so the parent search finds nothing and warns.

Solution: guard the callback with `vim.v.vim_did_enter ~= 1` so it is
silently skipped during the pre-`VimEnter` startup phase. After
`VimEnter` the split-transfer logic runs unchanged. `vim_did_enter` is
already used in `setup()` for the same startup-completion check.

Based on: stevearc/oil.nvim#325
This commit is contained in:
Barrett Ruth 2026-03-18 13:26:58 -04:00 committed by GitHub
parent e387a57c0e
commit 91f4b13810
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -54,7 +54,7 @@ issues against this fork.
| [#298](https://github.com/stevearc/oil.nvim/issues/298) | Open float on neovim directory startup | open |
| [#302](https://github.com/stevearc/oil.nvim/issues/302) | `buflisted=true` after jumplist nav | fixed ([#71](https://github.com/barrettruth/canola.nvim/pull/71)) |
| [#303](https://github.com/stevearc/oil.nvim/issues/303) | Preview in float window mode | fixed — upstream [#403](https://github.com/stevearc/oil.nvim/pull/403), `config.float.preview_split` |
| [#325](https://github.com/stevearc/oil.nvim/issues/325) | oil-ssh error from command line | consolidated into [#164](https://github.com/barrettruth/canola.nvim/issues/164) |
| [#325](https://github.com/stevearc/oil.nvim/issues/325) | oil-ssh error from command line | fixed |
| [#330](https://github.com/stevearc/oil.nvim/issues/330) | Telescope opens file in oil float | not actionable — cross-plugin, no repro |
| [#332](https://github.com/stevearc/oil.nvim/issues/332) | Buffer not fixed to floating window | not actionable — cannot reproduce |
| [#335](https://github.com/stevearc/oil.nvim/issues/335) | Disable editing outside root dir | not actionable — confirmation prompt and `delete_to_trash` already cover accidental deletion |