Skip to content

Commit bdf697d

Browse files
authored
fix(inline): leave visual mode after making inline request (#2562)
1 parent 3dac4f7 commit bdf697d

File tree

1 file changed

+4
-0
lines changed
  • lua/codecompanion/interactions/inline

1 file changed

+4
-0
lines changed

lua/codecompanion/interactions/inline/init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@ local _streaming = true
419419
function Inline:submit(prompt)
420420
log:info("[Inline] Request started")
421421

422+
if self.buffer_context.is_visual then
423+
pcall(vim.cmd.normal, { vim.fn.mode(), bang = true })
424+
end
425+
422426
-- Inline editing only works with streaming off - We should remember the current status
423427
_streaming = self.adapter.opts.stream
424428
self.adapter.opts.stream = false

0 commit comments

Comments
 (0)