Replies: 1 comment
-
You can just do something like this: local prompt = "> "
local input = Input({
relative = "cursor",
position = { row = 1, col = 0 },
size = { width = 20 },
border = "single",
}, {
prompt = prompt,
})
input:mount()
vim.keymap.set({ "n", "i" }, "<Enter>", function()
local value = string.sub(vim.api.nvim_get_current_line(), vim.fn.strwidth(prompt) + 1)
print(value)
end, { buffer = input.bufnr }) This will override the default behavior of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use the input box to send commands, which will send the inputs to an external program updating other popups

but when I submit, all of the boxes in the layout just close.
I can call a function in on submit to re-open the layout, but it causes the screen to flicker as it closes and re-opens which is a little annoying. Do you have advice on the best way to just have the input box clear the input text without closing when the on_submit function runs?
Beta Was this translation helpful? Give feedback.
All reactions