diff --git a/README.md b/README.md index 5437964..9339278 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ EOF ## Usage -Use `:DocsViewToggle` to open/close the docs view side panel +Use `:DocsViewToggle` to open/close the docs view panel ## LICENSE diff --git a/lua/docs-view.lua b/lua/docs-view.lua index a096a71..2c81c86 100644 --- a/lua/docs-view.lua +++ b/lua/docs-view.lua @@ -17,6 +17,9 @@ local function toggle() if cfg.position == "bottom" then vim.api.nvim_command("bel new") width = vim.api.nvim_win_get_width(prev_win) + elseif cfg.position == "top" then + vim.api.nvim_command("top new") + width = vim.api.nvim_win_get_height(prev_win) elseif cfg.position == "left" then vim.api.nvim_command("topleft vnew") height = vim.api.nvim_win_get_height(prev_win)