From 39374ee99b5704b5ac735985c36dd6ab7b4dfb38 Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Mon, 9 Mar 2026 17:40:19 -0400 Subject: [PATCH] fix(select): redraw screen after buffer switch (#106) * fix(select): redraw screen after buffer switch Problem: `select` opens files inside a `vim.schedule_wrap` callback from `normalize_url`. Scheduled `FileType` autocmds (e.g. treesitter parsing) queue onto the same batch, blocking the screen update. The oil buffer stays visible until the heavy work finishes. Solution: call `vim.cmd.redraw()` after the buffer switch to flush the screen before any queued scheduled callbacks run. Matches the behavior of plain `:e`. * docs(upstream): mark #699 fixed (#106) --- doc/upstream.md | 2 +- lua/canola/init.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/upstream.md b/doc/upstream.md index a02d451..680a8e1 100644 --- a/doc/upstream.md +++ b/doc/upstream.md @@ -134,7 +134,7 @@ issues against this fork. | [#685](https://github.com/stevearc/oil.nvim/issues/685) | Plain directory paths in buffer names | not actionable — protocol prefix is fundamental to buffer identity | | [#690](https://github.com/stevearc/oil.nvim/issues/690) | `OilFileIcon` highlight group | fixed | | [#692](https://github.com/stevearc/oil.nvim/issues/692) | Keymap normalization | cherry-picked ([#725](https://github.com/stevearc/oil.nvim/pull/725)) | -| [#699](https://github.com/stevearc/oil.nvim/issues/699) | `select` blocks UI with slow FileType autocmd | open | +| [#699](https://github.com/stevearc/oil.nvim/issues/699) | `select` blocks UI with slow FileType autocmd | fixed ([#106](https://github.com/barrettruth/canola.nvim/pull/106)) | | [#707](https://github.com/stevearc/oil.nvim/issues/707) | Move file/dir into new dir by renaming | open | | [#710](https://github.com/stevearc/oil.nvim/issues/710) | buftype empty on BufEnter | fixed ([#10](https://github.com/barrettruth/canola.nvim/pull/10)) | | [#714](https://github.com/stevearc/oil.nvim/issues/714) | Support question | not actionable — answered | diff --git a/lua/canola/init.lua b/lua/canola/init.lua index e556920..b5e9ad6 100644 --- a/lua/canola/init.lua +++ b/lua/canola/init.lua @@ -899,6 +899,7 @@ M.select = function(opts, callback) end end + vim.cmd.redraw() open_next_entry(cb) end) end