aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/optionstr.c
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@proton.me>2024-01-10 04:15:22 +0600
committerGitHub <noreply@github.com>2024-01-10 06:15:22 +0800
commit10f36af84d4ccb0b626cd6c79c6ba2f2735a56fd (patch)
treecffc1614f18b97712a9fb332deba53a7b21dc0a4 /src/nvim/optionstr.c
parent501cf323575864c847be892da1197daa8c3771a1 (diff)
downloadrneovim-10f36af84d4ccb0b626cd6c79c6ba2f2735a56fd.tar.gz
rneovim-10f36af84d4ccb0b626cd6c79c6ba2f2735a56fd.tar.bz2
rneovim-10f36af84d4ccb0b626cd6c79c6ba2f2735a56fd.zip
refactor(options): remove `OPT_FREE` (#26963)
Problem: `OPT_FREE` macro doesn't seem to do anything as `P_ALLOCED` already handles allocations. Solution: Remove `OPT_FREE`.
Diffstat (limited to 'src/nvim/optionstr.c')
-rw-r--r--src/nvim/optionstr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index a1f2d69761..3930e53a90 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -289,7 +289,7 @@ static void set_string_option_global(vimoption_T *opt, char **varp)
/// "set_sid" is SID_NONE don't set the scriptID. Otherwise set the scriptID to
/// "set_sid".
///
-/// @param opt_flags OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL.
+/// @param opt_flags Option flags.
///
/// TODO(famiu): Remove this and its win/buf variants.
void set_string_option_direct(OptIndex opt_idx, const char *val, int opt_flags, scid_T set_sid)
@@ -306,7 +306,7 @@ void set_string_option_direct(OptIndex opt_idx, const char *val, int opt_flags,
char *s = xstrdup(val);
char **varp = (char **)get_varp_scope(opt, both ? OPT_LOCAL : opt_flags);
- if ((opt_flags & OPT_FREE) && (opt->flags & P_ALLOCED)) {
+ if (opt->flags & P_ALLOCED) {
free_string_option(*varp);
}
*varp = s;