Disable swap files
In case neovim ends unexpected on next start - neovim ask user for recovery but gui have not access to this event. So temprorary disable this. Also do some improvemnt, so error message can be shown to user on nvim start errors
This commit is contained in:
parent
dcdd6d98d1
commit
42b6bdcd64
@ -34,9 +34,7 @@ impl ErrorArea {
|
||||
<span foreground=\"red\"><i>{}</i></span>\n\n\
|
||||
<big>Possible error reasons:</big>\n\
|
||||
● Not supported nvim version (minimum supported version is <b>{}</b>)\n\
|
||||
● Error in configuration file (init.vim or ginit.vim)\n\
|
||||
● Wrong nvim binary path \
|
||||
(right path can be passed with <i>--nvim-bin-path=path_here</i>)",
|
||||
● Error in configuration file (init.vim or ginit.vim)",
|
||||
encode_minimal(err), shell::MINIMUM_SUPPORTED_NVIM_VERSION));
|
||||
self.base.show_all();
|
||||
}
|
||||
|
18
src/nvim.rs
18
src/nvim.rs
@ -236,6 +236,8 @@ pub fn start(
|
||||
|
||||
cmd.arg("--embed")
|
||||
.arg("--headless")
|
||||
// Swap files are disabled because it shows message window on start up but frontend can't detect it.
|
||||
.arg("-n")
|
||||
.arg("--cmd")
|
||||
.arg("set termguicolors")
|
||||
.arg("--cmd")
|
||||
@ -388,15 +390,19 @@ fn call_gui_event(
|
||||
match try_str!(args[0]) {
|
||||
"Popupmenu" => {
|
||||
ui.nvim()
|
||||
.unwrap()
|
||||
.set_option(UiOption::ExtPopupmenu(try_uint!(args[1]) == 1))
|
||||
.map_err(|e| e.to_string())?
|
||||
.ok_or_else(|| "Nvim not initialized".to_owned())
|
||||
.and_then(|mut nvim| {
|
||||
nvim.set_option(UiOption::ExtPopupmenu(try_uint!(args[1]) == 1))
|
||||
.map_err(|e| e.to_string())
|
||||
})?
|
||||
}
|
||||
"Tabline" => {
|
||||
ui.nvim()
|
||||
.unwrap()
|
||||
.set_option(UiOption::ExtTabline(try_uint!(args[1]) == 1))
|
||||
.map_err(|e| e.to_string())?
|
||||
.ok_or_else(|| "Nvim not initialized".to_owned())
|
||||
.and_then(|mut nvim| {
|
||||
nvim.set_option(UiOption::ExtTabline(try_uint!(args[1]) == 1))
|
||||
.map_err(|e| e.to_string())
|
||||
})?
|
||||
}
|
||||
opt => error!("Unknown option {}", opt),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user