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

Commit 8b324de

Browse files
fix: get_all_entries and process writer
return empty table instead of nil when index.json not found, and write directly to the process with the string instead of echo
1 parent 927f937 commit 8b324de

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lua/nvim-devdocs/operations.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ M.get_entries = function(alias)
184184
end
185185

186186
M.get_all_entries = function()
187-
if not index_path:exists() then return end
187+
if not index_path:exists() then return {} end
188188

189189
local entries = {}
190190
local index_content = index_path:read()
@@ -233,8 +233,6 @@ M.open = function(entry, float)
233233

234234
if plugin_config.previewer_cmd then
235235
local chan = vim.api.nvim_open_term(buf, {})
236-
local echo = job:new({ command = "echo", args = { markdown } })
237-
238236
local previewer = job:new({
239237
command = plugin_config.previewer_cmd,
240238
args = plugin_config.cmd_args,
@@ -244,9 +242,8 @@ M.open = function(entry, float)
244242
vim.api.nvim_chan_send(chan, line .. "\r\n")
245243
end
246244
end),
247-
writer = echo,
245+
writer = markdown,
248246
})
249-
250247
previewer:start()
251248
else
252249
vim.bo[buf].ft = "markdown"

0 commit comments

Comments
 (0)