From 55d5052ffaebb237fd8c315d2d10c93430bf5ae6 Mon Sep 17 00:00:00 2001 From: Igor Iatsenko Date: Thu, 16 Jan 2025 16:13:13 +0100 Subject: [PATCH] fix(input): put the cursor right after the default prompt --- lua/snacks/input.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/snacks/input.lua b/lua/snacks/input.lua index c91fe8b7..78498ca3 100644 --- a/lua/snacks/input.lua +++ b/lua/snacks/input.lua @@ -189,7 +189,7 @@ function M.input(opts, on_confirm) vim.cmd.startinsert() if opts.default then vim.api.nvim_buf_set_lines(win.buf, 0, -1, false, { opts.default }) - vim.api.nvim_win_set_cursor(win.win, { 1, #opts.default + 1 }) + vim.api.nvim_win_set_cursor(win.win, { 1, #opts.default }) end vim.fn.prompt_setcallback(win.buf, function(text) confirm(text)