aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2014-10-11 19:29:38 -0400
committerScott Prager <splinterofchaos@gmail.com>2014-11-12 15:37:56 -0500
commitc92e649a1ef9846ec86b09acc8d92f30b1c1d5db (patch)
treed2d2c5432bab036cdeacd7460c0b4266da44c8a7
parent24ebb018e28187c61900b1616e4f79fec9d70878 (diff)
downloadrneovim-c92e649a1ef9846ec86b09acc8d92f30b1c1d5db.tar.gz
rneovim-c92e649a1ef9846ec86b09acc8d92f30b1c1d5db.tar.bz2
rneovim-c92e649a1ef9846ec86b09acc8d92f30b1c1d5db.zip
vim-patch: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. https://code.google.com/p/vim/source/detail?r=v7-4-417
-rw-r--r--src/nvim/option.c24
-rw-r--r--src/nvim/testdir/test_breakindent.in1
-rw-r--r--src/nvim/version.c2
3 files changed, 14 insertions, 13 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 207be0bd74..1ab1c32f3c 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -3481,7 +3481,7 @@ static void didset_options(void)
(void)compile_cap_prog(curwin->w_s);
/* set cedit_key */
(void)check_cedit();
- briopt_check();
+ briopt_check(curwin);
}
/*
@@ -3818,7 +3818,7 @@ did_set_string_option (
}
/* 'breakindentopt' */
else if (varp == &curwin->w_p_briopt) {
- if (briopt_check() == FAIL)
+ if (briopt_check(curwin) == FAIL)
errmsg = e_invarg;
}
/*
@@ -6771,6 +6771,7 @@ void win_copy_options(win_T *wp_from, win_T *wp_to)
copy_winopt(&wp_from->w_allbuf_opt, &wp_to->w_allbuf_opt);
/* Is this right? */
wp_to->w_farsi = wp_from->w_farsi;
+ briopt_check(wp_to);
}
/*
@@ -8143,16 +8144,15 @@ void find_mps_values(int *initc, int *findc, int *backwards, int switchit)
}
}
-/* This is called when 'breakindentopt' is changed and when a window is
- initialized */
-int briopt_check(void)
+/// This is called when 'breakindentopt' is changed and when a window is
+/// initialized
+static bool briopt_check(win_T *wp)
{
- char_u *p;
int bri_shift = 0;
long bri_min = 20;
bool bri_sbr = false;
- p = curwin->w_p_briopt;
+ char_u *p = wp->w_p_briopt;
while (*p != NUL)
{
if (STRNCMP(p, "shift:", 6) == 0
@@ -8172,15 +8172,15 @@ int briopt_check(void)
bri_sbr = true;
}
if (*p != ',' && *p != NUL)
- return FAIL;
+ return false;
if (*p == ',')
++p;
}
- curwin->w_p_brishift = bri_shift;
- curwin->w_p_brimin = bri_min;
- curwin->w_p_brisbr = bri_sbr;
+ wp->w_p_brishift = bri_shift;
+ wp->w_p_brimin = bri_min;
+ wp->w_p_brisbr = bri_sbr;
- return OK;
+ return true;
}
diff --git a/src/nvim/testdir/test_breakindent.in b/src/nvim/testdir/test_breakindent.in
index 79e25f79de..150c9430db 100644
--- a/src/nvim/testdir/test_breakindent.in
+++ b/src/nvim/testdir/test_breakindent.in
@@ -27,6 +27,7 @@ STARTTEST
: $put =g:line1
: wincmd p
:endfu
+:set briopt=min:0
:let g:test="Test 1: Simple breakindent"
:let line1=ScreenChar(8)
:call DoRecordScreen()
diff --git a/src/nvim/version.c b/src/nvim/version.c
index cf0edd8542..248332c42c 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -248,7 +248,7 @@ static int included_patches[] = {
//420 NA
//419,
418,
- //417,
+ 417,
416,
415,
414,