From cbfcdbbf3637db17a5e1bcaaa637798db8f0cce7 Mon Sep 17 00:00:00 2001 From: NicolasGB Date: Tue, 7 Apr 2026 09:53:46 +0200 Subject: [PATCH] fix(terminal): Correctly reset position on floating terminal --- lua/jj/ui/terminal.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/jj/ui/terminal.lua b/lua/jj/ui/terminal.lua index b1e9e71..11fbb42 100644 --- a/lua/jj/ui/terminal.lua +++ b/lua/jj/ui/terminal.lua @@ -328,9 +328,6 @@ function M.run_floating(cmd, keymaps, float_opts) end, }) state.floating_buf = buf - if state.cursor_restore_pos then - M.restore_cursor_position() - end local jid local chan @@ -398,6 +395,10 @@ function M.run_floating(cmd, keymaps, float_opts) buffer.set_modifiable(state.floating_buf, false) end buffer.stop_insert(state.floating_buf) + -- Restore the cursor position now that the command is done + if state.cursor_restore_pos then + M.restore_cursor_position() + end end) end, })