From d35abdab99d6fbb32a8a8fc9088e009723812e38 Mon Sep 17 00:00:00 2001 From: Ahmed Mughal Date: Fri, 22 Aug 2025 22:57:11 +0500 Subject: [PATCH] fix(editors): fix neovim closing when using `modify with editor` (#5337) Co-authored-by: Jacob Richman --- packages/core/src/utils/editor.test.ts | 2 +- packages/core/src/utils/editor.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/utils/editor.test.ts b/packages/core/src/utils/editor.test.ts index fcf50f9c..a29b2a8b 100644 --- a/packages/core/src/utils/editor.test.ts +++ b/packages/core/src/utils/editor.test.ts @@ -290,7 +290,7 @@ describe('editor utils', () => { '-c', 'wincmd l | setlocal statusline=%#StatusBold#NEW\\ FILE\\ :wqa(save\\ &\\ quit)\\ \\|\\ i/esc(toggle\\ edit\\ mode)', '-c', - 'autocmd WinClosed * wqa', + 'autocmd BufWritePost * wqa', 'old.txt', 'new.txt', ], diff --git a/packages/core/src/utils/editor.ts b/packages/core/src/utils/editor.ts index efaef249..fba6ed3f 100644 --- a/packages/core/src/utils/editor.ts +++ b/packages/core/src/utils/editor.ts @@ -140,7 +140,7 @@ export function getDiffCommand( 'wincmd l | setlocal statusline=%#StatusBold#NEW\\ FILE\\ :wqa(save\\ &\\ quit)\\ \\|\\ i/esc(toggle\\ edit\\ mode)', // Auto close all windows when one is closed '-c', - 'autocmd WinClosed * wqa', + 'autocmd BufWritePost * wqa', oldPath, newPath, ],