aboutsummaryrefslogtreecommitdiff
path: root/src/nvim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-12-16 22:16:30 -0800
committerGitHub <noreply@github.com>2019-12-16 22:16:30 -0800
commit1bfccf028673173dd9958930e165e595f36e4601 (patch)
tree50109ae8d954b84f1d6f4f2bb31d376917c4a72e /src/nvim
parent3de1bc4bf9bd530fbeff74174d4e0ba82f92e9e4 (diff)
parent9e6ebed6f4c695cfa00710e003d606d5d720b542 (diff)
downloadrneovim-1bfccf028673173dd9958930e165e595f36e4601.tar.gz
rneovim-1bfccf028673173dd9958930e165e595f36e4601.tar.bz2
rneovim-1bfccf028673173dd9958930e165e595f36e4601.zip
Merge #11556 from janlazo/vim-8.2.0002
vim-patch:8.2.{2,8,10,12,13}
Diffstat (limited to 'src/nvim')
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/ex_cmds_defs.h91
-rw-r--r--src/nvim/ex_docmd.c18
-rw-r--r--src/nvim/ex_eval.c35
-rw-r--r--src/nvim/ex_eval.h44
-rw-r--r--src/nvim/normal.c4
-rw-r--r--src/nvim/testdir/Makefile1
-rw-r--r--src/nvim/testdir/test64.in654
-rw-r--r--src/nvim/testdir/test64.ok1107
-rw-r--r--src/nvim/testdir/test_fold.vim25
-rw-r--r--src/nvim/testdir/test_regexp_latin.vim668
-rw-r--r--src/nvim/testdir/test_undo.vim241
12 files changed, 1029 insertions, 1861 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 4c76b1b2e8..902d68dcf9 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -23652,7 +23652,7 @@ void ex_return(exarg_T *eap)
int do_return(exarg_T *eap, int reanimate, int is_cmd, void *rettv)
{
int idx;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
if (reanimate)
/* Undo the return. */
diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h
index 3a9fd01dd9..4a40cc54b4 100644
--- a/src/nvim/ex_cmds_defs.h
+++ b/src/nvim/ex_cmds_defs.h
@@ -12,31 +12,29 @@
# include "ex_cmds_enum.generated.h"
#endif
-/*
- * When adding an Ex command:
- * 1. Add an entry to the table in src/nvim/ex_cmds.lua. Keep it sorted on the
- * shortest version of the command name that works. If it doesn't start with
- * a lower case letter, add it at the end.
- *
- * Each table entry is a table with the following keys:
- *
- * Key | Description
- * ------- | -------------------------------------------------------------
- * command | Name of the command. Required.
- * enum | Name of the enum entry. If not set defaults to CMD_{command}.
- * flags | A set of the flags from below list joined by bitwise or.
- * func | Name of the function containing the implementation.
- *
- * Referenced function should be either non-static one or defined in
- * ex_docmd.c and be coercible to ex_func_T type from below.
- *
- * All keys not described in the above table are reserved for future use.
- *
- * 2. Add a "case: CMD_xxx" in the big switch in ex_docmd.c.
- * 3. Add an entry in the index for Ex commands at ":help ex-cmd-index".
- * 4. Add documentation in ../doc/xxx.txt. Add a tag for both the short and
- * long name of the command.
- */
+// When adding an Ex command:
+// 1. Add an entry to the table in src/nvim/ex_cmds.lua. Keep it sorted on the
+// shortest version of the command name that works. If it doesn't start with
+// a lower case letter, add it at the end.
+//
+// Each table entry is a table with the following keys:
+//
+// Key | Description
+// ------- | -------------------------------------------------------------
+// command | Name of the command. Required.
+// enum | Name of the enum entry. If not set defaults to CMD_{command}.
+// flags | A set of the flags from below list joined by bitwise or.
+// func | Name of the function containing the implementation.
+//
+// Referenced function should be either non-static one or defined in
+// ex_docmd.c and be coercible to ex_func_T type from below.
+//
+// All keys not described in the above table are reserved for future use.
+//
+// 2. Add a "case: CMD_xxx" in the big switch in ex_docmd.c.
+// 3. Add an entry in the index for Ex commands at ":help ex-cmd-index".
+// 4. Add documentation in ../doc/xxx.txt. Add a tag for both the short and
+// long name of the command.
#define RANGE 0x001 /* allow a linespecs */
#define BANG 0x002 /* allow a ! after the command name */
@@ -98,6 +96,47 @@ typedef struct cmdname {
int cmd_addr_type; ///< Flag for address type
} CommandDefinition;
+// A list used for saving values of "emsg_silent". Used by ex_try() to save the
+// value of "emsg_silent" if it was non-zero. When this is done, the CSF_SILENT
+// flag below is set.
+typedef struct eslist_elem eslist_T;
+struct eslist_elem {
+ int saved_emsg_silent; // saved value of "emsg_silent"
+ eslist_T *next; // next element on the list
+};
+
+// For conditional commands a stack is kept of nested conditionals.
+// When cs_idx < 0, there is no conditional command.
+enum {
+ CSTACK_LEN = 50,
+};
+
+typedef struct {
+ int cs_flags[CSTACK_LEN]; // CSF_ flags
+ char cs_pending[CSTACK_LEN]; // CSTP_: what's pending in ":finally"
+ union {
+ void *csp_rv[CSTACK_LEN]; // return typeval for pending return
+ void *csp_ex[CSTACK_LEN]; // exception for pending throw
+ } cs_pend;
+ void *cs_forinfo[CSTACK_LEN]; // info used by ":for"
+ int cs_line[CSTACK_LEN]; // line nr of ":while"/":for" line
+ int cs_idx; // current entry, or -1 if none
+ int cs_looplevel; // nr of nested ":while"s and ":for"s
+ int cs_trylevel; // nr of nested ":try"s
+ eslist_T *cs_emsg_silent_list; // saved values of "emsg_silent"
+ int cs_lflags; // loop flags: CSL_ flags
+} cstack_T;
+# define cs_rettv cs_pend.csp_rv
+# define cs_exception cs_pend.csp_ex
+
+// Flags for the cs_lflags item in cstack_T.
+enum {
+ CSL_HAD_LOOP = 1, // just found ":while" or ":for"
+ CSL_HAD_ENDLOOP = 2, // just found ":endwhile" or ":endfor"
+ CSL_HAD_CONT = 4, // just found ":continue"
+ CSL_HAD_FINA = 8, // just found ":finally"
+};
+
/// Arguments used for Ex commands.
struct exarg {
char_u *arg; ///< argument of the command
@@ -128,7 +167,7 @@ struct exarg {
char_u *errmsg; ///< returned error message
LineGetter getline; ///< Function used to get the next line
void *cookie; ///< argument for getline()
- struct condstack *cstack; ///< condition stack for ":if" etc.
+ cstack_T *cstack; ///< condition stack for ":if" etc.
};
#define FORCE_BIN 1 // ":edit ++bin file"
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 30c1373445..d16ad9db2c 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -325,13 +325,13 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
int count = 0; /* line number count */
int did_inc = FALSE; /* incremented RedrawingDisabled */
int retval = OK;
- struct condstack cstack; /* conditional stack */
- garray_T lines_ga; /* keep lines for ":while"/":for" */
- int current_line = 0; /* active line in lines_ga */
- char_u *fname = NULL; /* function or script name */
- linenr_T *breakpoint = NULL; /* ptr to breakpoint field in cookie */
- int *dbg_tick = NULL; /* ptr to dbg_tick field in cookie */
- struct dbg_stuff debug_saved; /* saved things for debug mode */
+ cstack_T cstack; // conditional stack
+ garray_T lines_ga; // keep lines for ":while"/":for"
+ int current_line = 0; // active line in lines_ga
+ char_u *fname = NULL; // function or script name
+ linenr_T *breakpoint = NULL; // ptr to breakpoint field in cookie
+ int *dbg_tick = NULL; // ptr to dbg_tick field in cookie
+ struct dbg_stuff debug_saved; // saved things for debug mode
int initial_trylevel;
struct msglist **saved_msg_list = NULL;
struct msglist *private_msg_list;
@@ -361,7 +361,7 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
EMSG(_("E169: Command too recursive"));
// When converting to an exception, we do not include the command name
// since this is not an error of the specific command.
- do_errthrow((struct condstack *)NULL, (char_u *)NULL);
+ do_errthrow((cstack_T *)NULL, (char_u *)NULL);
msg_list = saved_msg_list;
return FAIL;
}
@@ -1545,7 +1545,7 @@ static bool parse_one_cmd(
*/
static char_u * do_one_cmd(char_u **cmdlinep,
int flags,
- struct condstack *cstack,
+ cstack_T *cstack,
LineGetter fgetline,
void *cookie /* argument for fgetline() */
)
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c
index 28bc222827..f70a568e4a 100644
--- a/src/nvim/ex_eval.c
+++ b/src/nvim/ex_eval.c
@@ -307,7 +307,7 @@ void free_global_msglist(void)
* error exception. If cstack is NULL, postpone the throw until do_cmdline()
* has returned (see do_one_cmd()).
*/
-void do_errthrow(struct condstack *cstack, char_u *cmdname)
+void do_errthrow(cstack_T *cstack, char_u *cmdname)
{
/*
* Ensure that all commands in nested function calls and sourced files
@@ -339,7 +339,7 @@ void do_errthrow(struct condstack *cstack, char_u *cmdname)
* exception if appropriate. Return TRUE if the current exception is discarded,
* FALSE otherwise.
*/
-int do_intthrow(struct condstack *cstack)
+int do_intthrow(cstack_T *cstack)
{
// If no interrupt occurred or no try conditional is active and no exception
// is being thrown, do nothing (for compatibility of non-EH scripts).
@@ -795,7 +795,7 @@ void ex_if(exarg_T *eap)
{
int skip;
int result;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
if (cstack->cs_idx == CSTACK_LEN - 1)
eap->errmsg = (char_u *)N_("E579: :if nesting too deep");
@@ -852,7 +852,7 @@ void ex_else(exarg_T *eap)
{
int skip;
int result;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
skip = CHECK_SKIP;
@@ -926,7 +926,7 @@ void ex_while(exarg_T *eap)
bool error;
int skip;
int result;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
if (cstack->cs_idx == CSTACK_LEN - 1)
eap->errmsg = (char_u *)N_("E585: :while/:for nesting too deep");
@@ -1005,7 +1005,7 @@ void ex_while(exarg_T *eap)
void ex_continue(exarg_T *eap)
{
int idx;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = (char_u *)N_("E586: :continue without :while or :for");
@@ -1039,7 +1039,7 @@ void ex_continue(exarg_T *eap)
void ex_break(exarg_T *eap)
{
int idx;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
if (cstack->cs_looplevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = (char_u *)N_("E587: :break without :while or :for");
@@ -1061,7 +1061,7 @@ void ex_break(exarg_T *eap)
*/
void ex_endwhile(exarg_T *eap)
{
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
int idx;
char_u *err;
int csf;
@@ -1164,7 +1164,7 @@ void ex_throw(exarg_T *eap)
* for ":throw" (user exception) and error and interrupt exceptions. Also
* used for rethrowing an uncaught exception.
*/
-void do_throw(struct condstack *cstack)
+void do_throw(cstack_T *cstack)
{
int idx;
int inactivate_try = FALSE;
@@ -1225,7 +1225,7 @@ void do_throw(struct condstack *cstack)
void ex_try(exarg_T *eap)
{
int skip;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
if (cstack->cs_idx == CSTACK_LEN - 1)
eap->errmsg = (char_u *)N_("E601: :try nesting too deep");
@@ -1260,7 +1260,7 @@ void ex_try(exarg_T *eap)
* to save the value.
*/
if (emsg_silent) {
- eslist_T *elem = xmalloc(sizeof(struct eslist_elem));
+ eslist_T *elem = xmalloc(sizeof(*elem));
elem->saved_emsg_silent = emsg_silent;
elem->next = cstack->cs_emsg_silent_list;
cstack->cs_emsg_silent_list = elem;
@@ -1286,7 +1286,7 @@ void ex_catch(exarg_T *eap)
char_u *save_cpo;
regmatch_T regmatch;
int prev_got_int;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
char_u *pat;
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) {
@@ -1432,7 +1432,7 @@ void ex_finally(exarg_T *eap)
int idx;
int skip = FALSE;
int pending = CSTP_NONE;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = (char_u *)N_("E606: :finally without :try");
@@ -1555,7 +1555,7 @@ void ex_endtry(exarg_T *eap)
int rethrow = FALSE;
int pending = CSTP_NONE;
void *rettv = NULL;
- struct condstack *cstack = eap->cstack;
+ cstack_T *const cstack = eap->cstack;
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) {
eap->errmsg = (char_u *)N_("E602: :endtry without :try");
@@ -1882,7 +1882,7 @@ void leave_cleanup(cleanup_T *csp)
* entered, is restored (used by ex_endtry()). This is normally done only
* when such a try conditional is left.
*/
-int cleanup_conditionals(struct condstack *cstack, int searched_cond, int inclusive)
+int cleanup_conditionals(cstack_T *cstack, int searched_cond, int inclusive)
{
int idx;
int stop = FALSE;
@@ -1990,7 +1990,7 @@ int cleanup_conditionals(struct condstack *cstack, int searched_cond, int inclus
/*
* Return an appropriate error message for a missing endwhile/endfor/endif.
*/
-static char_u *get_end_emsg(struct condstack *cstack)
+static char_u *get_end_emsg(cstack_T *cstack)
{
if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
return e_endwhile;
@@ -2007,7 +2007,8 @@ static char_u *get_end_emsg(struct condstack *cstack)
* type.
* Also free "for info" structures where needed.
*/
-void rewind_conditionals(struct condstack *cstack, int idx, int cond_type, int *cond_level)
+void rewind_conditionals(cstack_T *cstack, int idx, int cond_type,
+ int *cond_level)
{
while (cstack->cs_idx > idx) {
if (cstack->cs_flags[cstack->cs_idx] & cond_type)
diff --git a/src/nvim/ex_eval.h b/src/nvim/ex_eval.h
index 2237b6aca3..d8388c9156 100644
--- a/src/nvim/ex_eval.h
+++ b/src/nvim/ex_eval.h
@@ -4,42 +4,6 @@
#include "nvim/pos.h" // for linenr_T
#include "nvim/ex_cmds_defs.h" // for exarg_T
-/*
- * A list used for saving values of "emsg_silent". Used by ex_try() to save the
- * value of "emsg_silent" if it was non-zero. When this is done, the CSF_SILENT
- * flag below is set.
- */
-
-typedef struct eslist_elem eslist_T;
-struct eslist_elem {
- int saved_emsg_silent; /* saved value of "emsg_silent" */
- eslist_T *next; /* next element on the list */
-};
-
-/*
- * For conditional commands a stack is kept of nested conditionals.
- * When cs_idx < 0, there is no conditional command.
- */
-#define CSTACK_LEN 50
-
-struct condstack {
- int cs_flags[CSTACK_LEN]; // CSF_ flags
- char cs_pending[CSTACK_LEN]; // CSTP_: what's pending in ":finally"
- union {
- void *csp_rv[CSTACK_LEN]; // return typeval for pending return
- void *csp_ex[CSTACK_LEN]; // exception for pending throw
- } cs_pend;
- void *cs_forinfo[CSTACK_LEN]; // info used by ":for"
- int cs_line[CSTACK_LEN]; // line nr of ":while"/":for" line
- int cs_idx; // current entry, or -1 if none
- int cs_looplevel; // nr of nested ":while"s and ":for"s
- int cs_trylevel; // nr of nested ":try"s
- eslist_T *cs_emsg_silent_list; // saved values of "emsg_silent"
- int cs_lflags; // loop flags: CSL_ flags
-};
-# define cs_rettv cs_pend.csp_rv
-# define cs_exception cs_pend.csp_ex
-
/* There is no CSF_IF, the lack of CSF_WHILE, CSF_FOR and CSF_TRY means ":if"
* was used. */
# define CSF_TRUE 0x0001 /* condition was TRUE */
@@ -70,14 +34,6 @@ struct condstack {
# define CSTP_FINISH 32 /* ":finish" is pending */
/*
- * Flags for the cs_lflags item in struct condstack.
- */
-# define CSL_HAD_LOOP 1 /* just found ":while" or ":for" */
-# define CSL_HAD_ENDLOOP 2 /* just found ":endwhile" or ":endfor" */
-# define CSL_HAD_CONT 4 /* just found ":continue" */
-# define CSL_HAD_FINA 8 /* just found ":finally" */
-
-/*
* A list of error messages that can be converted to an exception. "throw_msg"
* is only set in the first element of the list. Usually, it points to the
* original message stored in that element, but sometimes it points to a later
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index b9dbcc6805..9c5434a0dd 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -1553,7 +1553,9 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
if (!VIsual_active) {
if (hasFolding(oap->start.lnum, &oap->start.lnum, NULL))
oap->start.col = 0;
- if ((curwin->w_cursor.col > 0 || oap->inclusive)
+ if ((curwin->w_cursor.col > 0
+ || oap->inclusive
+ || oap->motion_type == kMTLineWise)
&& hasFolding(curwin->w_cursor.lnum, NULL,
&curwin->w_cursor.lnum)) {
curwin->w_cursor.col = (colnr_T)STRLEN(get_cursor_line_ptr());
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index b470dbf8f6..c36458930f 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -15,7 +15,6 @@ export TMPDIR := $(abspath Xtest-tmpdir)
SCRIPTS_DEFAULT = \
test42.out \
- test64.out \
ifneq ($(OS),Windows_NT)
SCRIPTS_DEFAULTS := $(SCRIPTS_DEFAULT) \
diff --git a/src/nvim/testdir/test64.in b/src/nvim/testdir/test64.in
deleted file mode 100644
index ec11e15e35..0000000000
--- a/src/nvim/testdir/test64.in
+++ /dev/null
@@ -1,654 +0,0 @@
-Test for regexp patterns without multi-byte support.
-See test95 for multi-byte tests.
-
-A pattern that gives the expected result produces OK, so that we know it was
-actually tried.
-
-STARTTEST
-:" tl is a List of Lists with:
-:" regexp engine
-:" regexp pattern
-:" text to test the pattern on
-:" expected match (optional)
-:" expected submatch 1 (optional)
-:" expected submatch 2 (optional)
-:" etc.
-:" When there is no match use only the first two items.
-:let tl = []
-:"
-:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-:"""" Previously written tests """"""""""""""""""""""""""""""""
-:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-:"
-:set noautoindent
-:call add(tl, [2, 'ab', 'aab', 'ab'])
-:call add(tl, [2, 'b', 'abcdef', 'b'])
-:call add(tl, [2, 'bc*', 'abccccdef', 'bcccc'])
-:call add(tl, [2, 'bc\{-}', 'abccccdef', 'b'])
-:call add(tl, [2, 'bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd'])
-:call add(tl, [2, 'bc*', 'abbdef', 'b'])
-:call add(tl, [2, 'c*', 'ccc', 'ccc'])
-:call add(tl, [2, 'bc*', 'abdef', 'b'])
-:call add(tl, [2, 'c*', 'abdef', ''])
-:call add(tl, [2, 'bc\+', 'abccccdef', 'bcccc'])
-:call add(tl, [2, 'bc\+', 'abdef']) "no match
-:"
-:"operator \|
-:call add(tl, [2, 'a\|ab', 'cabd', 'a']) "alternation is ordered
-:"
-:call add(tl, [2, 'c\?', 'ccb', 'c'])
-:call add(tl, [2, 'bc\?', 'abd', 'b'])
-:call add(tl, [2, 'bc\?', 'abccd', 'bc'])
-:"
-:call add(tl, [2, '\va{1}', 'ab', 'a'])
-:"
-:call add(tl, [2, '\va{2}', 'aa', 'aa'])
-:call add(tl, [2, '\va{2}', 'caad', 'aa'])
-:call add(tl, [2, '\va{2}', 'aba'])
-:call add(tl, [2, '\va{2}', 'ab'])
-:call add(tl, [2, '\va{2}', 'abaa', 'aa'])
-:call add(tl, [2, '\va{2}', 'aaa', 'aa'])
-:"
-:call add(tl, [2, '\vb{1}', 'abca', 'b'])
-:call add(tl, [2, '\vba{2}', 'abaa', 'baa'])
-:call add(tl, [2, '\vba{3}', 'aabaac'])
-:"
-:call add(tl, [2, '\v(ab){1}', 'ab', 'ab', 'ab'])
-:call add(tl, [2, '\v(ab){1}', 'dabc', 'ab', 'ab'])
-:call add(tl, [2, '\v(ab){1}', 'acb'])
-:"
-:call add(tl, [2, '\v(ab){0,2}', 'acb', "", ""])
-:call add(tl, [2, '\v(ab){0,2}', 'ab', 'ab', 'ab'])
-:call add(tl, [2, '\v(ab){1,2}', 'ab', 'ab', 'ab'])
-:call add(tl, [2, '\v(ab){1,2}', 'ababc', 'abab', 'ab'])
-:call add(tl, [2, '\v(ab){2,4}', 'ababcab', 'abab', 'ab'])
-:call add(tl, [2, '\v(ab){2,4}', 'abcababa', 'abab', 'ab'])
-:"
-:call add(tl, [2, '\v(ab){2}', 'abab', 'abab', 'ab'])
-:call add(tl, [2, '\v(ab){2}', 'cdababe', 'abab', 'ab'])
-:call add(tl, [2, '\v(ab){2}', 'abac'])
-:call add(tl, [2, '\v(ab){2}', 'abacabab', 'abab', 'ab'])
-:call add(tl, [2, '\v((ab){2}){2}', 'abababab', 'abababab', 'abab', 'ab'])
-:call add(tl, [2, '\v((ab){2}){2}', 'abacabababab', 'abababab', 'abab', 'ab'])
-:"
-:call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a'])
-:call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa'])
-:call add(tl, [2, '\v(a{2}){1}', 'aaac', 'aa', 'aa'])
-:call add(tl, [2, '\v(a{2}){1}', 'daaac', 'aa', 'aa'])
-:call add(tl, [2, '\v(a{1}){2}', 'daaac', 'aa', 'a'])
-:call add(tl, [2, '\v(a{1}){2}', 'aaa', 'aa', 'a'])
-:call add(tl, [2, '\v(a{2})+', 'adaac', 'aa', 'aa'])
-:call add(tl, [2, '\v(a{2})+', 'aa', 'aa', 'aa'])
-:call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa'])
-:call add(tl, [2, '\v(a{1}){2}', 'aa', 'aa', 'a'])
-:call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a'])
-:call add(tl, [2, '\v(a{2}){2}', 'aaaa', 'aaaa', 'aa'])
-:call add(tl, [2, '\v(a{2}){2}', 'aaabaaaa', 'aaaa', 'aa'])
-:"
-:call add(tl, [2, '\v(a+){2}', 'dadaac', 'aa', 'a'])
-:call add(tl, [2, '\v(a{3}){2}', 'aaaaaaa', 'aaaaaa', 'aaa'])
-:"
-:call add(tl, [2, '\v(a{1,2}){2}', 'daaac', 'aaa', 'a'])
-:call add(tl, [2, '\v(a{1,3}){2}', 'daaaac', 'aaaa', 'a'])
-:call add(tl, [2, '\v(a{1,3}){2}', 'daaaaac', 'aaaaa', 'aa'])
-:call add(tl, [2, '\v(a{1,3}){3}', 'daac'])
-:call add(tl, [2, '\v(a{1,2}){2}', 'dac'])
-:call add(tl, [2, '\v(a+)+', 'daac', 'aa', 'aa'])
-:call add(tl, [2, '\v(a+)+', 'aaa', 'aaa', 'aaa'])
-:call add(tl, [2, '\v(a+){1,2}', 'aaa', 'aaa', 'aaa'])
-:call add(tl, [2, '\v(a+)(a+)', 'aaa', 'aaa', 'aa', 'a'])
-:call add(tl, [2, '\v(a{3})+', 'daaaac', 'aaa', 'aaa'])
-:call add(tl, [2, '\v(a|b|c)+', 'aacb', 'aacb', 'b'])
-:call add(tl, [2, '\v(a|b|c){2}', 'abcb', 'ab', 'b'])
-:call add(tl, [2, '\v(abc){2}', 'abcabd', ])
-:call add(tl, [2, '\v(abc){2}', 'abdabcabc','abcabc', 'abc'])
-:"
-:call add(tl, [2, 'a*', 'cc', ''])
-:call add(tl, [2, '\v(a*)+', 'cc', ''])
-:call add(tl, [2, '\v((ab)+)+', 'ab', 'ab', 'ab', 'ab'])
-:call add(tl, [2, '\v(((ab)+)+)+', 'ab', 'ab', 'ab', 'ab', 'ab'])
-:call add(tl, [2, '\v(((ab)+)+)+', 'dababc', 'abab', 'abab', 'abab', 'ab'])
-:call add(tl, [2, '\v(a{0,2})+', 'cc', ''])
-:call add(tl, [2, '\v(a*)+', '', ''])
-:call add(tl, [2, '\v((a*)+)+', '', ''])
-:call add(tl, [2, '\v((ab)*)+', '', ''])
-:call add(tl, [2, '\va{1,3}', 'aab', 'aa'])
-:call add(tl, [2, '\va{2,3}', 'abaa', 'aa'])
-:"
-:call add(tl, [2, '\v((ab)+|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
-:call add(tl, [2, '\v(a{2})|(b{3})', 'bbabbbb', 'bbb', '', 'bbb'])
-:call add(tl, [2, '\va{2}|b{2}', 'abab'])
-:call add(tl, [2, '\v(a)+|(c)+', 'bbacbaacbbb', 'a', 'a'])
-:call add(tl, [2, '\vab{2,3}c', 'aabbccccccccccccc', 'abbc'])
-:call add(tl, [2, '\vab{2,3}c', 'aabbbccccccccccccc', 'abbbc'])
-:call add(tl, [2, '\vab{2,3}cd{2,3}e', 'aabbbcddee', 'abbbcdde'])
-:call add(tl, [2, '\va(bc){2}d', 'aabcbfbc' ])
-:call add(tl, [2, '\va*a{2}', 'a', ])
-:call add(tl, [2, '\va*a{2}', 'aa', 'aa' ])
-:call add(tl, [2, '\va*a{2}', 'aaa', 'aaa' ])
-:call add(tl, [2, '\va*a{2}', 'bbbabcc', ])
-:call add(tl, [2, '\va*b*|a*c*', 'a', 'a'])
-:call add(tl, [2, '\va{1}b{1}|a{1}b{1}', ''])
-:"
-:"submatches
-:call add(tl, [2, '\v(a)', 'ab', 'a', 'a'])
-:call add(tl, [2, '\v(a)(b)', 'ab', 'ab', 'a', 'b'])
-:call add(tl, [2, '\v(ab)(b)(c)', 'abbc', 'abbc', 'ab', 'b', 'c'])
-:call add(tl, [2, '\v((a)(b))', 'ab', 'ab', 'ab', 'a', 'b'])
-:call add(tl, [2, '\v(a)|(b)', 'ab', 'a', 'a'])
-:"
-:call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', ''])
-:call add(tl, [2, 'x', 'abcdef'])
-:"
-:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-:""""" Simple tests """""""""""""""""""""""""""""""""""""""""""
-:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-:"
-:" Search single groups
-:call add(tl, [2, 'ab', 'aab', 'ab'])
-:call add(tl, [2, 'ab', 'baced'])
-:call add(tl, [2, 'ab', ' ab ', 'ab'])
-:"
-:" Search multi-modifiers
-:call add(tl, [2, 'x*', 'xcd', 'x'])
-:call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx'])
-:" empty match is good
-:call add(tl, [2, 'x*', 'abcdoij', ''])
-:" no match here
-:call add(tl, [2, 'x\+', 'abcdoin'])
-:call add(tl, [2, 'x\+', 'abcdeoijdfxxiuhfij', 'xx'])
-:call add(tl, [2, 'x\+', 'xxxxx', 'xxxxx'])
-:call add(tl, [2, 'x\+', 'abc x siufhiush xxxxxxxxx', 'x'])
-:call add(tl, [2, 'x\=', 'x sdfoij', 'x'])
-:call add(tl, [2, 'x\=', 'abc sfoij', '']) " empty match is good
-:call add(tl, [2, 'x\=', 'xxxxxxxxx c', 'x'])
-:call add(tl, [2, 'x\?', 'x sdfoij', 'x'])
-:" empty match is good
-:call add(tl, [2, 'x\?', 'abc sfoij', ''])
-:call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x'])
-:"
-:call add(tl, [2, 'a\{0,0}', 'abcdfdoij', ''])
-:" same thing as 'a?'
-:call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a'])
-:" same thing as 'a\{0,1}'
-:call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a'])
-:call add(tl, [2, 'a\{3,6}', 'aa siofuh'])
-:call add(tl, [2, 'a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa'])
-:call add(tl, [2, 'a\{3,6}', 'aaaaaaaa', 'aaaaaa'])
-:call add(tl, [2, 'a\{0}', 'asoiuj', ''])
-:call add(tl, [2, 'a\{2}', 'aaaa', 'aa'])
-:call add(tl, [2, 'a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa'])
-:call add(tl, [2, 'a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
-:" same thing as 'a*'
-:call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', ''])
-:call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa'])
-:call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg'])
-:call add(tl, [2, 'a\{2,}', 'aaaaasfoij ', 'aaaaa'])
-:call add(tl, [2, 'a\{5,}', 'xxaaaaxxx '])
-:call add(tl, [2, 'a\{5,}', 'xxaaaaaxxx ', 'aaaaa'])
-:call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', ''])
-:call add(tl, [2, 'a\{,5}', 'abcd', 'a'])
-:call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa'])
-:" leading star as normal char when \{} follows
-:call add(tl, [2, '^*\{4,}$', '***'])
-:call add(tl, [2, '^*\{4,}$', '****', '****'])
-:call add(tl, [2, '^*\{4,}$', '*****', '*****'])
-:" same thing as 'a*'
-:call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', ''])
-:call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa'])
-:"
-:call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', ''])
-:" anti-greedy version of 'a?'
-:call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', ''])
-:call add(tl, [2, 'a\{-3,6}', 'aa siofuh'])
-:call add(tl, [2, 'a\{-3,6}', 'aaaaa asfoij afaa', 'aaa'])
-:call add(tl, [2, 'a\{-3,6}', 'aaaaaaaa', 'aaa'])
-:call add(tl, [2, 'a\{-0}', 'asoiuj', ''])
-:call add(tl, [2, 'a\{-2}', 'aaaa', 'aa'])
-:call add(tl, [2, 'a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
-:call add(tl, [2, 'a\{-0,}', 'oij sdigfusnf', ''])
-:call add(tl, [2, 'a\{-0,}', 'aaaaa aa', ''])
-:call add(tl, [2, 'a\{-2,}', 'sdfiougjdsafg'])
-:call add(tl, [2, 'a\{-2,}', 'aaaaasfoij ', 'aa'])
-:call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', ''])
-:call add(tl, [2, 'a\{-,5}', 'abcd', ''])
-:call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', ''])
-:" anti-greedy version of 'a*'
-:call add(tl, [2, 'a\{-}', 'bbbcddiuhfcd', ''])
-:call add(tl, [2, 'a\{-}', 'aaaaioudfh coisf jda', ''])
-:"
-:" Test groups of characters and submatches
-:call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc'])
-:call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab'])
-:call add(tl, [2, '\(abaaaaa\)*cd', 'cd', 'cd', ''])
-:call add(tl, [2, '\(test1\)\? \(test2\)\?', 'test1 test3', 'test1 ', 'test1', ''])
-:call add(tl, [2, '\(test1\)\= \(test2\) \(test4443\)\=', ' test2 test4443 yupiiiiiiiiiii', ' test2 test4443', '', 'test2', 'test4443'])
-:call add(tl, [2, '\(\(sub1\) hello \(sub 2\)\)', 'asterix sub1 hello sub 2 obelix', 'sub1 hello sub 2', 'sub1 hello sub 2', 'sub1', 'sub 2'])
-:call add(tl, [2, '\(\(\(yyxxzz\)\)\)', 'abcdddsfiusfyyzzxxyyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz'])
-:call add(tl, [2, '\v((ab)+|c+)+', 'abcccaba', 'abcccab', 'ab', 'ab'])
-:call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
-:call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', ''])
-:call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', ''])
-:call add(tl, [2, '\p*', 'aá ', 'aá '])
-:"
-:" Test greedy-ness and lazy-ness
-:call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa'])
-:call add(tl, [2, 'a\{-2,7}x','aaaaaaaaax', 'aaaaaaax'])
-:call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa'])
-:call add(tl, [2, 'a\{2,7}x','aaaaaaaaax', 'aaaaaaax'])
-:call add(tl, [2, '\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz'])
-:call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa',''])
-:call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa'])
-:call add(tl, [2, '\v(a{-1,3})+', 'aa', 'aa', 'a'])
-:call add(tl, [2, '^\s\{-}\zs\( x\|x$\)', ' x', ' x', ' x'])
-:call add(tl, [2, '^\s\{-}\zs\(x\| x$\)', ' x', ' x', ' x'])
-:call add(tl, [2, '^\s\{-}\ze\(x\| x$\)', ' x', '', ' x'])
-:call add(tl, [2, '^\(\s\{-}\)\(x\| x$\)', ' x', ' x', '', ' x'])
-:"
-:" Test Character classes
-:call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23'])
-:"
-:" Test collections and character range []
-:call add(tl, [2, '\v[a]', 'abcd', 'a'])
-:call add(tl, [2, 'a[bcd]', 'abcd', 'ab'])
-:call add(tl, [2, 'a[b-d]', 'acbd', 'ac'])
-:call add(tl, [2, '[a-d][e-f][x-x]d', 'cexdxx', 'cexd'])
-:call add(tl, [2, '\v[[:alpha:]]+', 'abcdefghijklmnopqrstuvwxyz6','abcdefghijklmnopqrstuvwxyz'])
-:call add(tl, [2, '[[:alpha:]\+]', '6x8','x'])
-:call add(tl, [2, '[^abc]\+','abcabcabc'])
-:call add(tl, [2, '[^abc]','defghiasijvoinasoiunbvb','d'])
-:call add(tl, [2, '[^abc]\+','ddddddda','ddddddd'])
-:call add(tl, [2, '[^a-d]\+','aaaAAAZIHFNCddd','AAAZIHFNC'])
-:call add(tl, [2, '[a-f]*','iiiiiiii',''])
-:call add(tl, [2, '[a-f]*','abcdefgh','abcdef'])
-:call add(tl, [2, '[^a-f]\+','abcdefgh','gh'])
-:call add(tl, [2, '[a-c]\{-3,6}','abcabc','abc'])
-:call add(tl, [2, '[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787'])
-:call add(tl, [2, '[-a]', '-', '-'])
-:call add(tl, [2, '[a-]', '-', '-'])
-:call add(tl, [2, '[a-f]*\c','ABCDEFGH','ABCDEF'])
-:call add(tl, [2, '[abc][xyz]\c','-af-AF-BY--','BY'])
-:" filename regexp
-:call add(tl, [2, '[-./[:alnum:]_~]\+', 'log13.file', 'log13.file'])
-:" special chars
-:call add(tl, [2, '[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^'])
-:" collation elem
-:call add(tl, [2, '[[.a.]]\+', 'aa', 'aa'])
-:" middle of regexp
-:call add(tl, [2, 'abc[0-9]*ddd', 'siuhabc ii'])
-:call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd'])
-:call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888'])
-:call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888'])
-:call add(tl, [2, '\_[0-9]\+', "asfi\n9888u", "\n9888"])
-:call add(tl, [2, '\_f', " \na ", "\n"])
-:call add(tl, [2, '\_f\+', " \na ", "\na"])
-:call add(tl, [2, '[0-9A-Za-z-_.]\+', " @0_a.A-{ ", "0_a.A-"])
-:"
-:"""" Test start/end of line, start/end of file
-:call add(tl, [2, '^a.', "a_\nb ", "a_"])
-:call add(tl, [2, '^a.', "b a \na_"])
-:call add(tl, [2, '.a$', " a\n "])
-:call add(tl, [2, '.a$', " a b\n_a", "_a"])
-:call add(tl, [2, '\%^a.', "a a\na", "a "])
-:call add(tl, [2, '\%^a', " a \na "])
-:call add(tl, [2, '.a\%$', " a\n "])
-:call add(tl, [2, '.a\%$', " a\n_a", "_a"])
-:"
-:"""" Test recognition of character classes
-:call add(tl, [2, '[0-7]\+', 'x0123456789x', '01234567'])
-:call add(tl, [2, '[^0-7]\+', '0a;X+% 897', 'a;X+% 89'])
-:call add(tl, [2, '[0-9]\+', 'x0123456789x', '0123456789'])
-:call add(tl, [2, '[^0-9]\+', '0a;X+% 9', 'a;X+% '])
-:call add(tl, [2, '[0-9a-fA-F]\+', 'x0189abcdefg', '0189abcdef'])
-:call add(tl, [2, '[^0-9A-Fa-f]\+', '0189g;X+% ab', 'g;X+% '])
-:call add(tl, [2, '[a-z_A-Z0-9]\+', ';+aso_SfOij ', 'aso_SfOij'])
-:call add(tl, [2, '[^a-z_A-Z0-9]\+', 'aSo_;+% sfOij', ';+% '])
-:call add(tl, [2, '[a-z_A-Z]\+', '0abyz_ABYZ;', 'abyz_ABYZ'])
-:call add(tl, [2, '[^a-z_A-Z]\+', 'abAB_09;+% yzYZ', '09;+% '])
-:call add(tl, [2, '[a-z]\+', '0abcxyz1', 'abcxyz'])
-:call add(tl, [2, '[a-z]\+', 'AabxyzZ', 'abxyz'])
-:call add(tl, [2, '[^a-z]\+', 'a;X09+% x', ';X09+% '])
-:call add(tl, [2, '[^a-z]\+', 'abX0;%yz', 'X0;%'])
-:call add(tl, [2, '[a-zA-Z]\+', '0abABxzXZ9', 'abABxzXZ'])
-:call add(tl, [2, '[^a-zA-Z]\+', 'ab09_;+ XZ', '09_;+ '])
-:call add(tl, [2, '[A-Z]\+', 'aABXYZz', 'ABXYZ'])
-:call add(tl, [2, '[^A-Z]\+', 'ABx0;%YZ', 'x0;%'])
-:call add(tl, [2, '[a-z]\+\c', '0abxyzABXYZ;', 'abxyzABXYZ'])
-:call add(tl, [2, '[A-Z]\+\c', '0abABxzXZ9', 'abABxzXZ'])
-:call add(tl, [2, '\c[^a-z]\+', 'ab09_;+ XZ', '09_;+ '])
-:call add(tl, [2, '\c[^A-Z]\+', 'ab09_;+ XZ', '09_;+ '])
-:call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
-:"
-:"""" Tests for \z features
-:" match ends at \ze
-:call add(tl, [2, 'xx \ze test', 'xx '])
-:call add(tl, [2, 'abc\zeend', 'oij abcend', 'abc'])
-:call add(tl, [2, 'aa\zebb\|aaxx', ' aabb ', 'aa'])
-:call add(tl, [2, 'aa\zebb\|aaxx', ' aaxx ', 'aaxx'])
-:call add(tl, [2, 'aabb\|aa\zebb', ' aabb ', 'aabb'])
-:call add(tl, [2, 'aa\zebb\|aaebb', ' aabb ', 'aa'])
-:" match starts at \zs
-:call add(tl, [2, 'abc\zsdd', 'ddabcddxyzt', 'dd'])
-:call add(tl, [2, 'aa \zsax', ' ax'])
-:call add(tl, [2, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match'])
-:call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last'])
-:call add(tl, [2, '\>\zs.', 'aword. ', '.'])
-:call add(tl, [2, '\s\+\ze\[/\|\s\zs\s\+', 'is [a t', ' '])
-:"
-:"""" Tests for \@= and \& features
-:call add(tl, [2, 'abc\@=', 'abc', 'ab'])
-:call add(tl, [2, 'abc\@=cd', 'abcd', 'abcd'])
-:call add(tl, [2, 'abc\@=', 'ababc', 'ab'])
-:" will never match, no matter the input text
-:call add(tl, [2, 'abcd\@=e', 'abcd'])
-:" will never match
-:call add(tl, [2, 'abcd\@=e', 'any text in here ... '])
-:call add(tl, [2, '\v(abc)@=..', 'xabcd', 'ab', 'abc'])
-:call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B'])
-:call add(tl, [2, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend'])
-:call add(tl, [2, '\<\S\+\())\)\@=', '$((i=i+1))', 'i=i+1', '))'])
-:call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B'])
-:call add(tl, [2, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob'])
-:call add(tl, [2, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1'])
-:call add(tl, [2, 'foo\(bar\)\@!', 'foobar'])
-:call add(tl, [2, 'foo\(bar\)\@!', 'foo bar', 'foo'])
-:call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if then else'])
-:call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if else ', 'if else ', ' '])
-:call add(tl, [2, '\(foo\)\@!bar', 'foobar', 'bar'])
-:call add(tl, [2, '\(foo\)\@!...bar', 'foobar'])
-:call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' bar foo '])
-:call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo bar '])
-:call add(tl,