mirror of
https://github.com/neovide/neovide.git
synced 2026-09-10 07:16:25 -04:00
Use RPC requests instead of notify for quit requests (#2312)
This commit is contained in:
parent
e497ec7771
commit
879172ec07
|
|
@ -94,7 +94,7 @@ vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
|
|||
once = true,
|
||||
nested = true,
|
||||
callback = function()
|
||||
rpcnotify("neovide.quit", vim.v.exiting)
|
||||
rpcrequest("neovide.quit", vim.v.exiting)
|
||||
end
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,13 @@ impl Handler for NeovimHandler {
|
|||
}
|
||||
"neovide.set_clipboard" => set_clipboard_contents(&arguments[0])
|
||||
.map_err(|_| Value::from("cannot set clipboard contents")),
|
||||
"neovide.quit" => {
|
||||
let error_code = arguments[0]
|
||||
.as_i64()
|
||||
.expect("Could not parse error code from neovim");
|
||||
RUNNING_TRACKER.quit_with_code(error_code as i32, "Quit from neovim");
|
||||
Ok(Value::Nil)
|
||||
}
|
||||
_ => Ok(Value::from("rpcrequest not handled")),
|
||||
}
|
||||
}
|
||||
|
|
@ -92,12 +99,6 @@ impl Handler for NeovimHandler {
|
|||
"option_changed" => {
|
||||
SETTINGS.handle_option_changed_notification(arguments, &self.proxy.lock().unwrap());
|
||||
}
|
||||
"neovide.quit" => {
|
||||
let error_code = arguments[0]
|
||||
.as_i64()
|
||||
.expect("Could not parse error code from neovim");
|
||||
RUNNING_TRACKER.quit_with_code(error_code as i32, "Quit from neovim");
|
||||
}
|
||||
#[cfg(windows)]
|
||||
"neovide.register_right_click" => {
|
||||
let _ = self
|
||||
|
|
|
|||
Loading…
Reference in a new issue