mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.1.1614: 'numberwidth' can only go up to 10
Problem: 'numberwidth' can only go up to 10. Solution: Allow up to 20. (Charlie Stanton, closes #4584)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
*options.txt* For Vim version 8.1. Last change: 2019 Jun 22
|
*options.txt* For Vim version 8.1. Last change: 2019 Jun 27
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -5385,7 +5385,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
rows in the window, depending on whether 'number' or 'relativenumber'
|
rows in the window, depending on whether 'number' or 'relativenumber'
|
||||||
is set. Thus with the Vim default of 4 there is room for a line number
|
is set. Thus with the Vim default of 4 there is room for a line number
|
||||||
up to 999. When the buffer has 1000 lines five columns will be used.
|
up to 999. When the buffer has 1000 lines five columns will be used.
|
||||||
The minimum value is 1, the maximum value is 10.
|
The minimum value is 1, the maximum value is 20.
|
||||||
NOTE: This option is set to the Vi default value when 'compatible' is
|
NOTE: This option is set to the Vi default value when 'compatible' is
|
||||||
set and to the Vim default value when 'compatible' is reset.
|
set and to the Vim default value when 'compatible' is reset.
|
||||||
|
|
||||||
@@ -8070,7 +8070,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
already.
|
already.
|
||||||
Additionally, if vim is compiled with the |+termresponse| feature and
|
Additionally, if vim is compiled with the |+termresponse| feature and
|
||||||
|t_RV| is set to the escape sequence to request the xterm version
|
|t_RV| is set to the escape sequence to request the xterm version
|
||||||
number, more intelligent detection process runs.
|
number, more intelligent detection is done.
|
||||||
The "xterm2" value will be set if the xterm version is reported to be
|
The "xterm2" value will be set if the xterm version is reported to be
|
||||||
from 95 to 276. The "sgr" value will be set if Vim detects Mac
|
from 95 to 276. The "sgr" value will be set if Vim detects Mac
|
||||||
Terminal.app, iTerm2 or mintty, and when the xterm version is 277 or
|
Terminal.app, iTerm2 or mintty, and when the xterm version is 277 or
|
||||||
|
@@ -9493,10 +9493,10 @@ set_num_option(
|
|||||||
errmsg = e_positive;
|
errmsg = e_positive;
|
||||||
curwin->w_p_nuw = 1;
|
curwin->w_p_nuw = 1;
|
||||||
}
|
}
|
||||||
if (curwin->w_p_nuw > 10)
|
if (curwin->w_p_nuw > 20)
|
||||||
{
|
{
|
||||||
errmsg = e_invarg;
|
errmsg = e_invarg;
|
||||||
curwin->w_p_nuw = 10;
|
curwin->w_p_nuw = 20;
|
||||||
}
|
}
|
||||||
curwin->w_nrwidth_line_count = 0; /* trigger a redraw */
|
curwin->w_nrwidth_line_count = 0; /* trigger a redraw */
|
||||||
}
|
}
|
||||||
|
44
src/screen.c
44
src/screen.c
@@ -3149,32 +3149,32 @@ win_line(
|
|||||||
int nochange UNUSED, // not updating for changed text
|
int nochange UNUSED, // not updating for changed text
|
||||||
int number_only) // only update the number column
|
int number_only) // only update the number column
|
||||||
{
|
{
|
||||||
int col = 0; /* visual column on screen */
|
int col = 0; // visual column on screen
|
||||||
unsigned off; /* offset in ScreenLines/ScreenAttrs */
|
unsigned off; // offset in ScreenLines/ScreenAttrs
|
||||||
int c = 0; /* init for GCC */
|
int c = 0; // init for GCC
|
||||||
long vcol = 0; /* virtual column (for tabs) */
|
long vcol = 0; // virtual column (for tabs)
|
||||||
#ifdef FEAT_LINEBREAK
|
#ifdef FEAT_LINEBREAK
|
||||||
long vcol_sbr = -1; /* virtual column after showbreak */
|
long vcol_sbr = -1; // virtual column after showbreak
|
||||||
#endif
|
#endif
|
||||||
long vcol_prev = -1; /* "vcol" of previous character */
|
long vcol_prev = -1; // "vcol" of previous character
|
||||||
char_u *line; /* current line */
|
char_u *line; // current line
|
||||||
char_u *ptr; /* current position in "line" */
|
char_u *ptr; // current position in "line"
|
||||||
int row; /* row in the window, excl w_winrow */
|
int row; // row in the window, excl w_winrow
|
||||||
int screen_row; /* row on the screen, incl w_winrow */
|
int screen_row; // row on the screen, incl w_winrow
|
||||||
|
|
||||||
char_u extra[20]; /* "%ld" and 'fdc' must fit in here */
|
char_u extra[21]; // "%ld " and 'fdc' must fit in here
|
||||||
int n_extra = 0; /* number of extra chars */
|
int n_extra = 0; // number of extra chars
|
||||||
char_u *p_extra = NULL; /* string of extra chars, plus NUL */
|
char_u *p_extra = NULL; // string of extra chars, plus NUL
|
||||||
char_u *p_extra_free = NULL; /* p_extra needs to be freed */
|
char_u *p_extra_free = NULL; // p_extra needs to be freed
|
||||||
int c_extra = NUL; /* extra chars, all the same */
|
int c_extra = NUL; // extra chars, all the same
|
||||||
int c_final = NUL; /* final char, mandatory if set */
|
int c_final = NUL; // final char, mandatory if set
|
||||||
int extra_attr = 0; /* attributes when n_extra != 0 */
|
int extra_attr = 0; // attributes when n_extra != 0
|
||||||
static char_u *at_end_str = (char_u *)""; /* used for p_extra when
|
static char_u *at_end_str = (char_u *)""; // used for p_extra when
|
||||||
displaying lcs_eol at end-of-line */
|
// displaying lcs_eol at end-of-line
|
||||||
int lcs_eol_one = lcs_eol; /* lcs_eol until it's been used */
|
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 */
|
int lcs_prec_todo = lcs_prec; // lcs_prec until it's been used
|
||||||
|
|
||||||
/* saved "extra" items for when draw_state becomes WL_LINE (again) */
|
// saved "extra" items for when draw_state becomes WL_LINE (again)
|
||||||
int saved_n_extra = 0;
|
int saved_n_extra = 0;
|
||||||
char_u *saved_p_extra = NULL;
|
char_u *saved_p_extra = NULL;
|
||||||
int saved_c_extra = 0;
|
int saved_c_extra = 0;
|
||||||
|
@@ -37,7 +37,7 @@ let test_values = {
|
|||||||
\ 'imstyle': [[0, 1], [-1, 2, 999]],
|
\ 'imstyle': [[0, 1], [-1, 2, 999]],
|
||||||
\ 'lines': [[2, 24], [-1, 0, 1]],
|
\ 'lines': [[2, 24], [-1, 0, 1]],
|
||||||
\ 'linespace': [[0, 2, 4], ['']],
|
\ '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]],
|
\ 'regexpengine': [[0, 1, 2], [-1, 3, 999]],
|
||||||
\ 'report': [[0, 1, 2, 9999], [-1]],
|
\ 'report': [[0, 1, 2, 9999], [-1]],
|
||||||
\ 'scroll': [[0, 1, 2, 20], [-1]],
|
\ 'scroll': [[0, 1, 2, 20], [-1]],
|
||||||
|
@@ -245,7 +245,7 @@ func Test_set_errors()
|
|||||||
call assert_fails('set backupcopy=', 'E474:')
|
call assert_fails('set backupcopy=', 'E474:')
|
||||||
call assert_fails('set regexpengine=3', 'E474:')
|
call assert_fails('set regexpengine=3', 'E474:')
|
||||||
call assert_fails('set history=10001', '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=a')
|
call assert_fails('set colorcolumn=a')
|
||||||
call assert_fails('set colorcolumn=1,')
|
call assert_fails('set colorcolumn=1,')
|
||||||
|
@@ -777,6 +777,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 */
|
||||||
|
/**/
|
||||||
|
1614,
|
||||||
/**/
|
/**/
|
||||||
1613,
|
1613,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user