mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
refactor(options): remove set_string_option_direct()
Problem: `set_string_option_direct()` contains a separate codepath specifically for setting string options. Not only is that unnecessary code duplication, but it's also limited to only string options. Solution: Replace `set_string_option_direct()` with `set_option_direct()` which calls `set_option()` under the hood. This reduces code duplication and allows directly setting an option of any type.
This commit is contained in:
@@ -1105,7 +1105,7 @@ void ex_retab(exarg_T *eap)
|
||||
colnr_T *old_vts_ary = curbuf->b_p_vts_array;
|
||||
|
||||
if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_vts_array) > 1) {
|
||||
set_string_option_direct(kOptVartabstop, new_ts_str, OPT_LOCAL, 0);
|
||||
set_option_direct(kOptVartabstop, CSTR_AS_OPTVAL(new_ts_str), OPT_LOCAL, 0);
|
||||
curbuf->b_p_vts_array = new_vts_array;
|
||||
xfree(old_vts_ary);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user