Problem: 'ruler' is set in defaults.vim

Problem:  'ruler' is set in defaults.vim, but not enabled by default in
          non-compatible mode.
Solution: set the ruler option in non-compatible mode, remove it from
          defaults.vim, update tests

closes: #18260

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2025-09-15 18:40:57 +00:00
parent d4c2cb4b27
commit ba36510920
26 changed files with 397 additions and 18 deletions

View File

@ -1,7 +1,7 @@
" The default vimrc file.
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2025 Jul 13
" Last Change: 2025 Sep 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
"
" This is loaded if no vimrc file was found.
@ -33,8 +33,6 @@ silent! while 0
set nocompatible
silent! endwhile
set ruler " show the cursor position all the time
set ttimeout " time out for key codes
set ttimeoutlen=100 " wait up to 100ms after Esc for special key

View File

@ -2092,7 +2092,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'preserveindent'+ off don't preserve current indent structure
when changing it
'revins' + off no reverse insert
'ruler' + off no ruler
'ruler' & off no ruler
'scrolljump' + 1 no jump scroll
'scrolloff' + 0 no scroll offset
'shelltemp' - {unchanged} {set vim default only on resetting 'cp'}
@ -7134,7 +7134,7 @@ A jump table for the options with a short description can be found at |Q_op|.
security reasons.
*'ruler'* *'ru'* *'noruler'* *'noru'*
'ruler' 'ru' boolean (default off, set in |defaults.vim|)
'ruler' 'ru' boolean (Vim default: on, Vi default: off)
global
Show the line and column number of the cursor position, separated by a
comma. When there is room, the relative position of the displayed

View File

@ -1,4 +1,4 @@
*version9.txt* For Vim version 9.1. Last change: 2025 Sep 14
*version9.txt* For Vim version 9.1. Last change: 2025 Sep 15
VIM REFERENCE MANUAL by Bram Moolenaar
@ -41672,6 +41672,8 @@ Default values: ~
|defaults.vim|
- Improve the diff mode experience by updating the 'diffopt' default value to
"internal,filler,closeoff,indent-heuristic,inline:char".
- the 'ruler' option value is always enabled when using non-compatible mode
and removed from |defaults.vim|
Completion: ~
- allow to complete directories from 'cdpath' for |:cd| and similar commands,

View File

