Skip to content

Commit deba02d

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.0.2086: code cleanup for option callbacks needed
Problem: code cleanup for option callbacks needed Solution: remove flag os_doskip, it's not necessary, as we can check, whether an error message was returned Remove unnecessary field os_doskip Callback functions for boolean options set os_doskip immediately before returning an error message, so os_doskip isn't actually needed. closes: #13461 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 2b358ad commit deba02d

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

src/option.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3680,7 +3680,6 @@ did_set_modifiable(optset_T *args UNUSED)
36803680
&& curbuf->b_term != NULL && !term_is_finished(curbuf))))
36813681
{
36823682
curbuf->b_p_ma = FALSE;
3683-
args->os_doskip = TRUE;
36843683
return e_cannot_make_terminal_with_running_job_modifiable;
36853684
}
36863685
# endif
@@ -3942,7 +3941,6 @@ did_set_previewwindow(optset_T *args)
39423941
if (win->w_p_pvw && win != curwin)
39433942
{
39443943
curwin->w_p_pvw = FALSE;
3945-
args->os_doskip = TRUE;
39463944
return e_preview_window_already_exists;
39473945
}
39483946

@@ -4130,7 +4128,6 @@ did_set_termguicolors(optset_T *args UNUSED)
41304128
!has_vtp_working())
41314129
{
41324130
p_tgc = 0;
4133-
args->os_doskip = TRUE;
41344131
return e_24_bit_colors_are_not_supported_on_this_environment;
41354132
}
41364133
if (is_term_win32())
@@ -4602,7 +4599,7 @@ set_bool_option(
46024599
args.os_newval.boolean = value;
46034600
args.os_errbuf = NULL;
46044601
errmsg = options[opt_idx].opt_did_set_cb(&args);
4605-
if (args.os_doskip)
4602+
if (errmsg != NULL)
46064603
return errmsg;
46074604
}
46084605

src/structs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4948,10 +4948,6 @@ typedef struct
49484948
char_u *string;
49494949
} os_newval;
49504950

4951-
// When set by the called function: Stop processing the option further.
4952-
// Currently only used for boolean options.
4953-
int os_doskip;
4954-
49554951
// Option value was checked to be safe, no need to set P_INSECURE
49564952
// Used for the 'keymap', 'filetype' and 'syntax' options.
49574953
int os_value_checked;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
2086,
707709
/**/
708710
2085,
709711
/**/

0 commit comments

Comments
 (0)