From 8ea40b5506115b6d355e304dd9ee5089f7d78601 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Thu, 14 Nov 2024 22:21:11 -0800 Subject: [PATCH] fix: cursor sometimes does not hover previous file --- lua/oil/view.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/oil/view.lua b/lua/oil/view.lua index 3200c492..b36140b0 100644 --- a/lua/oil/view.lua +++ b/lua/oil/view.lua @@ -646,7 +646,6 @@ local function render_buffer(bufnr, opts) if seek_after_render == name then seek_after_render_found = true jump_idx = #line_table - M.set_last_cursor(bufname, nil) end end end @@ -825,6 +824,7 @@ M.render_buffer_async = function(bufnr, opts, callback) vim.b[bufnr].oil_rendering = false loading.set_loading(bufnr, false) render_buffer(bufnr, { jump = true }) + M.set_last_cursor(bufname, nil) vim.bo[bufnr].undolevels = vim.api.nvim_get_option_value("undolevels", { scope = "global" }) vim.bo[bufnr].modifiable = not buffers_locked and adapter.is_modifiable(bufnr) if callback then