Skip to content

Commit

Permalink
feat(core.ui): let create_split take in a height variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed May 14, 2023
1 parent adbb415 commit 7dbbe9d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lua/neorg/modules/core/ui/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ module.public = {

---Creates a new horizontal split at the bottom of the screen
---@param name string the name of the buffer contained within the split (will have neorg:// prepended to it)
---@param config table a table of <option> = <value> keypairs signifying buffer-local options for the buffer contained within the split
create_split = function(name, config)
---@param config table? a table of <option> = <value> keypairs signifying buffer-local options for the buffer contained within the split
---@param height number? the height of the new split
create_split = function(name, config, height)
vim.validate({
name = { name, "string" },
config = { config, "table", true },
height = { height, "number", true },
})

local bufname = "neorg://" .. name
Expand All @@ -121,6 +123,10 @@ module.public = {

vim.cmd("below new")

if height then
vim.api.nvim_win_set_height(0, height)
end

local buf = vim.api.nvim_win_get_buf(0)

local default_options = {
Expand Down

0 comments on commit 7dbbe9d

Please sign in to comment.