From 4e466e34c058b0c24adb2e5c96e0b574b10c7de3 Mon Sep 17 00:00:00 2001 From: Lyude Paul Date: Sat, 16 Oct 2021 18:09:14 -0400 Subject: [PATCH] Fix regression with setting UI options As @bellini666 [pointed out](https://github.com/daa84/neovim-gtk/issues/267#issuecomment-944499425) it seems that I accidentally broke the ability to set UI options when converting to nvim-rs. We both were using the wrong API call (nvim.set_option() instead of nvim.ui_set_option()) and accidentally adding a space between "ext_" and the name of the UI option. So, let's fix that. --- src/nvim/redraw_handler.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nvim/redraw_handler.rs b/src/nvim/redraw_handler.rs index 7ada55d5..913d3f1a 100644 --- a/src/nvim/redraw_handler.rs +++ b/src/nvim/redraw_handler.rs @@ -118,14 +118,14 @@ macro_rules! set_ui_opts { $ui.nvim() .ok_or_else(|| "Nvim not initialized".to_owned()) .and_then(|nvim| { - set_ui_opt(&nvim, stringify!(ext_$first_opt), &$first_val) - $( $( ?; set_ui_opt(&nvim, stringify!(ext_$opt), &$val) )* )? + set_ui_opt(&nvim, concat!("ext_", stringify!($first_opt)), &$first_val) + $( $( ?; set_ui_opt(&nvim, concat!("ext_", stringify!($opt)), &$val) )* )? }) }; } fn set_ui_opt(nvim: &NvimSession, opt: &str, val: &Value) -> Result<(), String> { - nvim.block_timeout(nvim.set_option(opt, Value::from(try_uint!(val) == 1))) + nvim.block_timeout(nvim.ui_set_option(opt, Value::from(try_uint!(val) == 1))) .map_err(|e| e.to_string()) }