Add neovide_confirm_quit option to confirm before quitting (#1247)

* Add g:neovide_confirm_quit which will ask before quitting

* more compact

* cargo fmt
macos-click-through
Vivianne 3 years ago committed by GitHub
parent 9e3500501d
commit 5def324265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -127,7 +127,11 @@ impl ParallelCommand {
async fn execute(self, nvim: &Neovim<TxWrapper>) { async fn execute(self, nvim: &Neovim<TxWrapper>) {
match self { match self {
ParallelCommand::Quit => { ParallelCommand::Quit => {
nvim.command("qa!").await.ok(); nvim.command(
"if get(g:, 'neovide_confirm_quit', 0) == 1 | confirm qa | else | qa! | endif",
)
.await
.ok();
} }
ParallelCommand::Resize { width, height } => nvim ParallelCommand::Resize { width, height } => nvim
.ui_try_resize(width.max(10) as i64, height.max(3) as i64) .ui_try_resize(width.max(10) as i64, height.max(3) as i64)

Loading…
Cancel
Save