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:
daa84 2017-10-13 13:16:52 +03:00
parent dcdd6d98d1
commit 42b6bdcd64
2 changed files with 13 additions and 9 deletions

View File

@ -34,9 +34,7 @@ impl ErrorArea {
<span foreground=\"red\"><i>{}</i></span>\n\n\
<big>Possible error reasons:</big>\n\
&#9679; Not supported nvim version (minimum supported version is <b>{}</b>)\n\
&#9679; Error in configuration file (init.vim or ginit.vim)\n\
&#9679; Wrong nvim binary path \
(right path can be passed with <i>--nvim-bin-path=path_here</i>)",
&#9679; Error in configuration file (init.vim or ginit.vim)",
encode_minimal(err), shell::MINIMUM_SUPPORTED_NVIM_VERSION));
self.base.show_all();
}

View File

@ -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),
}