From cf6cb9bf0550050df56c616aa7b06ec9922aa7bb Mon Sep 17 00:00:00 2001 From: Ind1eMonk3y Date: Wed, 12 May 2021 00:46:29 +0200 Subject: [PATCH] fix(ui): Sets buffer as 'listed' when navigating According to the documentation for `vim.fn.bufnr` (`:h bufnr`), the created buffer will have the option 'unlisted' by default. This means that when navigating to a file, if that file wasn't previously open, the new buffer won't appear in buffers list. This fix set the buffer to be 'listed' when navigating. --- lua/harpoon/ui.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/harpoon/ui.lua b/lua/harpoon/ui.lua index afd0059..494031b 100644 --- a/lua/harpoon/ui.lua +++ b/lua/harpoon/ui.lua @@ -139,6 +139,7 @@ M.nav_file = function(id) local set_row = not vim.api.nvim_buf_is_loaded(buf_id) vim.api.nvim_set_current_buf(buf_id) + vim.api.nvim_buf_set_option(buf_id, "buflisted", true) if set_row and mark.row and mark.col then vim.cmd(string.format(":call cursor(%d, %d)", mark.row, mark.col)) log.debug(string.format(