1
0
forked from aniani/vim

updated for version 7.4.417

Problem:    After splitting a window and setting 'breakindent' the default
            minimum with is not respected.
Solution:   Call briopt_check() when copying options to a new window.
This commit is contained in:
Bram Moolenaar
2014-08-24 21:39:49 +02:00
parent 9576508975
commit 285ed7e049
4 changed files with 18 additions and 9 deletions

View File

@@ -3097,6 +3097,9 @@ static void fill_breakat_flags __ARGS((void));
static int opt_strings_flags __ARGS((char_u *val, char **values, unsigned *flagp, int list)); static int opt_strings_flags __ARGS((char_u *val, char **values, unsigned *flagp, int list));
static int check_opt_strings __ARGS((char_u *val, char **values, int)); static int check_opt_strings __ARGS((char_u *val, char **values, int));
static int check_opt_wim __ARGS((void)); static int check_opt_wim __ARGS((void));
#ifdef FEAT_LINEBREAK
static int briopt_check __ARGS((win_T *wp));
#endif
/* /*
* Initialize the options, first part. * Initialize the options, first part.
@@ -5289,7 +5292,7 @@ didset_options()
(void)check_cedit(); (void)check_cedit();
#endif #endif
#ifdef FEAT_LINEBREAK #ifdef FEAT_LINEBREAK
briopt_check(); briopt_check(curwin);
#endif #endif
} }
@@ -5748,7 +5751,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
/* 'breakindentopt' */ /* 'breakindentopt' */
else if (varp == &curwin->w_p_briopt) else if (varp == &curwin->w_p_briopt)
{ {
if (briopt_check() == FAIL) if (briopt_check(curwin) == FAIL)
errmsg = e_invarg; errmsg = e_invarg;
} }
#endif #endif
@@ -10232,6 +10235,9 @@ win_copy_options(wp_from, wp_to)
wp_to->w_farsi = wp_from->w_farsi; wp_to->w_farsi = wp_from->w_farsi;
# endif # endif
# endif # endif
#if defined(FEAT_LINEBREAK)
briopt_check(wp_to);
#endif
} }
#endif #endif
@@ -12002,15 +12008,16 @@ find_mps_values(initc, findc, backwards, switchit)
* This is called when 'breakindentopt' is changed and when a window is * This is called when 'breakindentopt' is changed and when a window is
* initialized. * initialized.
*/ */
int static int
briopt_check() briopt_check(wp)
win_T *wp;
{ {
char_u *p; char_u *p;
int bri_shift = 0; int bri_shift = 0;
long bri_min = 20; long bri_min = 20;
int bri_sbr = FALSE; int bri_sbr = FALSE;
p = curwin->w_p_briopt; p = wp->w_p_briopt;
while (*p != NUL) while (*p != NUL)
{ {
if (STRNCMP(p, "shift:", 6) == 0 if (STRNCMP(p, "shift:", 6) == 0
@@ -12035,9 +12042,9 @@ briopt_check()
++p; ++p;
} }
curwin->w_p_brishift = bri_shift; wp->w_p_brishift = bri_shift;
curwin->w_p_brimin = bri_min; wp->w_p_brimin = bri_min;
curwin->w_p_brisbr = bri_sbr; wp->w_p_brisbr = bri_sbr;
return OK; return OK;
} }

View File

@@ -62,5 +62,4 @@ int check_ff_value __ARGS((char_u *p));
long get_sw_value __ARGS((buf_T *buf)); long get_sw_value __ARGS((buf_T *buf));
long get_sts_value __ARGS((void)); long get_sts_value __ARGS((void));
void find_mps_values __ARGS((int *initc, int *findc, int *backwards, int switchit)); void find_mps_values __ARGS((int *initc, int *findc, int *backwards, int switchit));
int briopt_check __ARGS((void));
/* vim: set ft=c : */ /* vim: set ft=c : */

View File

@@ -27,6 +27,7 @@ STARTTEST
: $put =g:line1 : $put =g:line1
: wincmd p : wincmd p
:endfu :endfu
:set briopt=min:0
:let g:test="Test 1: Simple breakindent" :let g:test="Test 1: Simple breakindent"
:let line1=ScreenChar(8) :let line1=ScreenChar(8)
:call DoRecordScreen() :call DoRecordScreen()

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
417,
/**/ /**/
416, 416,
/**/ /**/