Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit 26895a8

Browse files
update(previewer): keep buffers
Do not delete buffers to allow navigation using CTRL-I and CTRL-O.
1 parent 75b7c9e commit 26895a8

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

lua/nvim-devdocs/operations.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ end
295295
M.keywordprg = function(keyword)
296296
local alias = state.get("current_doc")
297297
local float = state.get("last_mode") == "float"
298-
local bufnr = state.get("last_bufnr")
298+
local bufnr = vim.api.nvim_create_buf(false, false)
299299
local entries = M.get_entries(alias)
300300
local entry
301301

lua/nvim-devdocs/pickers.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ local open_doc = function(selection, float)
7676
bufnr = state.get_global_key("last_preview_bufnr")
7777
end
7878

79-
plugin_state.set("last_bufnr", bufnr)
8079
plugin_state.set("last_mode", float and "float" or "normal")
8180
operations.open(selection.value, bufnr, float)
8281
end

lua/nvim-devdocs/state.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ local state = {
44
current_doc = nil, -- ex: "javascript", used for `keywordprg`
55
preview_lines = nil,
66
last_win = nil,
7-
last_bufnr = nil,
87
last_mode = nil, -- "normal" | "float"
98
}
109

0 commit comments

Comments
 (0)