diff --git a/lua/artio/view.lua b/lua/artio/view.lua --- a/lua/artio/view.lua +++ b/lua/artio/view.lua @@ -328,7 +328,7 @@ self:setopts() -- start insert *before* registering events - self:updatecursor() + self:updatecursor(#cmdbuff) vim._with({ noautocmd = true }, function() vim.cmd.startinsert({ bang = true }) end) @@ -455,6 +455,7 @@ pos = cursorpos[2] - promptlen end + -- set cursor pos to *at least* the prompt length curpos[2] = math.max(curpos[2], promptlen) if curpos[1] == promptidx + 1 and curpos[2] == promptlen + pos then