mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +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:
@@ -1438,7 +1438,8 @@ void diff_win_options(win_T *wp, bool addbuf)
|
||||
}
|
||||
wp->w_p_fdm_save = xstrdup(wp->w_p_fdm);
|
||||
}
|
||||
set_string_option_direct_in_win(wp, kOptFoldmethod, "diff", OPT_LOCAL, 0);
|
||||
set_option_direct_for(kOptFoldmethod, STATIC_CSTR_AS_OPTVAL("diff"), OPT_LOCAL, 0, kOptReqWin,
|
||||
wp);
|
||||
|
||||
if (!wp->w_p_diff) {
|
||||
wp->w_p_fen_save = wp->w_p_fen;
|
||||
|
Reference in New Issue
Block a user