fix(utils): fixed bottom split and added sizing for splits
This commit is contained in:
@@ -35,6 +35,13 @@ local function default_languages(project_root)
|
|||||||
["<leader>pr"] = "CppRun",
|
["<leader>pr"] = "CppRun",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
python = {
|
||||||
|
project_root = project_root .. "/Python",
|
||||||
|
keybinds = {
|
||||||
|
["<leader>pr"] = "PythonRun",
|
||||||
|
["<leader>pb"] = "PythonPip",
|
||||||
|
},
|
||||||
|
},
|
||||||
html = {
|
html = {
|
||||||
project_root = project_root .. "/Html",
|
project_root = project_root .. "/Html",
|
||||||
},
|
},
|
||||||
@@ -55,7 +62,7 @@ function M.setup(user_opts)
|
|||||||
terminal = {
|
terminal = {
|
||||||
mode = "split", -- floating or split
|
mode = "split", -- floating or split
|
||||||
win = {
|
win = {
|
||||||
type = "vertical", anchor = "right" -- type: "vertical" or "horizonal" -- anchor: "below" or "right" or "center" or "corner"
|
type = "horizontal", anchor = "bottom", size = "20" -- type: "vertical" or "horizonal" -- anchor: "below" or "right" or "center" or "corner" -- size: amount of cols or rows based on percentage without percente symbol
|
||||||
},
|
},
|
||||||
border = {
|
border = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
|
|||||||
+1
-1
@@ -139,7 +139,7 @@ function M.manager(project_root)
|
|||||||
local lines = {}
|
local lines = {}
|
||||||
local fd = io.open(entry.full_path, "r")
|
local fd = io.open(entry.full_path, "r")
|
||||||
if fd then
|
if fd then
|
||||||
for i = 1, 100 do
|
for _ = 1, 100 do
|
||||||
local line = fd:read("*line")
|
local line = fd:read("*line")
|
||||||
if not line then break end
|
if not line then break end
|
||||||
table.insert(lines, line)
|
table.insert(lines, line)
|
||||||
|
|||||||
@@ -91,16 +91,16 @@ function M.terminal(cmd)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if M.opts.win.type == "horizontal" then
|
if M.opts.win.type == "horizontal" then
|
||||||
if M.opts.anchor == "bottom" then
|
if M.opts.win.anchor == "bottom" then
|
||||||
vim.cmd("set splitbelow")
|
vim.cmd("set splitbelow")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if M.opts.win.type == "vertical" then
|
if M.opts.win.type == "vertical" then
|
||||||
vim.cmd("vsplit")
|
vim.cmd(M.opts.win.size .. " vsplit")
|
||||||
end
|
end
|
||||||
if M.opts.win.type == "horizontal" then
|
if M.opts.win.type == "horizontal" then
|
||||||
vim.cmd("split")
|
vim.cmd(M.opts.win.size .. " split")
|
||||||
end
|
end
|
||||||
local buf = vim.api.nvim_create_buf(false, true)
|
local buf = vim.api.nvim_create_buf(false, true)
|
||||||
vim.api.nvim_win_set_buf(0, buf)
|
vim.api.nvim_win_set_buf(0, buf)
|
||||||
|
|||||||
Reference in New Issue
Block a user