summaryrefslogtreecommitdiff
path: root/lua/aotrix/plugins/build.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/aotrix/plugins/build.lua')
-rw-r--r--lua/aotrix/plugins/build.lua35
1 files changed, 24 insertions, 11 deletions
diff --git a/lua/aotrix/plugins/build.lua b/lua/aotrix/plugins/build.lua
index a7c5dfe..ed79189 100644
--- a/lua/aotrix/plugins/build.lua
+++ b/lua/aotrix/plugins/build.lua
@@ -139,6 +139,8 @@ return {
local selectedCommand = nil
local Input = require("nui.input")
+ local Layout = require("nui.layout")
+ local event = require("nui.utils.autocmd").event
local inputDescription = Input({
position = "50%",
size = {width = 120},
@@ -171,7 +173,6 @@ return {
end
})
local input = Input({
- position = "50%",
size = {width = 120},
border = {
style = "single",
@@ -185,21 +186,33 @@ return {
default_value = "",
on_submit = function(value)
selectedCommand = value
- inputDescription:mount()
- local insert = vim.api.nvim_replace_termcodes("i", true,
- true, true)
- vim.api.nvim_feedkeys(insert, "t", false)
- inputDescription:map("n", "<Esc>", function()
- inputDescription:unmount()
- end, {noremap = true})
end
})
- -- mount/open the component
- input:mount()
-
input:map("n", "<Esc>", function() input:unmount() end,
{noremap = true})
+ inputDescription:map("n", "<Esc>",
+ function()
+ inputDescription:unmount()
+ end, {noremap = true})
+
+ inputDescription:on(event.BufEnter, function()
+ local insert = vim.api.nvim_replace_termcodes("i", true, true,
+ true)
+ vim.api.nvim_feedkeys(insert, "t", false)
+ end)
+
+ local layout = Layout({
+ position = "0%",
+ size = {width = "100%", height = "100%"}
+ }, Layout.Box({
+ Layout.Box(input, {size = {width = "50%", height = "100%"}}),
+ Layout.Box(inputDescription,
+ {size = {width = "50%", height = "100%"}})
+ }, {dir = "row"}))
+
+ layout:mount()
+
end
local deleteCommand = function()