diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-01 22:06:07 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-01 22:06:07 +0200 |
commit | f8a071265535b8cc43e50a81f4d5049883ca50e4 (patch) | |
tree | 9a9853212002909960c51efbf60b42b3e708d50c /src | |
parent | a83e70000f106a1e1e0f86e8e362ec94c0df074c (diff) |
patch 8.1.1614: 'numberwidth' can only go up to 10v8.1.1614
Problem: 'numberwidth' can only go up to 10.
Solution: Allow up to 20. (Charlie Stanton, closes #4584)
Diffstat (limited to 'src')
-rw-r--r-- | src/option.c | 4 | ||||
-rw-r--r-- | src/screen.c | 50 | ||||
-rw-r--r-- | src/testdir/gen_opt_test.vim | 2 | ||||
-rw-r--r-- | src/testdir/test_options.vim | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
5 files changed, 31 insertions, 29 deletions
diff --git a/src/option.c b/src/option.c index 941ea66ff9..cd50e8d622 100644 --- a/src/option.c +++ b/src/option.c @@ -9493,10 +9493,10 @@ set_num_option( errmsg = e_positive; curwin->w_p_nuw = 1; } - if (curwin->w_p_nuw > 10) + if (curwin->w_p_nuw > 20) { errmsg = e_invarg; - curwin->w_p_nuw = 10; + curwin->w_p_nuw = 20; } curwin->w_nrwidth_line_count = 0; /* trigger a redraw */ } diff --git a/src/screen.c b/src/screen.c index 75413451f5..d39fca2637 100644 --- a/src/screen.c +++ b/src/screen.c @@ -3149,32 +3149,32 @@ win_line( int nochange UNUSED, // not updating for changed text int number_only) // only update the number column { - int col = 0; /* visual column on screen */ - unsigned off; /* offset in ScreenLines/ScreenAttrs */ - int c = 0; /* init for GCC */ - long vcol = 0; /* virtual column (for tabs) */ + int col = 0; // visual column on screen + unsigned off; // offset in ScreenLines/ScreenAttrs + int c = 0; // init for GCC + long vcol = 0; // virtual column (for tabs) #ifdef FEAT_LINEBREAK - long vcol_sbr = -1; /* virtual column after showbreak */ -#endif - long vcol_prev = -1; /* "vcol" of previous character */ - char_u *line; /* current line */ - char_u *ptr; /* current position in "line" */ - int row; /* row in the window, excl w_winrow */ - int screen_row; /* row on the screen, incl w_winrow */ - - char_u extra[20]; /* "%ld" and 'fdc' must fit in here */ - int n_extra = 0; /* number of extra chars */ - char_u *p_extra = NULL; /* string of extra chars, plus NUL */ - char_u *p_extra_free = NULL; /* p_extra needs to be freed */ - int c_extra = NUL; /* extra chars, all the same */ - int c_final = NUL; /* final char, mandatory if set */ - int extra_attr = 0; /* attributes when n_extra != 0 */ - static char_u *at_end_str = (char_u *)""; /* used for p_extra when - displaying lcs_eol at end-of-line */ - int lcs_eol_one = lcs_eol; /* lcs_eol until it's been used */ - int lcs_prec_todo = lcs_prec; /* lcs_prec until it's been used */ - - /* saved "extra" items for when draw_state becomes WL_LINE (again) */ + long vcol_sbr = -1; // virtual column after showbreak +#endif + long vcol_prev = -1; // "vcol" of previous character + char_u *line; // current line + char_u *ptr; // current position in "line" + int row; // row in the window, excl w_winrow + int screen_row; // row on the screen, incl w_winrow + + char_u extra[21]; // "%ld " and 'fdc' must fit in here + int n_extra = 0; // number of extra chars + char_u *p_extra = NULL; // string of extra chars, plus NUL + char_u *p_extra_free = NULL; // p_extra needs to be freed + int c_extra = NUL; // extra chars, all the same + int c_final = NUL; // final char, mandatory if set + int extra_attr = 0; // attributes when n_extra != 0 + static char_u *at_end_str = (char_u *)""; // used for p_extra when + // displaying lcs_eol at end-of-line + int lcs_eol_one = lcs_eol; // lcs_eol until it's been used + int lcs_prec_todo = lcs_prec; // lcs_prec until it's been used + + // saved "extra" items for when draw_state becomes WL_LINE (again) int saved_n_extra = 0; char_u *saved_p_extra = NULL; int saved_c_extra = 0; diff --git a/src/testdir/gen_opt_test.vim b/src/testdir/gen_opt_test.vim index 74c725fb8b..22d7c8cdba 100644 --- a/src/testdir/gen_opt_test.vim +++ b/src/testdir/gen_opt_test.vim @@ -37,7 +37,7 @@ let test_values = { \ 'imstyle': [[0, 1], [-1, 2, 999]], \ 'lines': [[2, 24], [-1, 0, 1]], \ 'linespace': [[0, 2, 4], ['']], - \ 'numberwidth': [[1, 4, 8, 10], [-1, 0, 11]], + \ 'numberwidth': [[1, 4, 8, 10, 11, 20], [-1, 0, 21]], \ 'regexpengine': [[0, 1, 2], [-1, 3, 999]], \ 'report': [[0, 1, 2, 9999], [-1]], \ 'scroll': [[0, 1, 2, 20], [-1]], diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index e8eaef038f..cbe00840cb 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -245,7 +245,7 @@ func Test_set_errors() call assert_fails('set backupcopy=', 'E474:') call assert_fails('set regexpengine=3', 'E474:') call assert_fails('set history=10001', 'E474:') - call assert_fails('set numberwidth=11', 'E474:') + call assert_fails('set numberwidth=21', 'E474:') call assert_fails('set colorcolumn=-a') call assert_fails('set colorcolumn=a') call assert_fails('set colorcolumn=1,') diff --git a/src/version.c b/src/version.c index 2ba2bcae2a..8a9f34743e 100644 --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1614, +/**/ 1613, /**/ 1612, |