diff options
author | max397574 <[email protected]> | 2022-02-05 19:51:08 +0100 |
---|---|---|
committer | max397574 <[email protected]> | 2022-02-05 19:51:08 +0100 |
commit | 2b6865da53e2bb16710216bbabf7bbd6eef448f8 (patch) | |
tree | c0e9a74a146dfca00df2d978a852674694569486 | |
parent | 135f766246d8fc3d96620b1dd8c69f3ca4fd7f30 (diff) |
fix(redisplay): redraw to prevent duplicate content
-rw-r--r-- | lua/startup/init.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lua/startup/init.lua b/lua/startup/init.lua index ae49d4e..92a7cbc 100644 --- a/lua/startup/init.lua +++ b/lua/startup/init.lua @@ -58,6 +58,9 @@ function startup.commands(arg) end if arg == "display" then startup.display(true) + vim.defer_fn(function() + startup.redraw() + end, 2) end if arg == "breaking_changes" then utils.breaking_changes() @@ -522,9 +525,14 @@ function startup.display(force) 2, 2, }) - -- startup.redraw(false) startup.buffer_nr = vim.api.nvim_get_current_buf() end, 1) + if force then + startup.buffer_nr = vim.api.nvim_get_current_buf() + vim.defer_fn(function() + startup.redraw(false) + end, 1) + end end local function create_settings(update) @@ -571,7 +579,10 @@ function startup.redraw(other_file) vim.fn.win_gotoid(startup.window_id) cursor = vim.api.nvim_win_get_cursor(startup.window_id) else - if vim.fn.bufname() == "" then + if + vim.fn.bufname() == "" + and vim.api.nvim_get_current_buf() ~= startup.buffer_nr + then return end end |