FIX: Changed naming convention to be the same throughout the presets

file and fixed neovim api for temrinal.

Update: Changed how presets are made to be simpler
This commit is contained in:
DarthMooMancer
2025-05-02 10:46:07 -04:00
parent ff360658e4
commit bbb1e0c24a
2 changed files with 31 additions and 49 deletions
+29 -47
View File
@@ -1,61 +1,43 @@
---@type table
local M = {}
---@type table
local opts = {}
---@class Preset
---@field left_padding integer
---@field right_padding integer
---@field top_padding integer
---@field bottom_padding integer
---@type Preset
local center = {
left_padding = 0,
right_padding = 0,
top_padding = 0,
bottom_padding = 0
M.presets = {
centered = {
left_padding = 0,
right_padding = 0,
top_padding = 0,
bottom_padding = 0
},
center_panel = {
left_padding = 0,
right_padding = 100,
top_padding = 0,
bottom_padding = 0,
},
right_panel = {
left_padding = 100,
right_padding = 0,
top_padding = 0,
bottom_padding = 0,
},
cornered = {
left_padding = 100,
right_padding = 0,
top_padding = 25,
bottom_padding = 0,
}
}
---@type Preset
local center_panel = {
left_padding = 0,
right_padding = 100,
top_padding = 0,
bottom_padding = 0,
}
---@type Preset
local right_panel = {
left_padding = 100,
right_padding = 0,
top_padding = 0,
bottom_padding = 0,
}
---@type Preset
local corner = {
left_padding = 100,
right_padding = 0,
top_padding = 25,
bottom_padding = 0,
}
---@param preset string
---@return table
function M.getPresets(preset)
-- if preset == "custom" then
-- opts = nil
if preset == "centered" then
opts = center
opts = M.presets.centered
elseif preset == "center_panel" then
opts = center_panel
opts = M.presets.center_panel
elseif preset == "right_panel" then
opts = right_panel
opts = M.presets.right_panel
elseif preset == "cornered" then
opts = corner
opts = M.presets.cornered
else
print("Preset option: " .. preset .. " does not exist")
end