Add a new option, start_in_insert, that defaults to true and controls whether the input will start in insert or normal mode.
Context
I'd like to conditionally enable normal mode when certain criteria are met, e.g. when using vim.ui.input with LSP rename.
Description
This PR introduces an option that controls whether insert mode will be activated or not, and it can be used along with get_config for conditional behavior. For instance:
Add a new option,
start_in_insert
, that defaults to true and controls whether the input will start in insert or normal mode.Context
I'd like to conditionally enable normal mode when certain criteria are met, e.g. when using
vim.ui.input
with LSP rename.Description
This PR introduces an option that controls whether insert mode will be activated or not, and it can be used along with
get_config
for conditional behavior. For instance:Test Plan
Test case 1
start_in_insert
totrue
insetup()
(or leave it unset since the default value is true already).vim.ui.input({default = "some text"}, function() end)
.Test case 2
start_in_insert
tofalse
insetup()
vim.ui.input({default = "some text"}, function() end)
.