From ed88ca75034a48916d165e88459c791c450df550 Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 23 Mar 2022 11:58:47 +0100 Subject: feat(input): enable /, /, / pairs unconditionally --- src/nvim/keymap.c | 3 +- src/nvim/option_defs.h | 1 - src/nvim/options.lua | 7 -- src/nvim/testdir/setup.vim | 1 - src/nvim/testdir/test_eval_stuff.vim | 2 +- src/nvim/testdir/test_regex_char_classes.vim | 104 +++++++++++++-------------- src/nvim/testdir/test_substitute.vim | 56 +++++++-------- 7 files changed, 82 insertions(+), 92 deletions(-) (limited to 'src') diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c index f0536cbf15..9ad9640834 100644 --- a/src/nvim/keymap.c +++ b/src/nvim/keymap.c @@ -13,7 +13,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/mouse.h" -#include "nvim/option_defs.h" #include "nvim/strings.h" #include "nvim/vim.h" @@ -748,7 +747,7 @@ static int extract_modifiers(int key, int *modp) if ((modifiers & MOD_MASK_CTRL) && ((key >= '?' && key <= '_') || ASCII_ISALPHA(key))) { key = TOUPPER_ASC(key); int new_key = Ctrl_chr(key); - if (!p_clbg || (new_key != TAB && new_key != CAR && new_key != ESC)) { + if (new_key != TAB && new_key != CAR && new_key != ESC) { key = new_key; modifiers &= ~MOD_MASK_CTRL; if (key == 0) { // is diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index b6946c4c4f..d88cd6b9b9 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -401,7 +401,6 @@ EXTERN int p_cst; // 'cscopetag' EXTERN long p_csto; // 'cscopetagorder' EXTERN long p_cspc; // 'cscopepathcomp' EXTERN int p_csverbose; // 'cscopeverbose' -EXTERN int p_clbg; // 'ctrldisambig' EXTERN char_u *p_debug; // 'debug' EXTERN char_u *p_def; // 'define' EXTERN char_u *p_inc; diff --git a/src/nvim/options.lua b/src/nvim/options.lua index d12d1d7c2c..e665ffd346 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -541,13 +541,6 @@ return { varname='p_csverbose', defaults={if_true=1} }, - { - full_name='ctrldisambig', abbreviation='clbg', - short_desc=N_(""), - type='bool', scope={'global'}, - varname='p_clbg', - defaults={if_true=true} - }, { full_name='cursorbind', abbreviation='crb', short_desc=N_("move cursor in window as it moves in other windows"), diff --git a/src/nvim/testdir/setup.vim b/src/nvim/testdir/setup.vim index 589ceb0297..15e3b31498 100644 --- a/src/nvim/testdir/setup.vim +++ b/src/nvim/testdir/setup.vim @@ -14,7 +14,6 @@ set fsync set laststatus=1 set listchars=eol:$ set joinspaces -set noctrldisambig set nohidden nosmarttab noautoindent noautoread complete-=i noruler noshowcmd set nrformats+=octal set shortmess-=F diff --git a/src/nvim/testdir/test_eval_stuff.vim b/src/nvim/testdir/test_eval_stuff.vim index 95eccde35c..12febfeb93 100644 --- a/src/nvim/testdir/test_eval_stuff.vim +++ b/src/nvim/testdir/test_eval_stuff.vim @@ -185,7 +185,7 @@ func Test_let_register() call Assert_reg('"', 'v', "abc", "['abc']", "abc", "['abc']") let @" = "abc\n" call Assert_reg('"', 'V', "abc\n", "['abc']", "abc\n", "['abc']") - let @" = "abc\" + let @" = "abc\r" call Assert_reg('"', 'V', "abc\r\n", "['abc\r']", "abc\r\n", "['abc\r']") let @= = '"abc"' call Assert_reg('=', 'v', "abc", "['abc']", '"abc"', "['\"abc\"']") diff --git a/src/nvim/testdir/test_regex_char_classes.vim b/src/nvim/testdir/test_regex_char_classes.vim index c1a4202c2b..b0d76a15e2 100644 --- a/src/nvim/testdir/test_regex_char_classes.vim +++ b/src/nvim/testdir/test_regex_char_classes.vim @@ -66,22 +66,22 @@ func Test_regex_char_classes() let save_enc = &encoding set encoding=utf-8 - let input = "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱" + let input = "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱" " Format is [cmd_to_run, expected_output] let tests = [ \ [':s/\%#=0\d//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1\d//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2\d//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[0-9]//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1[0-9]//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2[0-9]//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0\D//g', \ "0123456789"], \ [':s/\%#=1\D//g', @@ -95,17 +95,17 @@ func Test_regex_char_classes() \ [':s/\%#=2[^0-9]//g', \ "0123456789"], \ [':s/\%#=0\o//g', - \ "\t\\ !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1\o//g', - \ "\t\\ !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2\o//g', - \ "\t\\ !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[0-7]//g', - \ "\t\\ !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1[0-7]//g', - \ "\t\\ !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2[0-7]//g', - \ "\t\\ !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0\O//g', \ "01234567"], \ [':s/\%#=1\O//g', @@ -119,17 +119,17 @@ func Test_regex_char_classes() \ [':s/\%#=2[^0-7]//g', \ "01234567"], \ [':s/\%#=0\x//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1\x//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2\x//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[0-9A-Fa-f]//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1[0-9A-Fa-f]//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2[0-9A-Fa-f]//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0\X//g', \ "0123456789ABCDEFabcdef"], \ [':s/\%#=1\X//g', @@ -143,17 +143,17 @@ func Test_regex_char_classes() \ [':s/\%#=2[^0-9A-Fa-f]//g', \ "0123456789ABCDEFabcdef"], \ [':s/\%#=0\w//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1\w//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2\w//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[0-9A-Za-z_]//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1[0-9A-Za-z_]//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2[0-9A-Za-z_]//g', - \ "\t\\ !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0\W//g', \ "0123456789ABCDEFGHIXYZ_abcdefghiwxyz"], \ [':s/\%#=1\W//g', @@ -167,17 +167,17 @@ func Test_regex_char_classes() \ [':s/\%#=2[^0-9A-Za-z_]//g', \ "0123456789ABCDEFGHIXYZ_abcdefghiwxyz"], \ [':s/\%#=0\h//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1\h//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2\h//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[A-Za-z_]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1[A-Za-z_]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2[A-Za-z_]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0\H//g', \ "ABCDEFGHIXYZ_abcdefghiwxyz"], \ [':s/\%#=1\H//g', @@ -191,17 +191,17 @@ func Test_regex_char_classes() \ [':s/\%#=2[^A-Za-z_]//g', \ "ABCDEFGHIXYZ_abcdefghiwxyz"], \ [':s/\%#=0\a//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1\a//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2\a//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[A-Za-z]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1[A-Za-z]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2[A-Za-z]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0\A//g', \ "ABCDEFGHIXYZabcdefghiwxyz"], \ [':s/\%#=1\A//g', @@ -215,17 +215,17 @@ func Test_regex_char_classes() \ [':s/\%#=2[^A-Za-z]//g', \ "ABCDEFGHIXYZabcdefghiwxyz"], \ [':s/\%#=0\l//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1\l//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2\l//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[a-z]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1[a-z]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2[a-z]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0\L//g', \ "abcdefghiwxyz"], \ [':s/\%#=1\L//g', @@ -239,17 +239,17 @@ func Test_regex_char_classes() \ [':s/\%#=2[^a-z]//g', \ "abcdefghiwxyz"], \ [':s/\%#=0\u//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1\u//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2\u//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[A-Z]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1[A-Z]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2[A-Z]//g', - \ "\t\\ !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0\U//g', \ "ABCDEFGHIXYZ"], \ [':s/\%#=1\U//g', @@ -269,11 +269,11 @@ func Test_regex_char_classes() \ [':s/\%#=2\%' . line('.') . 'l^\t...//g', \ "!\"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[0-z]//g', - \ "\t\\ !\"#$%&'()#+'-./{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=1[0-z]//g', - \ "\t\\ !\"#$%&'()#+'-./{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=2[0-z]//g', - \ "\t\\ !\"#$%&'()#+'-./{|}~\\u0080\u0082\u0090\u009bΡ记娱"], + \ "\t\\r !\"#$%&'()#+'-./{|}~\\u0080\u0082\u0090\u009bΡ记娱"], \ [':s/\%#=0[^0-z]//g', \ "0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz"], \ [':s/\%#=1[^0-z]//g', diff --git a/src/nvim/testdir/test_substitute.vim b/src/nvim/testdir/test_substitute.vim index dbb792d2b0..9710a7ab84 100644 --- a/src/nvim/testdir/test_substitute.vim +++ b/src/nvim/testdir/test_substitute.vim @@ -177,9 +177,9 @@ func Test_sub_cmd_1() \ ['I', 's/I/\lII/', ['iI']], \ ['J', 's/J/\LJ\EJ/', ['jJ']], \ ['K', 's/K/\Uk\ek/', ['Kk']], - \ ['lLl', "s/L/\\/", ["l\", 'l']], + \ ['lLl', "s/L/\\r/", ["l\", 'l']], \ ['mMm', 's/M/\r/', ['m', 'm']], - \ ['nNn', "s/N/\\\\/", ["n\", 'n']], + \ ['nNn', "s/N/\\\\r/", ["n\", 'n']], \ ['oOo', 's/O/\n/', ["o\no"]], \ ['pPp', 's/P/\b/', ["p\p"]], \ ['qQq', 's/Q/\t/', ["q\tq"]], @@ -208,9 +208,9 @@ func Test_sub_cmd_2() \ ['I', 's/I/\lII/', ['iI']], \ ['J', 's/J/\LJ\EJ/', ['jJ']], \ ['K', 's/K/\Uk\ek/', ['Kk']], - \ ['lLl', "s/L/\\/", ["l\", 'l']], + \ ['lLl', "s/L/\\r/", ["l\", 'l']], \ ['mMm', 's/M/\r/', ['m', 'm']], - \ ['nNn', "s/N/\\\\/", ["n\", 'n']], + \ ['nNn', "s/N/\\\\r/", ["n\", 'n']], \ ['oOo', 's/O/\n/', ["o\no"]], \ ['pPp', 's/P/\b/', ["p\p"]], \ ['qQq', 's/Q/\t/', ["q\tq"]], @@ -230,9 +230,9 @@ func Test_sub_cmd_3() " List entry format: [input, cmd, output] let tests = [['aAa', "s/A/\\='\\'/", ['a\a']], \ ['bBb', "s/B/\\='\\\\'/", ['b\\b']], - \ ['cCc', "s/C/\\='\\'/", ["c\", 'c']], - \ ['dDd', "s/D/\\='\\\\'/", ["d\\\", 'd']], - \ ['eEe', "s/E/\\='\\\\\\'/", ["e\\\\\", 'e']], + \ ['cCc', "s/C/\\='\\r'/", ["c\", 'c']], + \ ['dDd', "s/D/\\='\\\\r'/", ["d\\\", 'd']], + \ ['eEe', "s/E/\\='\\\\\\r'/", ["e\\\\\", 'e']], \ ['fFf', "s/F/\\='\r'/", ['f', 'f']], \ ['gGg', "s/G/\\='\\'/", ["g\", 'g']], \ ['hHh', "s/H/\\='\\\\'/", ["h\\\", 'h']], @@ -254,11 +254,11 @@ func Test_sub_cmd_4() \ ['a\a']], \ ['bBb', "s/B/\\=substitute(submatch(0), '.', '\\', '')/", \ ['b\b']], - \ ['cCc', "s/C/\\=substitute(submatch(0), '.', '\\', '')/", + \ ['cCc', "s/C/\\=substitute(submatch(0), '.', '\\r', '')/", \ ["c\", 'c']], - \ ['dDd', "s/D/\\=substitute(submatch(0), '.', '\\\\', '')/", + \ ['dDd', "s/D/\\=substitute(submatch(0), '.', '\\\\r', '')/", \ ["d\", 'd']], - \ ['eEe', "s/E/\\=substitute(submatch(0), '.', '\\\\\\', '')/", + \ ['eEe', "s/E/\\=substitute(submatch(0), '.', '\\\\\\r', '')/", \ ["e\\\", 'e']], \ ['fFf', "s/F/\\=substitute(submatch(0), '.', '\\r', '')/", \ ['f', 'f']], @@ -316,7 +316,7 @@ func Test_sub_cmd_7() set cpo& " List entry format: [input, cmd, output] - let tests = [ ["A\\A", 's/A./\=submatch(0)/', ['A', 'A']], + let tests = [ ["A\\rA", 's/A./\=submatch(0)/', ['A', 'A']], \ ["B\\B", 's/B./\=submatch(0)/', ['B', 'B']], \ ["C\\C", 's/C./\=strtrans(string(submatch(0, 1)))/', [strtrans("['C\']C")]], \ ["D\\\nD", 's/D.\nD/\=strtrans(string(submatch(0, 1)))/', [strtrans("['D\', 'D']")]], @@ -467,11 +467,11 @@ func Test_sub_replace_1() call assert_equal('iI', substitute('I', 'I', '\lII', '')) call assert_equal('jJ', substitute('J', 'J', '\LJ\EJ', '')) call assert_equal('Kk', substitute('K', 'K', '\Uk\ek', '')) - call assert_equal("l\\l", - \ substitute('lLl', 'L', "\\", '')) - call assert_equal("m\m", substitute('mMm', 'M', '\r', '')) - call assert_equal("n\\n", - \ substitute('nNn', 'N', "\\\\", '')) + call assert_equal("l\\rl", + \ substitute('lLl', 'L', "\\r", '')) + call assert_equal("m\rm", substitute('mMm', 'M', '\r', '')) + call assert_equal("n\\rn", + \ substitute('nNn', 'N', "\\\\r", '')) call assert_equal("o\no", substitute('oOo', 'O', '\n', '')) call assert_equal("p\p", substitute('pPp', 'P', '\b', '')) call assert_equal("q\tq", substitute('qQq', 'Q', '\t', '')) @@ -480,7 +480,7 @@ func Test_sub_replace_1() call assert_equal("u\nu", substitute('uUu', 'U', "\n", '')) call assert_equal("v\v", substitute('vVv', 'V', "\b", '')) call assert_equal("w\\w", substitute('wWw', 'W', "\\", '')) - call assert_equal("x\x", substitute('xXx', 'X', "\r", '')) + call assert_equal("x\rx", substitute('xXx', 'X', "\r", '')) call assert_equal("YyyY", substitute('Y', 'Y', '\L\uyYy\l\EY', '')) call assert_equal("zZZz", substitute('Z', 'Z', '\U\lZzZ\u\Ez', '')) endfunc @@ -500,17 +500,17 @@ func Test_sub_replace_2() call assert_equal('iI', substitute('I', 'I', '\lII', '')) call assert_equal('jJ', substitute('J', 'J', '\LJ\EJ', '')) call assert_equal('Kk', substitute('K', 'K', '\Uk\ek', '')) - call assert_equal("l\\l", - \ substitute('lLl', 'L', "\\", '')) - call assert_equal("m\m", substitute('mMm', 'M', '\r', '')) - call assert_equal("n\\n", - \ substitute('nNn', 'N', "\\\\", '')) + call assert_equal("l\\rl", + \ substitute('lLl', 'L', "\\r", '')) + call assert_equal("m\rm", substitute('mMm', 'M', '\r', '')) + call assert_equal("n\\rn", + \ substitute('nNn', 'N', "\\\\r", '')) call assert_equal("o\no", substitute('oOo', 'O', '\n', '')) call assert_equal("p\p", substitute('pPp', 'P', '\b', '')) call assert_equal("q\tq", substitute('qQq', 'Q', '\t', '')) call assert_equal('r\r', substitute('rRr', 'R', '\\', '')) call assert_equal('scs', substitute('sSs', 'S', '\c', '')) - call assert_equal("t\t", substitute('tTt', 'T', "\r", '')) + call assert_equal("t\rt", substitute('tTt', 'T', "\r", '')) call assert_equal("u\nu", substitute('uUu', 'U', "\n", '')) call assert_equal("v\v", substitute('vVv', 'V', "\b", '')) call assert_equal('w\w', substitute('wWw', 'W', "\\", '')) @@ -528,7 +528,7 @@ func Test_sub_replace_3() call assert_equal("e\\\\\re", substitute('eEe', 'E', "\\=\"\\\\\\\\\r\"", '')) call assert_equal('f\rf', substitute('fFf', 'F', '\="\\r"', '')) call assert_equal('j\nj', substitute('jJj', 'J', '\="\\n"', '')) - call assert_equal("k\k", substitute('kKk', 'K', '\="\r"', '')) + call assert_equal("k\rk", substitute('kKk', 'K', '\="\r"', '')) call assert_equal("l\nl", substitute('lLl', 'L', '\="\n"', '')) endfunc @@ -540,10 +540,10 @@ func Test_sub_replace_4() \ '\=substitute(submatch(0), ".", "\\", "")', '')) call assert_equal('b\b', substitute('bBb', 'B', \ '\=substitute(submatch(0), ".", "\\\\", "")', '')) - call assert_equal("c\\c", substitute('cCc', 'C', '\=substitute(submatch(0), ".", "\\", "")', '')) - call assert_equal("d\\d", substitute('dDd', 'D', '\=substitute(submatch(0), ".", "\\\\", "")', '')) - call assert_equal("e\\\\e", substitute('eEe', 'E', '\=substitute(submatch(0), ".", "\\\\\\", "")', '')) - call assert_equal("f\f", substitute('fFf', 'F', '\=substitute(submatch(0), ".", "\\r", "")', '')) + call assert_equal("c\\rc", substitute('cCc', 'C', '\=substitute(submatch(0), ".", "\\r", "")', '')) + call assert_equal("d\\rd", substitute('dDd', 'D', '\=substitute(submatch(0), ".", "\\\\r", "")', '')) + call assert_equal("e\\\\re", substitute('eEe', 'E', '\=substitute(submatch(0), ".", "\\\\\\r", "")', '')) + call assert_equal("f\rf", substitute('fFf', 'F', '\=substitute(submatch(0), ".", "\\r", "")', '')) call assert_equal("j\nj", substitute('jJj', 'J', '\=substitute(submatch(0), ".", "\\n", "")', '')) call assert_equal("k\rk", substitute('kKk', 'K', '\=substitute(submatch(0), ".", "\r", "")', '')) call assert_equal("l\nl", substitute('lLl', 'L', '\=substitute(submatch(0), ".", "\n", "")', '')) -- cgit