@ -2228,9 +2228,9 @@ static struct vimoption options[] =
{(char_u *)NULL, (char_u *)0L}
#endif
SCTX_INIT},
{"ruler", "ru", P_BOOL|P_VI_DEF|P_VIM|P_RSTAT,
{"ruler", "ru", P_BOOL|P_VIM|P_RSTAT,
(char_u *)&p_ru, PV_NONE, NULL, NULL,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
{(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT},
{"rulerformat", "ruf", P_STRING|P_VI_DEF|P_ALLOCED|P_RSTAT|P_MLE,
#ifdef FEAT_STL_OPT
(char_u *)&p_ruf, PV_NONE, did_set_rulerformat, NULL,

View File

@ -0,0 +1,8 @@
> +0&#ffffff0@74
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|<+0#0000000&|x@46|"| |0|L|,| |0|B| |0|,|0|-|1| @8|A|l@1|

View File

@ -0,0 +1,8 @@
> +0&#ffffff0@74
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|<+0#0000000&|x@36|"| |0|L|,| |0|B| @10|0|,|0|-|1| @8|A|l@1|

View File

@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|t+0#0000000&|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t
|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l
|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g|
>t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o|
|l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g
| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o
| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n
| @21|2|,|7|2|1| @8|2|0|%|

View File

@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|t+0#0000000&|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t
|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l
|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g|
|t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o|
>l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g
| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o
| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n
| @21|2|,|7|6|1| @8|2|0|%|

View File

@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|l+0#0000000&|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l
|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g|
|t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o|
|l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g
> |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o
| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n
|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| @20
@22|2|,|8|0|1| @8|2|0|%|

View File

@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|l+0#0000000&|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l
|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g|
|t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o|
|l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g
| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o
> |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n
|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| @20
@22|2|,|8|4|1| @8|2|0|%|

View File

@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|l+0#0000000&|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l
|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g|
|t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o|
|l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g
| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o
| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n
>g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| @20
@22|2|,|8@1|1| @8|2|0|%|

View File

@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2| +0#0000000&|l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o|
|l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g
| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o
| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n
|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| @20
>t|h|r|e@1| @34
|f|o|u|r| @35
@22|3|,|1| @10|3@1|%|

View File

@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|l+0#0000000&|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l
|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g|
|t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o|
|l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g
| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o
| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n
>g| |t|w|o| |l|o|n|g| |t|w|o| |l|o|n|g| @20
@22|2|,|8@1|1| @8|2|0|%|

View File

@ -0,0 +1,12 @@
| +0&#ffffff0@39
|[+1&&|N|o| |N|a|m|e|]| @12|0|,|0|-|1| @9|A|l@1
|l+0&&|i|n|e|1| @34
|l|i|n|e|2| @34
>l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3
|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3
|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3| @19
|l|i|n|e|4| @34
|~+0#4040ff13&| @38
|~| @38
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @8|3|,|1| @11|A|l@1
| +0&&@39

View File

@ -0,0 +1,20 @@
> +0&#ffffff0@59
|~+0#4040ff13&| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|[+3#0000000&|N|o| |N|a|m|e|]| @32|0|,|0|-|1| @9|A|l@1
|<+0#4040ff13&@2| +0#af5f00255&|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
| +0#af5f00255&|1|0| ||+0#0000000&@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
| +0#af5f00255&@3|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
| +0#af5f00255&|1@1| ||+0#0000000&@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
| +0#af5f00255&@3|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
|[+1&&|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @26|1@1|,|1| @10|B|o|t
| +0&&@59

View File

@ -0,0 +1,20 @@
> +0&#ffffff0@59
|~+0#4040ff13&| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|[+3#0000000&|N|o| |N|a|m|e|]| @32|0|,|0|-|1| @9|A|l@1
| +0#af5f00255&@1|1| | +0#0000000&@55
|~+0#4040ff13&| @58
|~| @58
|~| @58
|~| @58
|[+1#0000000&|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @26|0|,|0|-|1| @9|A|l@1
|:+0&&|c|a|l@1| |s|e|t|q|f|l|i|s|t|(|[|]|,| |'|r|'|)| @35

View File

@ -0,0 +1,20 @@
> +0&#ffffff0@59
|~+0#4040ff13&| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|[+3#0000000&|N|o| |N|a|m|e|]| @32|0|,|0|-|1| @9|A|l@1
| +0#af5f00255&@1|1| ||+0#0000000#ffff4012@1| |f|o@1| @49
| +0#af5f00255#ffffff0@1|2| ||+0#0000000&@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
| +0#af5f00255&@3|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
| +0#af5f00255&@1|3| ||+0#0000000&@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
| +0#af5f00255&@3|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
|[+1&&|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @26|1|,|1| @11|T|o|p
|:+0&&|c|a|l@1| |s|e|t|q|f|l|i|s|t|(|g|:|l|,| |'|r|'|)| @34

View File

@ -0,0 +1,20 @@
> +0&#ffffff0@59
|~+0#4040ff13&| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|[+3#0000000&|N|o| |N|a|m|e|]| @32|0|,|0|-|1| @9|A|l@1
| +0#af5f00255&@1|1| ||+0#0000000#ffff4012@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
| +0#af5f00255#ffffff0@3|2+0#0000000#ffff4012|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| |3|0| |3|1| |3|2| |3@1| |3|4| |3|5| |3|6| |3|7| |3|8| |3|9
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|4|0| |4|1| |4|2| |4|3| |4@1| |4|5| |4|6| |4|7| |4|8| |4|9| |5|0| |5|1| |5|2| |5|3| |5|4| |5@1| |5|6| |5|7| |5
| +0#af5f00255#ffffff0@3|8+0#0000000#ffff4012| |5|9| |6|0| |6|1| |6|2| |6|3| |6|4| |6|5| |6@1| |6|7| |6|8| |6|9| |7|0| |7|1| |7|2| |7|3| |7|4| |7|5| |7|6|
| +0#af5f00255#ffffff0@3|7+0#0000000#ffff4012@1| |7|8| |7|9| |8|0| |8|1| |8|2| |8|3| |8|4| |8|5| |8|6| |8|7| |8@1| |8|9| |9|0| |9|1| |9|2| |9|3| |9|4| |9|5
|[+1&#ffffff0|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @26|1|,|1| @11|A|l@1
|:+0&&|c|a|l@1| |s|e|t|q|f|l|i|s|t|(|g|:|l|1|,| |'|r|'|)| @33

View File

@ -0,0 +1,20 @@
> +0&#ffffff0@59
|~+0#4040ff13&| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|~| @58
|[+3#0000000&|N|o| |N|a|m|e|]| @32|0|,|0|-|1| @9|A|l@1
|<+0#4040ff13&@2| +0#af5f00255&| +0#0000000#ffff4012|9|3|7| |9|3|8| |9|3|9| |9|4|0| |9|4|1| |9|4|2| |9|4|3| |9|4@1| |9|4|5| |9|4|6| |9|4|7| |9|4|8| |9|4|9| |9|5|0
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|9|5|1| |9|5|2| |9|5|3| |9|5|4| |9|5@1| |9|5|6| |9|5|7| |9|5|8| |9|5|9| |9|6|0| |9|6|1| |9|6|2| |9|6|3| |9|6|4
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|9|6|5| |9|6@1| |9|6|7| |9|6|8| |9|6|9| |9|7|0| |9|7|1| |9|7|2| |9|7|3| |9|7|4| |9|7|5| |9|7|6| |9|7@1| |9|7|8
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|9|7|9| |9|8|0| |9|8|1| |9|8|2| |9|8|3| |9|8|4| |9|8|5| |9|8|6| |9|8|7| |9|8@1| |9|8|9| |9@1|0| |9@1|1| |9@1|2
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|9@1|3| |9@1|4| |9@1|5| |9@1|6| |9@1|7| |9@1|8| |9@2| @27
|[+1&#ffffff0|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @26|1|,|3|8|9|2| @8|A|l@1
|:+0&&|c|a|l@1| |s|e|t|q|f|l|i|s|t|(|g|:|l|1|,| |'|r|'|)| @33

View File

@ -0,0 +1,9 @@
|<+0#4040ff13#ffffff0@2|e+0#0000000&|r|y| |l|o|n|g| |l|i|n|e| |.@2|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2
|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2
|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2
|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2
|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2
|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2|A| |v|e|r|y| |l|o|n|g| |l|i|n|e| |.@2
|1|2|3|4|5|6|7|8|9| @30
> @39
@22|7|,|1| @10|B|o|t|

View File

@ -0,0 +1,19 @@
| +0#af5f00255#ffffff0||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
|@+0#4040ff13&||+1#0000000&| +0&&@72
>@+0#4040ff13&||+1#0000000&| +0&&@72
|<+3&&| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @41|2|,|0|-|1| @9|T|o|p
| +0&&@74

View File

@ -2462,7 +2462,10 @@ func Test_BufReadCmd()
call writefile(['one', 'two', 'three'], 'Xcmd.test', 'D')
edit Xcmd.test
set noruler
call assert_match('Xcmd.test" line 1 of 3', execute('file'))
set ruler
call assert_match('Xcmd.test" 3 lines --33%--', execute('file'))
normal! Gofour
write
call assert_equal(['one', 'two', 'three', 'four'], readfile('Xcmd.test'))

View File

@ -184,13 +184,30 @@ func Test_edit_long_file_name()
let longName = 'x'->repeat(min([&columns, 255]))
call writefile([], longName, 'D')
let buf = RunVimInTerminal('-N -u NONE --cmd ":set noshowcmd" ' .. longName, #{rows: 8})
let buf = RunVimInTerminal('-N -u NONE --cmd ":set noshowcmd noruler" ' .. longName, #{rows: 8})
call VerifyScreenDump(buf, 'Test_long_file_name_1', {})
call term_sendkeys(buf, ":set showcmd\<cr>:e!\<cr>")
call VerifyScreenDump(buf, 'Test_long_file_name_2', {})
" clean up
call StopVimInTerminal(buf)
set ruler&vim
endfunc
func Test_edit_long_file_name_with_ruler()
CheckScreendump
let longName = 'x'->repeat(min([&columns, 255]))
call writefile([], longName, 'D')
let buf = RunVimInTerminal('-N -u NONE --cmd ":set noshowcmd" ' .. longName, #{rows: 8})
call VerifyScreenDump(buf, 'Test_long_file_name_3', {})
call term_sendkeys(buf, ":set showcmd\<cr>:e!\<cr>")
call VerifyScreenDump(buf, 'Test_long_file_name_4', {})
" clean up
call StopVimInTerminal(buf)
endfunc

View File

@ -165,6 +165,7 @@ func Test_register_one()
endfunc
func Test_recording_status_in_ex_line()
set noruler
norm qx
redraw!
call assert_equal('recording @x', Screenline(&lines))
@ -175,6 +176,17 @@ func Test_recording_status_in_ex_line()
norm q
redraw!
call assert_equal('', Screenline(&lines))
set ruler
norm qx
redraw!
call assert_match('recording @x\s*0,0-1\s*All', Screenline(&lines))
set shortmess=q
redraw!
call assert_match('recording\s*0,0-1\s*All', Screenline(&lines))
set shortmess&
norm q
redraw!
call assert_match('\s*0,0-1\s*All', Screenline(&lines))
endfunc
" Check that replaying a typed sequence does not use an Esc and following

View File

@ -950,10 +950,11 @@ func Test_smoothscroll_multi_skipcol()
endfunc
" this was dividing by zero bug in scroll_cursor_bot
func Test_smoothscroll_zero_width_scroll_cursor_bot()
func Test_smoothscroll_zero_width_scroll_cursor_bot_noruler()
CheckScreendump
let lines =<< trim END
set noruler
silent normal yy
silent normal 19p
set cpoptions+=n
@ -971,12 +972,34 @@ func Test_smoothscroll_zero_width_scroll_cursor_bot()
call StopVimInTerminal(buf)
endfunc
" scroll_cursor_top() should reset skipcol when it changes topline
func Test_smoothscroll_cursor_top()
func Test_smoothscroll_zero_width_scroll_cursor_bot_ruler()
CheckScreendump
let lines =<< trim END
set smoothscroll scrolloff=2
set ruler
silent normal yy
silent normal 19p
set cpoptions+=n
vsplit
vertical resize 0
set foldcolumn=1
set number
set smoothscroll
silent normal 20G
END
call writefile(lines, 'XSmoothScrollZeroBot', 'D')
let buf = RunVimInTerminal('-u NONE -S XSmoothScrollZeroBot', #{rows: 19})
call VerifyScreenDump(buf, 'Test_smoothscroll_zero_bot_ruler', {})
call StopVimInTerminal(buf)
endfunc
" scroll_cursor_top() should reset skipcol when it changes topline
func Test_smoothscroll_cursor_top_noruler()
CheckScreendump
let lines =<< trim END
set smoothscroll scrolloff=2 noruler
new | 11resize | wincmd j
call setline(1, ['line1', 'line2', 'line3'->repeat(20), 'line4'])
exe "norm G3\<C-E>k"
@ -988,6 +1011,22 @@ func Test_smoothscroll_cursor_top()
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_cursor_top_ruler()
CheckScreendump
let lines =<< trim END
set smoothscroll scrolloff=2 ruler
new | 11resize | wincmd j
call setline(1, ['line1', 'line2', 'line3'->repeat(20), 'line4'])
exe "norm G3\<C-E>k"
END
call writefile(lines, 'XSmoothScrollCursorTop', 'D')
let buf = RunVimInTerminal('-u NONE -S XSmoothScrollCursorTop', #{rows: 12, cols: 40})
call VerifyScreenDump(buf, 'Test_smoothscroll_cursor_ru_top', {})
call StopVimInTerminal(buf)
endfunc
" Division by zero, shouldn't crash
func Test_smoothscroll_crash()
CheckScreendump
@ -1007,12 +1046,12 @@ func Test_smoothscroll_crash()
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_insert_bottom()
func Test_smoothscroll_insert_bottom_noruler()
CheckScreendump
let lines =<< trim END
call setline(1, repeat([repeat('A very long line ...', 10)], 5))
set wrap smoothscroll scrolloff=0
set wrap smoothscroll scrolloff=0 noruler
END
call writefile(lines, 'XSmoothScrollInsertBottom', 'D')
let buf = RunVimInTerminal('-u NONE -S XSmoothScrollInsertBottom', #{rows: 9, cols: 40})
@ -1022,12 +1061,27 @@ func Test_smoothscroll_insert_bottom()
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_in_qf_window()
func Test_smoothscroll_insert_bottom_ruler()
CheckScreendump
let lines =<< trim END
call setline(1, repeat([repeat('A very long line ...', 10)], 5))
set wrap smoothscroll scrolloff=0 ruler
END
call writefile(lines, 'XSmoothScrollInsertBottom', 'D')
let buf = RunVimInTerminal('-u NONE -S XSmoothScrollInsertBottom', #{rows: 9, cols: 40})
call term_sendkeys(buf, "Go123456789\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_insert_bottom_ruler', {})
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_in_qf_window_noruler()
CheckFeature quickfix
CheckScreendump
let lines =<< trim END
set nocompatible display=lastline
set nocompatible display=lastline noruler
copen 5
setlocal number smoothscroll
let g:l = [{'text': 'foo'}] + repeat([{'text': join(range(30))}], 10)
@ -1067,6 +1121,51 @@ func Test_smoothscroll_in_qf_window()
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_in_qf_window_ruler()
CheckFeature quickfix
CheckScreendump
let lines =<< trim END
set nocompatible display=lastline ruler
copen 5
setlocal number smoothscroll
let g:l = [{'text': 'foo'}] + repeat([{'text': join(range(30))}], 10)
call setqflist(g:l, 'r')
normal! G
wincmd t
let g:l1 = [{'text': join(range(1000))}]
END
call writefile(lines, 'XSmoothScrollInQfWindow', 'D')
let buf = RunVimInTerminal('-u NONE -S XSmoothScrollInQfWindow', #{rows: 20, cols: 60})
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_ru_1', {})
call term_sendkeys(buf, ":call setqflist([], 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_ru_2', {})
call term_sendkeys(buf, ":call setqflist(g:l, 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_ru_3', {})
call term_sendkeys(buf, ":call setqflist(g:l1, 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_ru_4', {})
call term_sendkeys(buf, "\<C-W>b$\<C-W>t")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_ru_5', {})
call term_sendkeys(buf, ":call setqflist([], 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_ru_2', {})
call term_sendkeys(buf, ":call setqflist(g:l1, 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_ru_4', {})
call term_sendkeys(buf, "\<C-W>b$\<C-W>t")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_ru_5', {})
call term_sendkeys(buf, ":call setqflist(g:l, 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_ru_3', {})
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_in_zero_width_window()
set cpo+=n number smoothscroll
set winwidth=99999 winminwidth=0
@ -1214,11 +1313,12 @@ func Test_smoothscroll_long_line_zb()
bwipe!
endfunc
func Test_smooth_long_scrolloff()
func Test_smooth_long_scrolloff_noruler()
CheckScreendump
let lines =<< trim END
set smoothscroll scrolloff=3
set noruler
call setline(1, ['one', 'two long '->repeat(100), 'three', 'four', 'five', 'six'])
END
call writefile(lines, 'XSmoothLongScrolloff', 'D')
@ -1247,6 +1347,39 @@ func Test_smooth_long_scrolloff()
call StopVimInTerminal(buf)
endfunc
func Test_smooth_long_scrolloff_ruler()
CheckScreendump
let lines =<< trim END
set smoothscroll scrolloff=3 ruler
call setline(1, ['one', 'two long '->repeat(100), 'three', 'four', 'five', 'six'])
END
call writefile(lines, 'XSmoothLongScrolloff', 'D')
let buf = RunVimInTerminal('-u NONE -S XSmoothLongScrolloff', #{rows: 8, cols: 40})
call term_sendkeys(buf, ":norm j721|\<CR>")
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_ru_1', {})
call term_sendkeys(buf, "gj")
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_ru_2', {})
call term_sendkeys(buf, "gj")
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_ru_3', {})
call term_sendkeys(buf, "gj")
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_ru_4', {})
call term_sendkeys(buf, "gj")
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_ru_5', {})
call term_sendkeys(buf, "gj")
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_ru_6', {})
call term_sendkeys(buf, "gk")
call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_ru_7', {})
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_listchars_eol()
call NewWindow(10, 40)
setlocal list listchars=eol:$ scrolloff=0 smoothscroll

View File

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