Merge pull request #148 from TristanCrawford/api-fix

Modified 'setup_changed_listeners' for compatibility with 0.4.2
macos-click-through
Keith Simmons 5 years ago committed by GitHub
commit 16d2d75f8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -130,12 +130,16 @@ impl Settings {
pub async fn setup_changed_listeners(&self, nvim: &Neovim<Compat<ChildStdin>>) {
let keys : Vec<String> = self.settings.lock().keys().cloned().collect();
for name in keys {
let vimscript =
format!("function NeovideNotify{}Changed(d, k, z)\n", name) +
&format!(" call rpcnotify(1, \"setting_changed\", \"{}\", g:neovide_{})\n", name, name) +
"endfunction\n" +
&format!("call dictwatcheradd(g:, \"neovide_{}\", \"NeovideNotify{}Changed\")", name, name);
nvim.exec(&vimscript, false).await
let vimscript = format!(
concat!(
"exe \"",
"fun! NeovideNotify{0}Changed(d, k, z)\n",
"call rpcnotify(1, 'setting_changed', '{0}', g:neovide_{0})\n",
"endf\n",
"call dictwatcheradd(g:, 'neovide_{0}', 'NeovideNotify{0}Changed')\"",
)
, name);
nvim.command(&vimscript).await
.unwrap_or_explained_panic(&format!("Could not setup setting notifier for {}", name));
}
}

Loading…
Cancel
Save