From efc81331e7bceafa2d7bc452a98d6ec1943b4292 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 13 Jul 2018 16:31:19 +0200 Subject: [PATCH 01/31] patch 8.1.0179: redundant condition for boundary check Problem: Redundant condition for boundary check. Solution: Remove the condition. (Dominique Pelle). Change FALSE to FAIL. --- src/undo.c | 6 ++---- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/undo.c b/src/undo.c index b3a6276865..040ec54809 100644 --- a/src/undo.c +++ b/src/undo.c @@ -266,10 +266,8 @@ u_save(linenr_T top, linenr_T bot) if (undo_off) return OK; - if (top > curbuf->b_ml.ml_line_count - || top >= bot - || bot > curbuf->b_ml.ml_line_count + 1) - return FALSE; /* rely on caller to do error messages */ + if (top >= bot || bot > curbuf->b_ml.ml_line_count + 1) + return FAIL; // rely on caller to give an error message if (top + 2 == bot) u_saveline((linenr_T)(top + 1)); diff --git a/src/version.c b/src/version.c index 1f94b015f3..1dae71fcc6 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 179, /**/ 178, /**/ From d6ef5f9b3d3df2d5dcc666c8741e99fcc77043f6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 13 Jul 2018 22:08:23 +0200 Subject: [PATCH 02/31] patch 8.1.0180: static analysis errors in Lua interface Problem: Static analysis errors in Lua interface. (Coverity) Solution: Check for NULL pointers. --- src/if_lua.c | 47 ++++++++++++++++++++++++++++++++--------------- src/version.c | 2 ++ 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/if_lua.c b/src/if_lua.c index f0d5a4d04d..3886401be5 100644 --- a/src/if_lua.c +++ b/src/if_lua.c @@ -958,7 +958,9 @@ luaV_dict_newindex(lua_State *L) typval_T v; if (d->dv_lock) luaL_error(L, "dict is locked"); - if (key != NULL && *key == NUL) + if (key == NULL) + return 0; + if (*key == NUL) luaL_error(L, "empty key"); if (!lua_isnil(L, 3)) { /* read value? */ luaV_checktypval(L, 3, &v, "setting dict item"); @@ -968,13 +970,15 @@ luaV_dict_newindex(lua_State *L) di = dict_find(d, key, -1); if (di == NULL) /* non-existing key? */ { - if (lua_isnil(L, 3)) return 0; + if (lua_isnil(L, 3)) + return 0; di = dictitem_alloc(key); - if (di == NULL) return 0; + if (di == NULL) + return 0; if (dict_add(d, di) == FAIL) { - vim_free(di); - return 0; + vim_free(di); + return 0; } } else @@ -1066,15 +1070,21 @@ luaV_funcref_call(lua_State *L) f->args.vval.v_list = list_alloc(); rettv.v_type = VAR_UNKNOWN; /* as in clear_tv */ - for (i = 0; i < n; i++) { - luaV_checktypval(L, i + 2, &v, "calling funcref"); - list_append_tv(f->args.vval.v_list, &v); + if (f->args.vval.v_list == NULL) + status = FAIL; + else + { + for (i = 0; i < n; i++) { + luaV_checktypval(L, i + 2, &v, "calling funcref"); + list_append_tv(f->args.vval.v_list, &v); + } + status = func_call(f->tv.vval.v_string, &f->args, + NULL, f->self, &rettv); + if (status == OK) + luaV_pushtypval(L, &rettv); + clear_tv(&f->args); + clear_tv(&rettv); } - status = func_call(f->tv.vval.v_string, &f->args, NULL, f->self, &rettv); - if (status == OK) - luaV_pushtypval(L, &rettv); - clear_tv(&f->args); - clear_tv(&rettv); if (status != OK) luaL_error(L, "cannot call funcref"); return 1; @@ -1560,13 +1570,20 @@ luaV_dict(lua_State *L) char_u *key; dictitem_T *di; typval_T v; + lua_pushvalue(L, -2); /* dup key in case it's a number */ key = (char_u *) lua_tostring(L, -1); - if (key != NULL && *key == NUL) + if (key == NULL) + { + lua_pushnil(L); + return 1; + } + if (*key == NUL) luaL_error(L, "table has empty key"); luaV_checktypval(L, -2, &v, "vim.dict"); /* value */ di = dictitem_alloc(key); - if (di == NULL || dict_add(d, di) == FAIL) { + if (di == NULL || dict_add(d, di) == FAIL) + { vim_free(di); lua_pushnil(L); return 1; diff --git a/src/version.c b/src/version.c index 1dae71fcc6..7275901843 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 180, /**/ 179, /**/ From a43ebe9454386427ca38c75810e2d36991f17812 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 14 Jul 2018 17:25:01 +0200 Subject: [PATCH 03/31] patch 8.1.0181: memory leak with trailing characters in skip expression Problem: Memory leak with trailing characters in skip expression. Solution: Free the return value. --- src/eval.c | 1 + src/testdir/test_search.vim | 10 ++++++++++ src/version.c | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/eval.c b/src/eval.c index 26aa0e34e7..4423419b17 100644 --- a/src/eval.c +++ b/src/eval.c @@ -729,6 +729,7 @@ eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv) return FAIL; if (*s != NUL) /* check for trailing chars after expr */ { + clear_tv(rettv); EMSG2(_(e_invexpr2), s); return FAIL; } diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 9b078be396..28f0463c40 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -324,6 +324,16 @@ func Test_searchpair_skip() bw! endfunc +func Test_searchpair_leak() + new + call setline(1, 'if one else another endif') + + " The error in the skip expression caused memory to leak. + call assert_fails("call searchpair('\\', '\\', '\\', '', '\"foo\" 2')", 'E15:') + + bwipe! +endfunc + func Test_searchc() " These commands used to cause memory overflow in searchc(). new diff --git a/src/version.c b/src/version.c index 7275901843..e6a7d8b52b 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 181, /**/ 180, /**/ From 4fc85003c5f53d6ceb3dbea4b8fae5681615a20c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 14 Jul 2018 19:30:36 +0200 Subject: [PATCH 04/31] patch 8.1.0182: Unicode standard was updated Problem: Unicode standard was updated. Solution: Include the changes. (Christian Brabandt) --- src/mbyte.c | 71 ++++++++++++++++++++++++++++++++++----------------- src/version.c | 2 ++ 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/src/mbyte.c b/src/mbyte.c index 0443122880..1f85246f0a 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -1462,7 +1462,7 @@ utf_char2cells(int c) {0x3000, 0x303e}, {0x3041, 0x3096}, {0x3099, 0x30ff}, - {0x3105, 0x312e}, + {0x3105, 0x312f}, {0x3131, 0x318e}, {0x3190, 0x31ba}, {0x31c0, 0x31e3}, @@ -1482,7 +1482,7 @@ utf_char2cells(int c) {0xff01, 0xff60}, {0xffe0, 0xffe6}, {0x16fe0, 0x16fe1}, - {0x17000, 0x187ec}, + {0x17000, 0x187f1}, {0x18800, 0x18af2}, {0x1b000, 0x1b11e}, {0x1b170, 0x1b2fb}, @@ -1517,13 +1517,15 @@ utf_char2cells(int c) {0x1f6cc, 0x1f6cc}, {0x1f6d0, 0x1f6d2}, {0x1f6eb, 0x1f6ec}, - {0x1f6f4, 0x1f6f8}, + {0x1f6f4, 0x1f6f9}, {0x1f910, 0x1f93e}, - {0x1f940, 0x1f94c}, - {0x1f950, 0x1f96b}, - {0x1f980, 0x1f997}, - {0x1f9c0, 0x1f9c0}, - {0x1f9d0, 0x1f9e6}, + {0x1f940, 0x1f970}, + {0x1f973, 0x1f976}, + {0x1f97a, 0x1f97a}, + {0x1f97c, 0x1f9a2}, + {0x1f9b0, 0x1f9b9}, + {0x1f9c0, 0x1f9c2}, + {0x1f9d0, 0x1f9ff}, {0x20000, 0x2fffd}, {0x30000, 0x3fffd} }; @@ -2348,12 +2350,13 @@ utf_iscomposing(int c) {0x0730, 0x074a}, {0x07a6, 0x07b0}, {0x07eb, 0x07f3}, + {0x07fd, 0x07fd}, {0x0816, 0x0819}, {0x081b, 0x0823}, {0x0825, 0x0827}, {0x0829, 0x082d}, {0x0859, 0x085b}, - {0x08d4, 0x08e1}, + {0x08d3, 0x08e1}, {0x08e3, 0x0903}, {0x093a, 0x093c}, {0x093e, 0x094f}, @@ -2366,6 +2369,7 @@ utf_iscomposing(int c) {0x09cb, 0x09cd}, {0x09d7, 0x09d7}, {0x09e2, 0x09e3}, + {0x09fe, 0x09fe}, {0x0a01, 0x0a03}, {0x0a3c, 0x0a3c}, {0x0a3e, 0x0a42}, @@ -2393,7 +2397,7 @@ utf_iscomposing(int c) {0x0bc6, 0x0bc8}, {0x0bca, 0x0bcd}, {0x0bd7, 0x0bd7}, - {0x0c00, 0x0c03}, + {0x0c00, 0x0c04}, {0x0c3e, 0x0c44}, {0x0c46, 0x0c48}, {0x0c4a, 0x0c4d}, @@ -2493,6 +2497,7 @@ utf_iscomposing(int c) {0xa880, 0xa881}, {0xa8b4, 0xa8c5}, {0xa8e0, 0xa8f1}, + {0xa8ff, 0xa8ff}, {0xa926, 0xa92d}, {0xa947, 0xa953}, {0xa980, 0xa983}, @@ -2523,21 +2528,24 @@ utf_iscomposing(int c) {0x10a38, 0x10a3a}, {0x10a3f, 0x10a3f}, {0x10ae5, 0x10ae6}, + {0x10d24, 0x10d27}, + {0x10f46, 0x10f50}, {0x11000, 0x11002}, {0x11038, 0x11046}, {0x1107f, 0x11082}, {0x110b0, 0x110ba}, {0x11100, 0x11102}, {0x11127, 0x11134}, + {0x11145, 0x11146}, {0x11173, 0x11173}, {0x11180, 0x11182}, {0x111b3, 0x111c0}, - {0x111ca, 0x111cc}, + {0x111c9, 0x111cc}, {0x1122c, 0x11237}, {0x1123e, 0x1123e}, {0x112df, 0x112ea}, {0x11300, 0x11303}, - {0x1133c, 0x1133c}, + {0x1133b, 0x1133c}, {0x1133e, 0x11344}, {0x11347, 0x11348}, {0x1134b, 0x1134d}, @@ -2546,6 +2554,7 @@ utf_iscomposing(int c) {0x11366, 0x1136c}, {0x11370, 0x11374}, {0x11435, 0x11446}, + {0x1145e, 0x1145e}, {0x114b0, 0x114c3}, {0x115af, 0x115b5}, {0x115b8, 0x115c0}, @@ -2553,6 +2562,7 @@ utf_iscomposing(int c) {0x11630, 0x11640}, {0x116ab, 0x116b7}, {0x1171d, 0x1172b}, + {0x1182c, 0x1183a}, {0x11a01, 0x11a0a}, {0x11a33, 0x11a39}, {0x11a3b, 0x11a3e}, @@ -2568,6 +2578,10 @@ utf_iscomposing(int c) {0x11d3c, 0x11d3d}, {0x11d3f, 0x11d45}, {0x11d47, 0x11d47}, + {0x11d8a, 0x11d8e}, + {0x11d90, 0x11d91}, + {0x11d93, 0x11d97}, + {0x11ef3, 0x11ef6}, {0x16af0, 0x16af4}, {0x16b30, 0x16b36}, {0x16f51, 0x16f7e}, @@ -2659,12 +2673,12 @@ static struct interval emoji_all[] = {0x2640, 0x2640}, {0x2642, 0x2642}, {0x2648, 0x2653}, - {0x2660, 0x2660}, + {0x265f, 0x2660}, {0x2663, 0x2663}, {0x2665, 0x2666}, {0x2668, 0x2668}, {0x267b, 0x267b}, - {0x267f, 0x267f}, + {0x267e, 0x267f}, {0x2692, 0x2697}, {0x2699, 0x2699}, {0x269b, 0x269c}, @@ -2759,15 +2773,17 @@ static struct interval emoji_all[] = {0x1f6e9, 0x1f6e9}, {0x1f6eb, 0x1f6ec}, {0x1f6f0, 0x1f6f0}, - {0x1f6f3, 0x1f6f8}, + {0x1f6f3, 0x1f6f9}, {0x1f910, 0x1f93a}, {0x1f93c, 0x1f93e}, {0x1f940, 0x1f945}, - {0x1f947, 0x1f94c}, - {0x1f950, 0x1f96b}, - {0x1f980, 0x1f997}, - {0x1f9c0, 0x1f9c0}, - {0x1f9d0, 0x1f9e6} + {0x1f947, 0x1f970}, + {0x1f973, 0x1f976}, + {0x1f97a, 0x1f97a}, + {0x1f97c, 0x1f9a2}, + {0x1f9b0, 0x1f9b9}, + {0x1f9c0, 0x1f9c2}, + {0x1f9d0, 0x1f9ff} }; /* @@ -3034,6 +3050,8 @@ static convertStruct foldCase[] = {0x1c86,0x1c86,-1,-6204}, {0x1c87,0x1c87,-1,-6180}, {0x1c88,0x1c88,-1,35267}, + {0x1c90,0x1cba,1,-3008}, + {0x1cbd,0x1cbf,1,-3008}, {0x1e00,0x1e94,2,1}, {0x1e9b,0x1e9b,-1,-58}, {0x1e9e,0x1e9e,-1,-7615}, @@ -3104,13 +3122,14 @@ static convertStruct foldCase[] = {0xa7b1,0xa7b1,-1,-42282}, {0xa7b2,0xa7b2,-1,-42261}, {0xa7b3,0xa7b3,-1,928}, - {0xa7b4,0xa7b6,2,1}, + {0xa7b4,0xa7b8,2,1}, {0xab70,0xabbf,1,-38864}, {0xff21,0xff3a,1,32}, {0x10400,0x10427,1,40}, {0x104b0,0x104d3,1,40}, {0x10c80,0x10cb2,1,64}, {0x118a0,0x118bf,1,32}, + {0x16e40,0x16e5f,1,32}, {0x1e900,0x1e921,1,34} }; @@ -3256,6 +3275,8 @@ static convertStruct toLower[] = {0x10c7,0x10cd,6,7264}, {0x13a0,0x13ef,1,38864}, {0x13f0,0x13f5,1,8}, + {0x1c90,0x1cba,1,-3008}, + {0x1cbd,0x1cbf,1,-3008}, {0x1e00,0x1e94,2,1}, {0x1e9e,0x1e9e,-1,-7615}, {0x1ea0,0x1efe,2,1}, @@ -3324,12 +3345,13 @@ static convertStruct toLower[] = {0xa7b1,0xa7b1,-1,-42282}, {0xa7b2,0xa7b2,-1,-42261}, {0xa7b3,0xa7b3,-1,928}, - {0xa7b4,0xa7b6,2,1}, + {0xa7b4,0xa7b8,2,1}, {0xff21,0xff3a,1,32}, {0x10400,0x10427,1,40}, {0x104b0,0x104d3,1,40}, {0x10c80,0x10cb2,1,64}, {0x118a0,0x118bf,1,32}, + {0x16e40,0x16e5f,1,32}, {0x1e900,0x1e921,1,34} }; @@ -3443,6 +3465,8 @@ static convertStruct toUpper[] = {0x4cf,0x4cf,-1,-15}, {0x4d1,0x52f,2,-1}, {0x561,0x586,1,-48}, + {0x10d0,0x10fa,1,3008}, + {0x10fd,0x10ff,1,3008}, {0x13f8,0x13fd,1,-8}, {0x1c80,0x1c80,-1,-6254}, {0x1c81,0x1c81,-1,-6253}, @@ -3505,7 +3529,7 @@ static convertStruct toUpper[] = {0xa78c,0xa791,5,-1}, {0xa793,0xa797,4,-1}, {0xa799,0xa7a9,2,-1}, - {0xa7b5,0xa7b7,2,-1}, + {0xa7b5,0xa7b9,2,-1}, {0xab53,0xab53,-1,-928}, {0xab70,0xabbf,1,-38864}, {0xff41,0xff5a,1,-32}, @@ -3513,6 +3537,7 @@ static convertStruct toUpper[] = {0x104d8,0x104fb,1,-40}, {0x10cc0,0x10cf2,1,-64}, {0x118c0,0x118df,1,-32}, + {0x16e60,0x16e7f,1,-32}, {0x1e922,0x1e943,1,-34} }; diff --git a/src/version.c b/src/version.c index e6a7d8b52b..679aabd3d5 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 182, /**/ 181, /**/ From 174136713181a1d1460951d7a0392b16603f81bb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 14 Jul 2018 20:49:42 +0200 Subject: [PATCH 05/31] patch 8.1.0183: Lua API changed, breaking the build Problem: Lua API changed, breaking the build. Solution: Adjust prototype of lua_rawgeti(). (Ken Takata, closes #3157, closes #3144) --- src/if_lua.c | 24 +++++++++++++++++++----- src/version.c | 2 ++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/if_lua.c b/src/if_lua.c index 3886401be5..c0d809adc9 100644 --- a/src/if_lua.c +++ b/src/if_lua.c @@ -253,14 +253,23 @@ void (*dll_lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); void (*dll_lua_pushboolean) (lua_State *L, int b); void (*dll_lua_pushlightuserdata) (lua_State *L, void *p); void (*dll_lua_getfield) (lua_State *L, int idx, const char *k); +#if LUA_VERSION_NUM <= 502 void (*dll_lua_rawget) (lua_State *L, int idx); void (*dll_lua_rawgeti) (lua_State *L, int idx, int n); +#else +int (*dll_lua_rawget) (lua_State *L, int idx); +int (*dll_lua_rawgeti) (lua_State *L, int idx, lua_Integer n); +#endif void (*dll_lua_createtable) (lua_State *L, int narr, int nrec); void *(*dll_lua_newuserdata) (lua_State *L, size_t sz); int (*dll_lua_getmetatable) (lua_State *L, int objindex); void (*dll_lua_setfield) (lua_State *L, int idx, const char *k); void (*dll_lua_rawset) (lua_State *L, int idx); +#if LUA_VERSION_NUM <= 502 void (*dll_lua_rawseti) (lua_State *L, int idx, int n); +#else +void (*dll_lua_rawseti) (lua_State *L, int idx, lua_Integer n); +#endif int (*dll_lua_setmetatable) (lua_State *L, int objindex); int (*dll_lua_next) (lua_State *L, int idx); /* libs */ @@ -962,7 +971,8 @@ luaV_dict_newindex(lua_State *L) return 0; if (*key == NUL) luaL_error(L, "empty key"); - if (!lua_isnil(L, 3)) { /* read value? */ + if (!lua_isnil(L, 3)) /* read value? */ + { luaV_checktypval(L, 3, &v, "setting dict item"); if (d->dv_scope == VAR_DEF_SCOPE && v.v_type == VAR_FUNC) luaL_error(L, "cannot assign funcref to builtin scope"); @@ -1074,7 +1084,8 @@ luaV_funcref_call(lua_State *L) status = FAIL; else { - for (i = 0; i < n; i++) { + for (i = 0; i < n; i++) + { luaV_checktypval(L, i + 2, &v, "calling funcref"); list_append_tv(f->args.vval.v_list, &v); } @@ -1531,13 +1542,16 @@ luaV_list(lua_State *L) else { luaV_newlist(L, l); - if (initarg) { /* traverse table to init dict */ + if (initarg) /* traverse table to init list */ + { int notnil, i = 0; typval_T v; - do { + do + { lua_rawgeti(L, 1, ++i); notnil = !lua_isnil(L, -1); - if (notnil) { + if (notnil) + { luaV_checktypval(L, -1, &v, "vim.list"); list_append_tv(l, &v); } diff --git a/src/version.c b/src/version.c index 679aabd3d5..0cda7a5ae5 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 183, /**/ 182, /**/ From b6959a8e06cef6d2126b030b2f8acd49457a3582 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 14 Jul 2018 21:41:44 +0200 Subject: [PATCH 06/31] patch 8.1.0184: not easy to figure out the window layout Problem: Not easy to figure out the window layout. Solution: Add "wincol" and "winrow" to what getwininfo() returns. --- runtime/doc/eval.txt | 2 ++ src/evalfunc.c | 2 ++ src/testdir/test_bufwintabinfo.vim | 21 +++++++++++++++++++-- src/version.c | 2 ++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index bd538d5233..9394ece21f 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4994,8 +4994,10 @@ getwininfo([{winid}]) *getwininfo()* variables a reference to the dictionary with window-local variables width window width + wincol leftmost screen column of the window winid |window-ID| winnr window number + winrow topmost screen column of the window To obtain all window-local variables use: > gettabwinvar({tabnr}, {winnr}, '&') diff --git a/src/evalfunc.c b/src/evalfunc.c index 5775c78db9..13c60b9930 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -5648,10 +5648,12 @@ get_win_info(win_T *wp, short tpnr, short winnr) dict_add_number(dict, "winnr", winnr); dict_add_number(dict, "winid", wp->w_id); dict_add_number(dict, "height", wp->w_height); + dict_add_number(dict, "winrow", wp->w_winrow); #ifdef FEAT_MENU dict_add_number(dict, "winbar", wp->w_winbar_height); #endif dict_add_number(dict, "width", wp->w_width); + dict_add_number(dict, "wincol", wp->w_wincol); dict_add_number(dict, "bufnr", wp->w_buffer->b_fnum); #ifdef FEAT_TERMINAL diff --git a/src/testdir/test_bufwintabinfo.vim b/src/testdir/test_bufwintabinfo.vim index 31b4650025..bcf3c52ed0 100644 --- a/src/testdir/test_bufwintabinfo.vim +++ b/src/testdir/test_bufwintabinfo.vim @@ -46,17 +46,34 @@ function Test_getbufwintabinfo() let w2_id = win_getid() tabnew | let w3_id = win_getid() new | let w4_id = win_getid() - new | let w5_id = win_getid() + vert new | let w5_id = win_getid() call setwinvar(0, 'signal', 'green') tabfirst let winlist = getwininfo() call assert_equal(5, len(winlist)) + call assert_equal(winwidth(1), winlist[0].width) + call assert_equal(0, winlist[0].wincol) + call assert_equal(1, winlist[0].winrow) " tabline adds one + call assert_equal(winbufnr(2), winlist[1].bufnr) call assert_equal(winheight(2), winlist[1].height) + call assert_equal(0, winlist[1].wincol) + call assert_equal(winheight(1) + 2, winlist[1].winrow) + call assert_equal(1, winlist[2].winnr) + call assert_equal(1, winlist[2].winrow) + call assert_equal(0, winlist[2].wincol) + + call assert_equal(winlist[2].width + 1, winlist[3].wincol) + call assert_equal(0, winlist[4].wincol) + + call assert_equal(1, winlist[0].tabnr) + call assert_equal(1, winlist[1].tabnr) + call assert_equal(2, winlist[2].tabnr) call assert_equal(2, winlist[3].tabnr) + call assert_equal(2, winlist[4].tabnr) + call assert_equal('green', winlist[2].variables.signal) - call assert_equal(winwidth(1), winlist[0].width) call assert_equal(w4_id, winlist[3].winid) let winfo = getwininfo(w5_id)[0] call assert_equal(2, winfo.tabnr) diff --git a/src/version.c b/src/version.c index 0cda7a5ae5..a1535f6822 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 184, /**/ 183, /**/ From 1ce9a1515be5255641d31ab5b0e9418d8f250d84 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 14 Jul 2018 21:48:46 +0200 Subject: [PATCH 07/31] patch 8.1.0185: running tests writes lua.vim even though it is not used Problem: Running tests writes lua.vim even though it is not used. Solution: Stop writing lua.vim. --- src/testdir/Make_dos.mak | 1 - src/testdir/Make_ming.mak | 1 - src/testdir/Make_vms.mms | 1 - src/testdir/Makefile | 2 +- src/testdir/test1.in | 5 ----- src/version.c | 2 ++ 6 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index 6cd8de6463..6a86d3efd3 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -85,7 +85,6 @@ clean: -if exist tiny.vim del tiny.vim -if exist mbyte.vim del mbyte.vim -if exist mzscheme.vim del mzscheme.vim - -if exist lua.vim del lua.vim -if exist Xdir1 rd /s /q Xdir1 -if exist Xfind rd /s /q Xfind -if exist XfakeHOME rd /s /q XfakeHOME diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index d66d6678c8..7b38be53ef 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -75,7 +75,6 @@ clean: -@if exist tiny.vim $(DEL) tiny.vim -@if exist mbyte.vim $(DEL) mbyte.vim -@if exist mzscheme.vim $(DEL) mzscheme.vim - -@if exist lua.vim $(DEL) lua.vim -@if exist Xdir1 $(DELDIR) Xdir1 -@if exist Xfind $(DELDIR) Xfind -@if exist XfakeHOME $(DELDIR) XfakeHOME diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index e97ad27a8e..f14f6bc3db 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -208,6 +208,5 @@ clean : -@ if "''F$SEARCH("small.vim")'" .NES. "" then delete/noconfirm/nolog small.vim.* -@ if "''F$SEARCH("mbyte.vim")'" .NES. "" then delete/noconfirm/nolog mbyte.vim.* -@ if "''F$SEARCH("mzscheme.vim")'" .NES. "" then delete/noconfirm/nolog mzscheme.vim.* - -@ if "''F$SEARCH("lua.vim")'" .NES. "" then delete/noconfirm/nolog lua.vim.* -@ if "''F$SEARCH("viminfo.*")'" .NES. "" then delete/noconfirm/nolog viminfo.*.* diff --git a/src/testdir/Makefile b/src/testdir/Makefile index 459b868783..57bcb3aa6a 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -51,7 +51,7 @@ $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS): $(VIMPROG) $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS): $(SCRIPTS_FIRST) RM_ON_RUN = test.out X* viminfo -RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok benchmark.out +RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim test.ok benchmark.out RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f $(GUI_FLAG) -u unix.vim $(NO_INITS) -s dotest.in clean: diff --git a/src/testdir/test1.in b/src/testdir/test1.in index 735d539673..8c0219ea60 100644 --- a/src/testdir/test1.in +++ b/src/testdir/test1.in @@ -15,7 +15,6 @@ If Vim was not compiled with the +multi_byte feature, the mbyte.vim script will be set like small.vim above. mbyte.vim is sourced by tests that require the +multi_byte feature. Similar logic is applied to the +mzscheme feature, using mzscheme.vim. -Similar logic is applied to the +lua feature, using lua.vim. STARTTEST :" If columns or lines are too small, create wrongtermsize. @@ -33,7 +32,6 @@ w! test.out qa! :w! mbyte.vim :w! mzscheme.vim -:w! lua.vim :" :" If +multi_byte feature supported, make mbyte.vim empty. :if has("multi_byte") | sp another | w! mbyte.vim | q | endif @@ -41,9 +39,6 @@ qa! :" If +mzscheme feature supported, make mzscheme.vim empty. :if has("mzscheme") | sp another | w! mzscheme.vim | q | endif :" -:" If +lua feature supported, make lua.vim empty. -:if has("lua") | sp another | w! lua.vim | q | endif -:" :" If +eval feature supported quit here, leaving tiny.vim and small.vim empty. :" Otherwise write small.vim to skip the test. :if 1 | q! | endif diff --git a/src/version.c b/src/version.c index a1535f6822..f638db610a 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 185, /**/ 184, /**/ From 44a693a1bdfe987edb649677c94c214f94b2aada Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 14 Jul 2018 22:23:47 +0200 Subject: [PATCH 08/31] patch 8.1.0186: test for getwininfo() fails in GUI Problem: Test for getwininfo() fails in GUI. Solution: Account for missing tabline. --- src/testdir/test_bufwintabinfo.vim | 7 ++++--- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/testdir/test_bufwintabinfo.vim b/src/testdir/test_bufwintabinfo.vim index bcf3c52ed0..d88b061ac7 100644 --- a/src/testdir/test_bufwintabinfo.vim +++ b/src/testdir/test_bufwintabinfo.vim @@ -53,15 +53,16 @@ function Test_getbufwintabinfo() call assert_equal(5, len(winlist)) call assert_equal(winwidth(1), winlist[0].width) call assert_equal(0, winlist[0].wincol) - call assert_equal(1, winlist[0].winrow) " tabline adds one + let tablineheight = winlist[0].winrow == 1 ? 1 : 0 + call assert_equal(tablineheight, winlist[0].winrow) " tabline adds one call assert_equal(winbufnr(2), winlist[1].bufnr) call assert_equal(winheight(2), winlist[1].height) call assert_equal(0, winlist[1].wincol) - call assert_equal(winheight(1) + 2, winlist[1].winrow) + call assert_equal(tablineheight + winheight(1) + 1, winlist[1].winrow) call assert_equal(1, winlist[2].winnr) - call assert_equal(1, winlist[2].winrow) + call assert_equal(tablineheight, winlist[2].winrow) call assert_equal(0, winlist[2].wincol) call assert_equal(winlist[2].width + 1, winlist[3].wincol) diff --git a/src/version.c b/src/version.c index f638db610a..08e39b4d4d 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 186, /**/ 185, /**/ From 7132ddc1014a4e1230f0080e418221e5843e1277 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jul 2018 17:01:11 +0200 Subject: [PATCH 09/31] patch 8.1.0187: getwininfo() and win_screenpos() return different numbers Problem: getwininfo() and win_screenpos() return different numbers. Solution: Add one to "wincol" and "winrow" from getwininfo(). --- runtime/doc/eval.txt | 72 +++++++++++++++--------------- src/evalfunc.c | 4 +- src/testdir/test_bufwintabinfo.vim | 19 ++++---- src/version.c | 2 + 4 files changed, 51 insertions(+), 46 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 9394ece21f..5759815526 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2196,7 +2196,7 @@ gettabvar({nr}, {varname} [, {def}]) any variable {varname} in tab {nr} or {def} gettabwinvar({tabnr}, {winnr}, {name} [, {def}]) any {name} in {winnr} in tab page {tabnr} -getwininfo([{winid}]) List list of windows +getwininfo([{winid}]) List list of info about each window getwinpos([{timeout}]) List X and Y coord in pixels of the Vim window getwinposx() Number X coord in pixels of the Vim window getwinposy() Number Y coord in pixels of the Vim window @@ -4936,6 +4936,41 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* :let list_is_on = gettabwinvar(1, 2, '&list') :echo "myvar = " . gettabwinvar(3, 1, 'myvar') < +getwininfo([{winid}]) *getwininfo()* + Returns information about windows as a List with Dictionaries. + + If {winid} is given Information about the window with that ID + is returned. If the window does not exist the result is an + empty list. + + Without {winid} information about all the windows in all the + tab pages is returned. + + Each List item is a Dictionary with the following entries: + bufnr number of buffer in the window + height window height (excluding winbar) + winbar 1 if the window has a toolbar, 0 + otherwise + loclist 1 if showing a location list + {only with the +quickfix feature} + quickfix 1 if quickfix or location list window + {only with the +quickfix feature} + terminal 1 if a terminal window + {only with the +terminal feature} + tabnr tab page number + variables a reference to the dictionary with + window-local variables + width window width + wincol leftmost screen column of the window, + col from |win_screenpos()| + winid |window-ID| + winnr window number + winrow topmost screen column of the window, + row from |win_screenpos()| + + To obtain all window-local variables use: > + gettabwinvar({tabnr}, {winnr}, '&') + getwinpos([{timeout}]) *getwinpos()* The result is a list with two numbers, the result of getwinposx() and getwinposy() combined: @@ -4969,39 +5004,6 @@ getwinposy() The result is a Number, which is the Y coordinate in pixels of The result will be -1 if the information is not available. The value can be used with `:winpos`. -getwininfo([{winid}]) *getwininfo()* - Returns information about windows as a List with Dictionaries. - - If {winid} is given Information about the window with that ID - is returned. If the window does not exist the result is an - empty list. - - Without {winid} information about all the windows in all the - tab pages is returned. - - Each List item is a Dictionary with the following entries: - bufnr number of buffer in the window - height window height (excluding winbar) - winbar 1 if the window has a toolbar, 0 - otherwise - loclist 1 if showing a location list - {only with the +quickfix feature} - quickfix 1 if quickfix or location list window - {only with the +quickfix feature} - terminal 1 if a terminal window - {only with the +terminal feature} - tabnr tab page number - variables a reference to the dictionary with - window-local variables - width window width - wincol leftmost screen column of the window - winid |window-ID| - winnr window number - winrow topmost screen column of the window - - To obtain all window-local variables use: > - gettabwinvar({tabnr}, {winnr}, '&') - getwinvar({winnr}, {varname} [, {def}]) *getwinvar()* Like |gettabwinvar()| for the current tabpage. Examples: > @@ -9049,7 +9051,7 @@ win_id2win({expr}) *win_id2win()* win_screenpos({nr}) *win_screenpos()* Return the screen position of window {nr} as a list with two numbers: [row, col]. The first window always has position - [1, 1]. + [1, 1], unless there is a tabline, then it is [2, 1]. {nr} can be the window number or the |window-ID|. Return [0, 0] if the window cannot be found in the current tabpage. diff --git a/src/evalfunc.c b/src/evalfunc.c index 13c60b9930..2e06c2063d 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -5648,12 +5648,12 @@ get_win_info(win_T *wp, short tpnr, short winnr) dict_add_number(dict, "winnr", winnr); dict_add_number(dict, "winid", wp->w_id); dict_add_number(dict, "height", wp->w_height); - dict_add_number(dict, "winrow", wp->w_winrow); + dict_add_number(dict, "winrow", wp->w_winrow + 1); #ifdef FEAT_MENU dict_add_number(dict, "winbar", wp->w_winbar_height); #endif dict_add_number(dict, "width", wp->w_width); - dict_add_number(dict, "wincol", wp->w_wincol); + dict_add_number(dict, "wincol", wp->w_wincol + 1); dict_add_number(dict, "bufnr", wp->w_buffer->b_fnum); #ifdef FEAT_TERMINAL diff --git a/src/testdir/test_bufwintabinfo.vim b/src/testdir/test_bufwintabinfo.vim index d88b061ac7..0e8c7d1dc1 100644 --- a/src/testdir/test_bufwintabinfo.vim +++ b/src/testdir/test_bufwintabinfo.vim @@ -52,21 +52,22 @@ function Test_getbufwintabinfo() let winlist = getwininfo() call assert_equal(5, len(winlist)) call assert_equal(winwidth(1), winlist[0].width) - call assert_equal(0, winlist[0].wincol) - let tablineheight = winlist[0].winrow == 1 ? 1 : 0 - call assert_equal(tablineheight, winlist[0].winrow) " tabline adds one + call assert_equal(1, winlist[0].wincol) + " tabline adds one row in terminal, not in GUI + let tablineheight = winlist[0].winrow == 2 ? 1 : 0 + call assert_equal(tablineheight + 1, winlist[0].winrow) call assert_equal(winbufnr(2), winlist[1].bufnr) call assert_equal(winheight(2), winlist[1].height) - call assert_equal(0, winlist[1].wincol) - call assert_equal(tablineheight + winheight(1) + 1, winlist[1].winrow) + call assert_equal(1, winlist[1].wincol) + call assert_equal(tablineheight + winheight(1) + 2, winlist[1].winrow) call assert_equal(1, winlist[2].winnr) - call assert_equal(tablineheight, winlist[2].winrow) - call assert_equal(0, winlist[2].wincol) + call assert_equal(tablineheight + 1, winlist[2].winrow) + call assert_equal(1, winlist[2].wincol) - call assert_equal(winlist[2].width + 1, winlist[3].wincol) - call assert_equal(0, winlist[4].wincol) + call assert_equal(winlist[2].width + 2, winlist[3].wincol) + call assert_equal(1, winlist[4].wincol) call assert_equal(1, winlist[0].tabnr) call assert_equal(1, winlist[1].tabnr) diff --git a/src/version.c b/src/version.c index 08e39b4d4d..559d8bed53 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 187, /**/ 186, /**/ From 2196bca7377ff245866cc3cee65b0adb48432ac3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jul 2018 17:36:32 +0200 Subject: [PATCH 10/31] patch 8.1.0188: no test for ":cscope add" Problem: No test for ":cscope add". Solution: Add a test. (Dominique Pelle, closes #3212) --- src/testdir/test_cscope.vim | 18 ++++++++++++++++++ src/version.c | 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/testdir/test_cscope.vim b/src/testdir/test_cscope.vim index c6e54d73ec..71d5487ce3 100644 --- a/src/testdir/test_cscope.vim +++ b/src/testdir/test_cscope.vim @@ -254,7 +254,25 @@ func Test_cscopeWithCscopeConnections() " CleanUp call CscopeSetupOrClean(0) +endfunc +" Test ":cs add {dir}" (add the {dir}/cscope.out database) +func Test_cscope_add_dir() + call mkdir('Xcscopedir', 'p') + call system('cscope -bk -fXcscopedir/cscope.out ../memfile_test.c') + cs add Xcscopedir + let a = execute('cscope show') + let lines = split(a, "\n", 1) + call assert_equal(3, len(lines)) + call assert_equal(' # pid database name prepend path', lines[0]) + call assert_equal('', lines[1]) + call assert_match('^ 0 \d\+.*Xcscopedir/cscope.out\s\+$', lines[2]) + + cs kill -1 + call delete('Xcscopedir/cscope.out') + call assert_fails('cs add Xcscopedir', 'E563:') + + call delete('Xcscopedir', 'd') endfunc func Test_cscopequickfix() diff --git a/src/version.c b/src/version.c index 559d8bed53..892b9aea1d 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 188, /**/ 187, /**/ From b477af2260d9bc7ae7f743f0a14265d7ee12ee09 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jul 2018 20:20:18 +0200 Subject: [PATCH 11/31] Update runtime files. --- CONTRIBUTING.md | 15 +- runtime/doc/autocmd.txt | 2 +- runtime/doc/eval.txt | 13 +- runtime/doc/gui_w32.txt | 2 +- runtime/doc/motion.txt | 11 +- runtime/doc/netbeans.txt | 4 +- runtime/doc/starting.txt | 2 + runtime/doc/todo.txt | 36 +- runtime/doc/usr_09.txt | 7 +- runtime/doc/version5.txt | 4 +- runtime/doc/version6.txt | 2 +- runtime/doc/vim-da.1 | 555 +++++++++++++++++++++++++++++++ runtime/doc/vim-da.UTF-8.1 | 555 +++++++++++++++++++++++++++++++ runtime/doc/vimdiff-da.1 | 22 +- runtime/doc/vimdiff-da.UTF-8.1 | 22 +- runtime/doc/vimtutor-da.1 | 3 +- runtime/doc/vimtutor-da.UTF-8.1 | 3 +- runtime/gvim.desktop | 4 +- runtime/tools/unicode.vim | 2 +- runtime/tutor/tutor | 6 +- runtime/tutor/tutor.ca.utf-8 | 560 ++++++++++++++++---------------- runtime/tutor/tutor.de | 2 +- runtime/tutor/tutor.de.utf-8 | 2 +- runtime/tutor/tutor.es.utf-8 | 2 +- runtime/tutor/tutor.fr | 4 +- runtime/tutor/tutor.utf-8 | 80 ++--- runtime/tutor/tutor.zh.big5 | 2 +- runtime/vim.desktop | 4 +- src/po/sr.po | 17 +- 29 files changed, 1543 insertions(+), 400 deletions(-) create mode 100644 runtime/doc/vim-da.1 create mode 100644 runtime/doc/vim-da.UTF-8.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b03f03e68e..70b633b4d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,4 +51,17 @@ Look in the header of the file for the name and email address. The maintainer will take care of issues and send updates to Bram for distribution with Vim. -If the maintainer does not react, contact the vim-dev maillist. +If the maintainer does not respond, contact the vim-dev maillist. + + +# Translations + +Translating messages and runtime files is very much appreciated! These things can be translated: +* Messages in Vim, see src/po/README.txt +* Menus, see runtime/lang/README.txt +* Vim tutor, see runtime/tutor/README.txt +* Manual pages, see runtime/doc/*.1 for examples +* Desktop icon, see runtime/vim.desktop and runtime/gvim.desktop + +The help files can be translated and made available separately. +See https://www.vim.org/translations.php for examples. diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 0206e7efa9..051dedbdbd 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -345,7 +345,7 @@ Name triggered by ~ when popup menu is not visible |TextChangedP| after a change was made to the text in Insert mode when popup menu visible -|TextYankPost| after text is yanked or deleted +|TextYankPost| after text has been yanked or deleted |ColorSchemePre| before loading a color scheme |ColorScheme| after loading a color scheme diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5759815526..e665c3573f 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4936,6 +4936,9 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* :let list_is_on = gettabwinvar(1, 2, '&list') :echo "myvar = " . gettabwinvar(3, 1, 'myvar') < + To obtain all window-local variables use: > + gettabwinvar({tabnr}, {winnr}, '&') + getwininfo([{winid}]) *getwininfo()* Returns information about windows as a List with Dictionaries. @@ -4949,8 +4952,6 @@ getwininfo([{winid}]) *getwininfo()* Each List item is a Dictionary with the following entries: bufnr number of buffer in the window height window height (excluding winbar) - winbar 1 if the window has a toolbar, 0 - otherwise loclist 1 if showing a location list {only with the +quickfix feature} quickfix 1 if quickfix or location list window @@ -4961,6 +4962,8 @@ getwininfo([{winid}]) *getwininfo()* variables a reference to the dictionary with window-local variables width window width + winbar 1 if the window has a toolbar, 0 + otherwise wincol leftmost screen column of the window, col from |win_screenpos()| winid |window-ID| @@ -4968,9 +4971,6 @@ getwininfo([{winid}]) *getwininfo()* winrow topmost screen column of the window, row from |win_screenpos()| - To obtain all window-local variables use: > - gettabwinvar({tabnr}, {winnr}, '&') - getwinpos([{timeout}]) *getwinpos()* The result is a list with two numbers, the result of getwinposx() and getwinposy() combined: @@ -11580,7 +11580,7 @@ The sandbox is also used for the |:sandbox| command. These items are not allowed in the sandbox: - changing the buffer text - - defining or changing mapping, autocommands, functions, user commands + - defining or changing mapping, autocommands, user commands - setting certain options (see |option-summary|) - setting certain v: variables (see |v:var|) *E794* - executing a shell command @@ -11602,6 +11602,7 @@ location. Insecure in this context are: - sourcing a .vimrc or .exrc in the current directory - while executing in the sandbox - value coming from a modeline +- executing a function that was defined in the sandbox Note that when in the sandbox and saving an option value and restoring it, the option will still be marked as it was set in the sandbox. diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt index 9d676eaffc..7bd12aa610 100644 --- a/runtime/doc/gui_w32.txt +++ b/runtime/doc/gui_w32.txt @@ -442,7 +442,7 @@ with the Intellimouse driver 2.2 and when "Universal Scrolling" is turned on. XPM support *w32-xpm-support* -Gvim can be build on MS-Windows with support for XPM files. |+xpm_w32| +GVim can be build on MS-Windows with support for XPM files. |+xpm_w32| See the Make_mvc.mak file for instructions, search for XPM. To try out if XPM support works do this: > diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 25d87cfe99..9a5c494304 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1019,12 +1019,13 @@ These commands are not marks themselves, but jump to a mark: ============================================================================== 8. Jumps *jump-motions* -A "jump" is one of the following commands: "'", "`", "G", "/", "?", "n", -"N", "%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and -the commands that start editing a new file. If you make the cursor "jump" -with one of these commands, the position of the cursor before the jump is +A "jump" is a command that normally moves the cursor several lines away. If +you make the cursor "jump" the position of the cursor before the jump is remembered. You can return to that position with the "''" and "``" command, -unless the line containing that position was changed or deleted. +unless the line containing that position was changed or deleted. The +following commands are "jump" commands: "'", "`", "G", "/", "?", "n", "N", +"%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and the +commands that start editing a new file. *CTRL-O* CTRL-O Go to [count] Older cursor position in jump list diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt index 3e99f8b2bc..25fba4d5a2 100644 --- a/runtime/doc/netbeans.txt +++ b/runtime/doc/netbeans.txt @@ -409,9 +409,9 @@ defineAnnoType typeNum typeName tooltip glyphFile fg bg Vim will define a sign for the annotation. When color is a number, this is the "#rrggbb" Red, Green and Blue values of the color (see |gui-colors|) and the - highlighting is only defined for GVim. + highlighting is only defined for gVim. When color is a name, this color is defined both for Vim - running in a color terminal and for GVim. + running in a color terminal and for gVim. When both "fg" and "bg" are "none" no line highlighting is used (new in version 2.1). When "glyphFile" is empty, no text sign is used (new in diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 0c15a1e096..47c032994c 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1594,6 +1594,8 @@ VIMINFO FILE NAME *viminfo-file-name* - The "-i" Vim argument can be used to set another file name, |-i|. When the file name given is "NONE" (all uppercase), no viminfo file is ever read or written. Also not for the commands below! +- The 'viminfofile' option can be used like the "-i" argument. In fact, the + value form the "-i" argument is stored in the 'viminfofile' option. - For the commands below, another file name can be given, overriding the default and the name given with 'viminfo' or "-i" (unless it's NONE). diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index a397157991..38cc9a14bf 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -38,7 +38,9 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- -testdir: remove use of lua.vim from makefiles and test1.in +Crash when ui_breakcheck() called from regexec() calls regexec() recursively. +(Andy Massimino, #3175) +Make regexp work recursively, store all globals in "rex"? Prompt buffer: - Add a command line history. @@ -88,12 +90,17 @@ On Win32 when not in the console and t_Co >= 256, allow using 'tgc'. Errors found with random data: heap-buffer-overflow in alist_add (#2472) +Patch to fix that +packages is always in output of :version. +(thinca, #3198) reported by Takuya Fujiwara + More warnings from static analysis: https://lgtm.com/projects/g/vim/vim/alerts/?mode=list Pasting foo} causes Vim to behave weird. (John Little, 2018 Jun 17) Related to bracketed paste. I cannot reproduce it. +Patch replacing imp with importlib. (#3163) + Using ":file" in quickfix window during an autocommand doesn't work. (Jason Franklin, 2018 May 23) Allow for using it when there is no argument. @@ -105,8 +112,6 @@ Shafran, 2018 Jun 23, #3072) Proposed patch by Aidan, 2018 Jun 24. Patch to set w_set_curswant when setting the cursor in language interfaces. (David Hotham, 2018 Jun 22, #3060) -Patch for Lua 5.3. (Ken Takata, 2018 Jul 5, #3157) - Patch to make CTRL-W work properly in a quickfix window. (Jason Franklin, 2018 May 30) @@ -127,6 +132,8 @@ Patch to make :help work for tags with a ?. (Hirohito Higashi, 2018 May 28) Patch to adjust to DPI setting for GTK. (Roel van de Kraats, 2017 Nov 20, #2357) +Patch to fix window size when using VTP. (Nobuhiro Takasaki, #3164) + Compiler warnings (geeknik, 2017 Oct 26): - signed integer overflow in do_sub() (#2249) - signed integer overflow in get_address() (#2248) @@ -146,6 +153,10 @@ Patch to stack and pop the window title and icon. (IWAMOTO Kouichi, 2018 Jun need to use X11 calls. This returns "]l{title}\". Using title stack probably works better. +When a function is defined in the sandbox (with :function or as a lambda) +always execute it in the sandbox. (#3182) +Remove "safe" argument from call_vim_function(), it's always FALSE. + Make balloon_show() work outside of 'balloonexpr'? Users expect it to work: #2948. (related to #1512?) On Win32 it stops showing, because showState is already ShS_SHOWING. @@ -178,6 +189,8 @@ script or function. Universal solution to detect if t_RS is working, using cursor position. Koichi Iwamoto, #2126 +Patch to fix profiling condition lines. (Ozaki Kiichi,, 2017 Dec 26, #2499) + When using a menu item while the "more" prompt is displayed doesn't work well. E.g. after using help->version. Have a key that ends the "more" prompt and does nothing otherwise? @@ -249,6 +262,7 @@ sequence of these commands. (Andy Stewart, 2018 Mar 16) ch_sendraw() with long string does not try to read in between, which may cause a deadlock if the reading side is waiting for the write to finish. (Nate Bosch, 2018 Jan 13, #2548) +Perhaps just make chunks of 1024 bytes? Patch to include a cfilter plugin to filter quickfix/location lists. (Yegappan Lakshmanan, 2018 May 12) @@ -406,9 +420,6 @@ Perhaps use a vimcontext / endvimcontext command block. After using :noautocmd CursorMoved may still trigger. (Andy Stewart, 2017 Sep 13, #2084). Set old position after the command. -Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28) -Still happens (2017 Jul 9) - When bracketed paste is used, pasting at the ":append" prompt does not get the line breaks. (Ken Takata, 2017 Aug 22) @@ -720,8 +731,6 @@ Does this also fix #1408 ? Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30) -Patch to fix profiling condition lines. (Ozaki Kiichi,, 2017 Dec 26, #2499) - Patch to be able to separately map CTRL-H and BS on Windows. (Linwei, 2017 Jul 11, #1833) @@ -1018,9 +1027,6 @@ Added tests (James McCoy, 2016 Aug 3). Still needs more work. Feature request: add the "al" text object, to manipulate a screen line. Especially useful when using 'linebreak' -Access to uninitialized memory in match_backref() regexp_nda.c:4882 -(Dominique Pelle, 2015 Nov 6) - ":cd C:\Windows\System32\drivers\etc*" does not work, even though the directory exists. (Sergio Gallelli, 2013 Dec 29) @@ -1070,7 +1076,7 @@ Patch to add TagNotFound autocommand. (Anton Lindqvist, 2016 Feb 3) Patch to add Error autocommand. (Anton Lindqvist, 2016 Feb 17) Only remembers one error. -Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab. +GVim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab. Unexpected delay when using CTRL-O u. It's not timeoutlen. (Gary Johnson, 2015 Aug 28) @@ -1854,7 +1860,7 @@ accented character. (Tony Mechelynck, 2010 Apr 15) Don't call check_restricted() for histadd(), setbufvar(), settabvar(), setwinvar(). -Patch for GVimExt to show an icon. (Dominik Riebeling, 2010 Nov 7) +Patch for gVimExt to show an icon. (Dominik Riebeling, 2010 Nov 7) When 'lines' is 25 and 'scrolloff' is 12, "j" scrolls zero or two lines instead of one. (Constantin Pan, 2010 Sep 10) @@ -2437,7 +2443,7 @@ go to Insert mode and add a few lines. Then backspacing every other time moves the cursor instead of deleting. (Chris Kaiser, 2007 Sep 25) Windows installer could add a "open in new tab of existing Vim" menu entry. -Gvimext: patch to add "Edit with single Vim &tabbed" menu entry. +GvimExt: patch to add "Edit with single Vim &tabbed" menu entry. Just have two choices, always using one Vim and selecting between using an argument list or opening each file in a separate tab. (Erik Falor, 2008 May 21, 2008 Jun 26) @@ -2513,7 +2519,7 @@ C++ indenting wrong with "=". (James Kanze, 2007 Jan 26) When using --remote-silent and the file name matches 'wildignore' get an E479 error. without --remote-silent it works fine. (Ben Fritz, 2008 Jun 20) -Gvim: dialog for closing Vim should check if Vim is busy writing a file. Then +GVim: dialog for closing Vim should check if Vim is busy writing a file. Then use a different dialog: "busy saving, really quit? yes / no". Check other interfaces for changing curbuf in a wrong way. Patch like for diff --git a/runtime/doc/usr_09.txt b/runtime/doc/usr_09.txt index ee33f941f0..1bc7aff98c 100644 --- a/runtime/doc/usr_09.txt +++ b/runtime/doc/usr_09.txt @@ -5,9 +5,10 @@ Using the GUI -Vim works in an ordinary terminal. GVim can do the same things and a few -more. The GUI offers menus, a toolbar, scrollbars and other items. This -chapter is about these extra things that the GUI offers. +Vim works in an ordinary terminal, while gVim has a Graphical User Interface +(GUI). It can do the same things and a few more. The GUI offers menus, a +toolbar, scrollbars and other items. This chapter is about these extra things +that the GUI offers. |09.1| Parts of the GUI |09.2| Using the mouse diff --git a/runtime/doc/version5.txt b/runtime/doc/version5.txt index f87d904df9..075e583105 100644 --- a/runtime/doc/version5.txt +++ b/runtime/doc/version5.txt @@ -2347,7 +2347,7 @@ Added *added-5.2* Support for mapping numeric keypad +,-,*,/ keys. (Negri) When not mapped, they produce the normal character. -Win32 GUI: When directory dropped on Gvim, cd there and edit new buffer. +Win32 GUI: When directory dropped on gVim, cd there and edit new buffer. (Negri) Win32 GUI: Made CTRL-Break work as interrupt, so that CTRL-C can be @@ -7615,7 +7615,7 @@ VMS doesn't always have lstat(), added an #ifdef around it. Added a few corrections for the Macintosh. (Axel Kielhorn) -Win32: Gvimext could not edit more than a few files at once, the length of the +Win32: GvimExt could not edit more than a few files at once, the length of the argument was fixed. diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt index 5335895854..a4dd5e65fe 100644 --- a/runtime/doc/version6.txt +++ b/runtime/doc/version6.txt @@ -2967,7 +2967,7 @@ DOS and Windows: Expanding *.vim also matched file.vimfoo. Expand path like Unix to avoid problems with Windows dir functions. Merged the DOS and Win32 functions. -Win32: Gvimext could not edit more than a few files at once, the length of the +Win32: GvimExt could not edit more than a few files at once, the length of the argument was fixed. "ls -1 * | xargs vim" worked, but the input was in cooked mode. Now switch to diff --git a/runtime/doc/vim-da.1 b/runtime/doc/vim-da.1 new file mode 100644 index 0000000000..cc272ada35 --- /dev/null +++ b/runtime/doc/vim-da.1 @@ -0,0 +1,555 @@ +.TH VIM 1 "11. april 2006" +.SH NAVN +vim \- Vi IMproved, en programmrs teksteditor +.SH SYNOPSIS +.br +.B vim +[tilvalg] [fil ..] +.br +.B vim +[tilvalg] \- +.br +.B vim +[tilvalg] \-t tag +.br +.B vim +[tilvalg] \-q [fejlfil] +.PP +.br +.B ex +.br +.B view +.br +.B gvim +.B gview +.B evim +.B eview +.br +.B rvim +.B rview +.B rgvim +.B rgview +.SH BESKRIVELSE +.B Vim +er en teksteditor som er opad kompatibel med Vi. +Den kan bruges til at redigere alle slags ren tekst. +Den er srlig nyttig til at redigere programmer. +.PP +Der er mange forbedringer over Vi: multiniveau fortryd, +multivinduer og -buffere, syntaksfremhvning, redigering af kommandolinje, +fuldfrelse af filnavn, onlinehjlp, visuel markering, osv. +Se ":help vi_diff.txt" for et overblik over forskellene mellem +.B Vim +og Vi. +.PP +Mens +.B Vim +krer, kan der indhentes massere af hjlp fra online-hjlpesystemet, med +":help"-kommandoen. +Se ONLINEHJLP-sektionen nedenfor. +.PP +Oftest startes +.B Vim +for at redigere en enkelt fil med kommandoen +.PP + vim fil +.PP +Mere generelt startes +.B Vim +med: +.PP + vim [tilvalg] [filliste] +.PP +Hvis fillisten mangler, s startes editoren med en tom buffer. +Ellers kan n af flgende fire mder bruges til at vlge en eller +flere filer som skal redigeres. +.TP 12 +fil .. +En liste over filnavne. +Den frste bliver den nuvrende fil og lses ind i bufferen. +Markren placeres p den frste linje i bufferen. +Du kan g til de andre filer med ":next"-kommandoen. Skriv "\-\-" foran +fillisten, for at redigere en fil som begynder med en bindestreg. +.TP +\- +Filen som skal redigeres lses fra stdin. Kommandoer lses fra stderr, hvilket +skal vre en tty. +.TP +\-t {tag} +Filen som skal redigeres og den indledende markrplacering afhnger af +et "tag", en slags g til-etiket. +{tag} opsls i tags-filen, den tilknyttede fil bliver den nuvrende +fil og den tilknyttede kommando udfres. +Det bruges mest til C-programmer, hvor {tag} kunne vre et +funktionsnavn. +Virkningen er at filen som indeholder funktionen bliver den nuvrende fil +og markren placeres i begyndelsen af funktionen. +Se ":help tag\-commands". +.TP +\-q [fejlfil] +Start i quickFix-tilstand. +Filen [fejlfil] lses og den frste fejl vises. +Hvis [fejlfil] udelades, s indhentes filnavnet fra 'errorfile'-valgmuligheden +(standard er "AztecC.Err" p Amiga, "errors.err" p andre +systemer). +Der kan hoppes til yderligere fejl med ":cn"-kommandoen. +Se ":help quickfix". +.PP +.B Vim +opfrer sig anderledes, afhngig af navnet p kommandoen (eksekverbaren kan +stadig vre den samme fil). +.TP 10 +vim +Den "normale" mde, alt er standard. +.TP +ex +Start i Ex-tilstand. +G til normal tilstand med ":vi"-kommandoen. +Det kan ogs gres med "\-e"-argumentet. +.TP +view +Start i skrivebeskyttet tilstand. Du vil vre beskyttet mod at skrive filerne. +Det kan ogs gres med "\-R"-argumentet. +.TP +gvim gview +GUI-versionen. +Starter et nyt vindue. +Det kan ogs gres med "\-g"-argumentet. +.TP +evim eview +GUI-versionen i easy-tilstand. +Starter et nyt vindue. +Det kan ogs gres med "\-y"-argumentet. +.TP +rvim rview rgvim rgview +Som dem ovenfor, men med restriktioner. Det vil ikke vre muligt at starte +skalkommandoer, eller at suspendere +.B Vim\c +\&. +Det kan ogs gres med "\-Z"-argumentet. +.SH TILVALG +Tilvalgene kan gives i vilkrlig rkkeflge, fr eller efter filnavnene. +Tilvalg uden et argument kan kombineres efter en enkelt bindestreg. +.TP 12 ++[nummer] +Ved den frste fil, placeres markren p linje "nummer". +Hvis "nummer" mangler, s placeres markren p den sidste linje. +.TP ++/{sti} +Ved den frste fil, placeres markren p linjen med den +frste forekomst af {sti}. +Se ":help search\-pattern" for tilgngelige sgemnstre. +.TP ++{kommando} +.TP +\-c {kommando} +{kommando} udfres efter den frste fil er blevet lst. +{kommando} fortolkes som en Ex-kommando. +Hvis {kommando} indeholder mellemrum, s skal den omsluttes af +dobbelte citationstegn (det afhnger af den skal der bruges). +Eksempel: Vim "+set si" main.c +.br +Bemrk: Du kan bruge op til 10 "+"- eller "\-c"-kommandoer. +.TP +\-S {fil} +{fil} bliver sourced efter den frste fil er blevet lst. +Det svarer til \-c "source {fil}". +{fil} m ikke begynde med '\-'. +Hvis {fil} udelades, s bruges "Session.vim" (virker kun nr \-S er det sidste +argument). +.TP +\-\-cmd {kommando} +Ligesom at bruge "\-c", men kommandoen udfres lige inden +behandlingen af vimrc-filer. +Du kan bruge op til 10 af disse kommandoer, uafhngigt af "\-c"-kommandoer. +.TP +\-A +Hvis +.B Vim +blev kompileret med understttelse af ARABIC til redigering af filer som er +orienteret hjre mod venstre og arabisk tastaturlayout, s starter tilvalget +.B Vim +i arabisk tilstand, dvs. 'arabic' sttes. +Ellers gives en fejlmeddelelse og +.B Vim +afbrydes. +.TP +\-b +Binr tilstand. +Der sttes nogle f valgmuligheder som gr det muligt at redigere en +binr eller eksekverbar fil. +.TP +\-C +Kompatibel. St 'compatible'-valgmuligheden. +Det fr +.B Vim +til at opfre sig mest som Vi, selvom der findes en .vimrc-fil. +.TP +\-d +Start i diff-tilstand. +Der skal vre to, tre eller fire filnavneargumenter. +.B Vim +bner alle filerne og viser forskellene mellem dem. +Virker ligesom vimdiff(1). +.TP +\-d {enhed} +bn {enhed} til brug som en terminal. +Kun p Amiga. +Eksempel: +"\-d con:20/30/600/150". +.TP +\-D +Fejlretning. G til fejlretningstilstand nr den frste kommando udfres fra +et script. +.TP +\-e +Start +.B Vim +i Ex-tilstand, ligesom hvis "ex"-eksekverbaren blev kaldt. +.TP +\-E +Start +.B Vim +i forbedret Ex-tilstand, ligesom hvis "exim"-eksekverbaren blev kaldt. +.TP +\-f +Forgrund. I GUI-versionen, vil +.B Vim +ikke fork'e og frigre fra skallen som den blev startet i. +P Amiga, genstartes +.B Vim +ikke for at bne et nyt vindue. +Tilvalget br bruges nr +.B Vim +udfres af et program der venter p at redigeringssession +bliver frdig (f.eks. mail). +P Amiga virker ":sh"- og ":!"-kommandoerne ikke. +.TP +\-\-nofork +Forgrund. I GUI-versionen, vil +.B Vim +ikke fork'e og frigre fra skallen som den blev startet i. +.TP +\-F +Hvis +.B Vim +blev kompileret med understttelse af FKMAP til redigering af filer som er +orienteret hjre mod venstre og persisk tastaturlayout, s starter tilvalget +.B Vim +i persisk tilstand, dvs. 'fkmap' og 'rightleft' sttes. +Ellers gives en fejlmeddelelse og +.B Vim +afbrydes. +.TP +\-g +Hvis +.B Vim +blev kompileret med understttelse af GUI, s aktiveres GUI'en af +denne valgmulighed. Hvis understttelse af GUI ikke blev kompileret ind, +s gives en fejlmeddelelse og +.B Vim +afbrydes. +.TP +\-h +Giv lidt hjlp om kommandolinjeargumenterne og tilvalgene. +Herefter afsluttes +.B Vim\c +\&. +.TP +\-H +Hvis +.B Vim +blev kompileret med understttelse af RIGHTLEFT til redigering af filer som er +orienteret hjre mod venstre og hebraisk tastaturlayout, s starter tilvalget +.B Vim +i hebraisk tilstand, dvs. 'hkmap' og 'rightleft' sttes. +Ellers gives en fejlmeddelelse og +.B Vim +afbrydes. +.TP +\-i {viminfo} +Nr brug af viminfo-filen er aktiveret, s stter tilvalget det +filnavn som skal bruges, i stedet for standarden "~/.viminfo". +Det kan ogs bruges til at springe brugen af .viminfo-filen over, +ved at give navnet "NONE". +.TP +\-L +Samme som \-r. +.TP +\-l +Lisp-tilstand. +Stter 'lisp'- og 'showmatch'-valgmulighederne til. +.TP +\-m +ndring af filer er deaktiveret. +Nulstiller 'write'-valgmuligheden. +Du kan stadig ndre bufferen, men det er ikke muligt at skrive en fil. +.TP +\-M +ndringer tillades ikke. 'modifiable'- og 'write'-valgmulighederne fjernes, +s ndringer ikke er tilladt og filer ikke kan skrives. Bemrk at +valgmulighederne kan sttes for at gre det muligt at foretage ndringer. +.TP +\-N +No-compatible-tilstand. Nulstil 'compatible'-valgmuligheden. +Det fr +.B Vim +til at opfre sig en smule bedre, men mindre Vi-kompatibel, selvom der ikke +findes en .vimrc-fil. +.TP +\-n +Der bruges ingen swap-fil. +Det er umuligt at gendanne efter programmet er holdt op med at virke. +God hvis du vil redigere en fil p et meget langsomt medie (f.eks. floppy). +Kan ogs gres med ":set uc=0". +Kan fortrydes med ":set uc=200". +.TP +\-nb +Bliv en editor-server til NetBeans. Se dokumentationen for detaljer. +.TP +\-o[N] +bn N vinduer stablet. +Nr N udelades, s bnes t vindue pr. fil. +.TP +\-O[N] +bn N vinduer side om side. +Nr N udelades, s bnes t vindue pr. fil. +.TP +\-p[N] +bn N fanebladssider. +Nr N udelades, s bnes n fanebladsside pr. fil. +.TP +\-R +Skrivebeskyttet tilstand. +'readonly'-valgmuligheden sttes. +Du kan stadig redigere bufferen, men vil vre forhindret i +fejlagtigt at overskrive en fil. +Hvis du vil overskrive en fil, s tilfj et +udrbstegn til Ex-kommandoen, som i ":w!". +\-R-tilvalget indebrer ogs \-n-tilvalget (se ovenfor). +'readonly'-valgmuligheden kan sls fra med ":set noro". +Se ":help 'readonly'". +.TP +\-r +Oplist swap-filer, med information om at bruge dem til gendannelse. +.TP +\-r {fil} +Gendannelsestilstand. +Swap-filen bruges til at gendanne en redigeringssession som holdt +op med at virke. Swap-filen er en fil med det samme filnavn som tekstfilen, +med ".swp" tilfjet i slutningen. +Se ":help recovery". +.TP +\-s +Stille tilstand. Kun nr der startes som "Ex" eller +nr "\-e"-tilvalget blev givet inden "\-s"-tilvalget. +.TP +\-s {scriptind} +Script-filen {scriptind} lses. +Tegnene i filen fortolkes som havde du skrevet dem. +Det samme kan gres med kommandoen ":source! {scriptind}". +Hvis slutningen af filen ns inden editoren afslutter, +s lses yderligere tegn fra tastaturet. +.TP +\-T {terminal} +Fortller +.B Vim +navnet p terminalen som du bruger. +Krves kun nr den automatisk mde ikke virker. +Skal vre en terminal som kendes af +.B Vim +(indbygget) eller defineret i termcap- eller terminfo-filen. +.TP +\-u {vimrc} +Brug kommandoerne i {vimrc}-filen til initialiseringer. +Alle de andre initialiseringer springes over. +Brug den til at redigere en srlig slags filer. +Den kan ogs bruges til at springe alle initialiseringer over, +ved at give navnet "NONE". Se ":help initialization" i vim for flere detaljer. +.TP +\-U {gvimrc} +Brug kommandoerne i {gvimrc}-filen til GUI-initialiseringer. +Alle de andre GUI-initialiseringer springes over. +Den kan ogs bruges til at springe alle GUI-initialiseringer over, +ved at give navnet "NONE". Se ":help gui\-init" i vim for flere detaljer. +.TP +\-V[N] +Uddybende. Giv meddelelser om hvilke filer som er sourced og til lsning og +skrivning af en viminfo-fil. Det valgfrie nummer N er vrdien af 'verbose'. +Standard er 10. +.TP +\-v +Start +.B Vim +i Vi-tilstand, ligesom eksekverbaren kaldet "vi". Det har kun virkning nr +eksekverbaren kaldes "ex". +.TP +\-w {scriptud} +Alle tegnene som du skrev optages i filen {scriptud}, indtil du afslutter +.B Vim\c +\&. +Det er nyttigt hvis du vil oprette en script-fil som skal bruges med +"vim \-s" eller ":source!". +Hvis {scriptud}-filen findes, s tilfjes tegnene til slutningen. +.TP +\-W {scriptud} +Ligesom \-w, men en eksisterende fil overskrives. +.TP +\-x +Brug kryptering nr der skrives filer. Sprger efter en krypteringsngle. +.TP +\-X +Opret ikke forbindelse til X-serveren. Afkorter opstartstiden i en terminal, +men vinduets titel og udklipsholder bruges ikke. +.TP +\-y +Start +.B Vim +i easy-tilstand, ligesom hvis "evim"- eller "eview"-eksekverbarene blev kaldt. +Fr +.B Vim +til at opfre sig som en klik og skriv-editor. +.TP +\-Z +Restriktiv tilstand. Virker ligesom eksekverbaren som begynder med "r". +.TP +\-\- +Betegner slutningen af tilvalgene. +Argumenter efter dette hndteres som et filnavn. +Det kan bruges til at redigere et filnavn som begynder med et '\-'. +.TP +\-\-echo\-wid +Kun GTK GUI: Ekko vinduets id p stdout. +.TP +\-\-help +Giv en hjlpemeddelelse og afslut, ligesom "\-h". +.TP +\-\-literal +Tag filnavnets argumenter bogstaveligt, udvid ikke jokertegn. +Det har ingen virkning i Unix hvor skallen udvidder jokertegn. +.TP +\-\-noplugin +Spring indlsning af plugins over. Indebres af \-u NONE. +.TP +\-\-remote +Opret forbindelse til en Vim-server og f den til at redigere filerne +som gives i resten af argumenterne. Hvis der ikke findes nogen server, +s gives der en advarsel og filerne redigeres i den nuvrende Vim. +.TP +\-\-remote\-expr {udtryk} +Opret forbindelse til en Vim-server, evaluer +{udtryk} i den og udskriv resultatet p stdout. +.TP +\-\-remote\-send {ngler} +Opret forbindelse til en Vim-server and send {ngler} til den. +.TP +\-\-remote\-silent +Som \-\-remote, men uden advarslen nr der ikke findes nogen server. +.TP +\-\-remote\-wait +Som \-\-remote, men Vim afslutter ikke fr filerne er blevet redigeret. +.TP +\-\-remote\-wait\-silent +Som \-\-remote\-wait, men uden advarslen nr der ikke findes nogen server. +.TP +\-\-serverlist +Oplist navnene p alle Vim-servere som der kan findes. +.TP +\-\-servername {navn} +Brug servernavnet {navn}. Bruges til den nuvrende Vim, +medmindre det bruges med et \-\-remote-argument, +s er det navnet p serveren som der skal oprettes forbindelse til. +.TP +\-\-socketid {id} +Kun GTK GUI: Brug GtkPlug-mekanismen til at kre gvim i et andet vindue. +.TP +\-\-version +Udskriv versionsinformation og afslut. +.SH ONLINEHJLP +Skriv ":help" i +.B Vim +for at begynde. +Skriv ":help emne" for at f hjlp til et bestemt emne. +F.eks.: ":help ZZ" for at f hjlpe til "ZZ"-kommandoen. +Brug og CTRL-D for at fuldfre emner (":help cmdline\-completion"). +Tags findes til at hoppe fra et sted til et andet (en slags hypertekst-links, +se ":help"). +Alle dokumentationsfiler kan vises p denne mde, f.eks. +":help syntax.txt". +.SH FILER +.TP 15 +/usr/local/lib/vim/doc/*.txt +.B Vim\c +-dokumentationsfilerne. +Brug ":help doc\-file\-list" for at f den fulde liste. +.TP +/usr/local/lib/vim/doc/tags +Tags-filen som bruges til at finde information i dokumentationsfilerne. +.TP +/usr/local/lib/vim/syntax/syntax.vim +Systembrede syntaksinitialiseringer. +.TP +/usr/local/lib/vim/syntax/*.vim +Syntaksfiler til diverse sprog. +.TP +/usr/local/lib/vim/vimrc +Systembrede +.B Vim\c +-initialiseringer. +.TP +~/.vimrc +Dine personlige +.B Vim\c +-initialiseringer. +.TP +/usr/local/lib/vim/gvimrc +Systembrede gvim-initialiseringer. +.TP +~/.gvimrc +Dine personlige gvim-initialiseringer. +.TP +/usr/local/lib/vim/optwin.vim +Script som bruges til ":options"-kommandoen, +en god mde til at vise og stte valgmuligheder. +.TP +/usr/local/lib/vim/menu.vim +Systembrede menu-initialiseringer til gvim. +.TP +/usr/local/lib/vim/bugreport.vim +Script til at generere en fejlrapport. Se ":help bugs". +.TP +/usr/local/lib/vim/filetype.vim +Script til at registrere filtypen ud fra navnet. Se ":help 'filetype'". +.TP +/usr/local/lib/vim/scripts.vim +Script til at registrere filtypen ud fra indholdet. Se ":help 'filetype'". +.TP +/usr/local/lib/vim/print/*.ps +Filer som bruges til PostScript-udskrivning. +.PP +Ls VIM-hjemmesiden for seneste info: +.br + +.SH SE OGS +vimtutor(1) +.SH FORFATTER +Det meste af +.B Vim +blev lavet af Bram Moolenaar, med en masse hjlp fra andre. +Se ":help credits" i +.B Vim\c +\&. +.br +.B Vim +er baseret p Stevie, arbejdet p af: Tim Thompson, +Tony Andrews og G.R. (Fred) Walter. +Selvom der nsten ikke er noget af den originale kode tilbage. +.SH FEJL +Formodentligt. +Se ":help todo" for en liste over kendte problemer. +.PP +Bemrk at flere ting som af nogle kan anses som vrende fejl, +faktisk er pga. en for nr reproduktion af Vi's opfrsel. +Og hvis du tnker at andre ting er fejl "fordi Vi gr det anderledes", +s kig nrmere p vi_diff.txt-filen (eller skriv :help vi_diff.txt i Vim). +Se ogs 'compatible'- og 'cpoptions'-valgmulighederne. diff --git a/runtime/doc/vim-da.UTF-8.1 b/runtime/doc/vim-da.UTF-8.1 new file mode 100644 index 0000000000..451c30f116 --- /dev/null +++ b/runtime/doc/vim-da.UTF-8.1 @@ -0,0 +1,555 @@ +.TH VIM 1 "11. april 2006" +.SH NAVN +vim \- Vi IMproved, en programmørs teksteditor +.SH SYNOPSIS +.br +.B vim +[tilvalg] [fil ..] +.br +.B vim +[tilvalg] \- +.br +.B vim +[tilvalg] \-t tag +.br +.B vim +[tilvalg] \-q [fejlfil] +.PP +.br +.B ex +.br +.B view +.br +.B gvim +.B gview +.B evim +.B eview +.br +.B rvim +.B rview +.B rgvim +.B rgview +.SH BESKRIVELSE +.B Vim +er en teksteditor som er opad kompatibel med Vi. +Den kan bruges til at redigere alle slags ren tekst. +Den er særlig nyttig til at redigere programmer. +.PP +Der er mange forbedringer over Vi: multiniveau fortryd, +multivinduer og -buffere, syntaksfremhævning, redigering af kommandolinje, +fuldførelse af filnavn, onlinehjælp, visuel markering, osv. +Se ":help vi_diff.txt" for et overblik over forskellene mellem +.B Vim +og Vi. +.PP +Mens +.B Vim +kører, kan der indhentes massere af hjælp fra online-hjælpesystemet, med +":help"-kommandoen. +Se ONLINEHJÆLP-sektionen nedenfor. +.PP +Oftest startes +.B Vim +for at redigere en enkelt fil med kommandoen +.PP + vim fil +.PP +Mere generelt startes +.B Vim +med: +.PP + vim [tilvalg] [filliste] +.PP +Hvis fillisten mangler, så startes editoren med en tom buffer. +Ellers kan én af følgende fire måder bruges til at vælge en eller +flere filer som skal redigeres. +.TP 12 +fil .. +En liste over filnavne. +Den første bliver den nuværende fil og læses ind i bufferen. +Markøren placeres på den første linje i bufferen. +Du kan gå til de andre filer med ":next"-kommandoen. Skriv "\-\-" foran +fillisten, for at redigere en fil som begynder med en bindestreg. +.TP +\- +Filen som skal redigeres læses fra stdin. Kommandoer læses fra stderr, hvilket +skal være en tty. +.TP +\-t {tag} +Filen som skal redigeres og den indledende markørplacering afhænger af +et "tag", en slags gå til-etiket. +{tag} opslås i tags-filen, den tilknyttede fil bliver den nuværende +fil og den tilknyttede kommando udføres. +Det bruges mest til C-programmer, hvor {tag} kunne være et +funktionsnavn. +Virkningen er at filen som indeholder funktionen bliver den nuværende fil +og markøren placeres i begyndelsen af funktionen. +Se ":help tag\-commands". +.TP +\-q [fejlfil] +Start i quickFix-tilstand. +Filen [fejlfil] læses og den første fejl vises. +Hvis [fejlfil] udelades, så indhentes filnavnet fra 'errorfile'-valgmuligheden +(standard er "AztecC.Err" på Amiga, "errors.err" på andre +systemer). +Der kan hoppes til yderligere fejl med ":cn"-kommandoen. +Se ":help quickfix". +.PP +.B Vim +opfører sig anderledes, afhængig af navnet på kommandoen (eksekverbaren kan +stadig være den samme fil). +.TP 10 +vim +Den "normale" måde, alt er standard. +.TP +ex +Start i Ex-tilstand. +Gå til normal tilstand med ":vi"-kommandoen. +Det kan også gøres med "\-e"-argumentet. +.TP +view +Start i skrivebeskyttet tilstand. Du vil være beskyttet mod at skrive filerne. +Det kan også gøres med "\-R"-argumentet. +.TP +gvim gview +GUI-versionen. +Starter et nyt vindue. +Det kan også gøres med "\-g"-argumentet. +.TP +evim eview +GUI-versionen i easy-tilstand. +Starter et nyt vindue. +Det kan også gøres med "\-y"-argumentet. +.TP +rvim rview rgvim rgview +Som dem ovenfor, men med restriktioner. Det vil ikke være muligt at starte +skalkommandoer, eller at suspendere +.B Vim\c +\&. +Det kan også gøres med "\-Z"-argumentet. +.SH TILVALG +Tilvalgene kan gives i vilkårlig rækkefølge, før eller efter filnavnene. +Tilvalg uden et argument kan kombineres efter en enkelt bindestreg. +.TP 12 ++[nummer] +Ved den første fil, placeres markøren på linje "nummer". +Hvis "nummer" mangler, så placeres markøren på den sidste linje. +.TP ++/{sti} +Ved den første fil, placeres markøren på linjen med den +første forekomst af {sti}. +Se ":help search\-pattern" for tilgængelige søgemønstre. +.TP ++{kommando} +.TP +\-c {kommando} +{kommando} udføres efter den første fil er blevet læst. +{kommando} fortolkes som en Ex-kommando. +Hvis {kommando} indeholder mellemrum, så skal den omsluttes af +dobbelte citationstegn (det afhænger af den skal der bruges). +Eksempel: Vim "+set si" main.c +.br +Bemærk: Du kan bruge op til 10 "+"- eller "\-c"-kommandoer. +.TP +\-S {fil} +{fil} bliver sourced efter den første fil er blevet læst. +Det svarer til \-c "source {fil}". +{fil} må ikke begynde med '\-'. +Hvis {fil} udelades, så bruges "Session.vim" (virker kun når \-S er det sidste +argument). +.TP +\-\-cmd {kommando} +Ligesom at bruge "\-c", men kommandoen udføres lige inden +behandlingen af vimrc-filer. +Du kan bruge op til 10 af disse kommandoer, uafhængigt af "\-c"-kommandoer. +.TP +\-A +Hvis +.B Vim +blev kompileret med understøttelse af ARABIC til redigering af filer som er +orienteret højre mod venstre og arabisk tastaturlayout, så starter tilvalget +.B Vim +i arabisk tilstand, dvs. 'arabic' sættes. +Ellers gives en fejlmeddelelse og +.B Vim +afbrydes. +.TP +\-b +Binær tilstand. +Der sættes nogle få valgmuligheder som gør det muligt at redigere en +binær eller eksekverbar fil. +.TP +\-C +Kompatibel. Sæt 'compatible'-valgmuligheden. +Det får +.B Vim +til at opføre sig mest som Vi, selvom der findes en .vimrc-fil. +.TP +\-d +Start i diff-tilstand. +Der skal være to, tre eller fire filnavneargumenter. +.B Vim +åbner alle filerne og viser forskellene mellem dem. +Virker ligesom vimdiff(1). +.TP +\-d {enhed} +Åbn {enhed} til brug som en terminal. +Kun på Amiga. +Eksempel: +"\-d con:20/30/600/150". +.TP +\-D +Fejlretning. Gå til fejlretningstilstand når den første kommando udføres fra +et script. +.TP +\-e +Start +.B Vim +i Ex-tilstand, ligesom hvis "ex"-eksekverbaren blev kaldt. +.TP +\-E +Start +.B Vim +i forbedret Ex-tilstand, ligesom hvis "exim"-eksekverbaren blev kaldt. +.TP +\-f +Forgrund. I GUI-versionen, vil +.B Vim +ikke fork'e og frigøre fra skallen som den blev startet i. +På Amiga, genstartes +.B Vim +ikke for at åbne et nyt vindue. +Tilvalget bør bruges når +.B Vim +udføres af et program der venter på at redigeringssession +bliver færdig (f.eks. mail). +På Amiga virker ":sh"- og ":!"-kommandoerne ikke. +.TP +\-\-nofork +Forgrund. I GUI-versionen, vil +.B Vim +ikke fork'e og frigøre fra skallen som den blev startet i. +.TP +\-F +Hvis +.B Vim +blev kompileret med understøttelse af FKMAP til redigering af filer som er +orienteret højre mod venstre og persisk tastaturlayout, så starter tilvalget +.B Vim +i persisk tilstand, dvs. 'fkmap' og 'rightleft' sættes. +Ellers gives en fejlmeddelelse og +.B Vim +afbrydes. +.TP +\-g +Hvis +.B Vim +blev kompileret med understøttelse af GUI, så aktiveres GUI'en af +denne valgmulighed. Hvis understøttelse af GUI ikke blev kompileret ind, +så gives en fejlmeddelelse og +.B Vim +afbrydes. +.TP +\-h +Giv lidt hjælp om kommandolinjeargumenterne og tilvalgene. +Herefter afsluttes +.B Vim\c +\&. +.TP +\-H +Hvis +.B Vim +blev kompileret med understøttelse af RIGHTLEFT til redigering af filer som er +orienteret højre mod venstre og hebraisk tastaturlayout, så starter tilvalget +.B Vim +i hebraisk tilstand, dvs. 'hkmap' og 'rightleft' sættes. +Ellers gives en fejlmeddelelse og +.B Vim +afbrydes. +.TP +\-i {viminfo} +Når brug af viminfo-filen er aktiveret, så sætter tilvalget det +filnavn som skal bruges, i stedet for standarden "~/.viminfo". +Det kan også bruges til at springe brugen af .viminfo-filen over, +ved at give navnet "NONE". +.TP +\-L +Samme som \-r. +.TP +\-l +Lisp-tilstand. +Sætter 'lisp'- og 'showmatch'-valgmulighederne til. +.TP +\-m +Ændring af filer er deaktiveret. +Nulstiller 'write'-valgmuligheden. +Du kan stadig ændre bufferen, men det er ikke muligt at skrive en fil. +.TP +\-M +Ændringer tillades ikke. 'modifiable'- og 'write'-valgmulighederne fjernes, +så ændringer ikke er tilladt og filer ikke kan skrives. Bemærk at +valgmulighederne kan sættes for at gøre det muligt at foretage ændringer. +.TP +\-N +No-compatible-tilstand. Nulstil 'compatible'-valgmuligheden. +Det får +.B Vim +til at opføre sig en smule bedre, men mindre Vi-kompatibel, selvom der ikke +findes en .vimrc-fil. +.TP +\-n +Der bruges ingen swap-fil. +Det er umuligt at gendanne efter programmet er holdt op med at virke. +God hvis du vil redigere en fil på et meget langsomt medie (f.eks. floppy). +Kan også gøres med ":set uc=0". +Kan fortrydes med ":set uc=200". +.TP +\-nb +Bliv en editor-server til NetBeans. Se dokumentationen for detaljer. +.TP +\-o[N] +Åbn N vinduer stablet. +Når N udelades, så åbnes ét vindue pr. fil. +.TP +\-O[N] +Åbn N vinduer side om side. +Når N udelades, så åbnes ét vindue pr. fil. +.TP +\-p[N] +Åbn N fanebladssider. +Når N udelades, så åbnes én fanebladsside pr. fil. +.TP +\-R +Skrivebeskyttet tilstand. +'readonly'-valgmuligheden sættes. +Du kan stadig redigere bufferen, men vil være forhindret i +fejlagtigt at overskrive en fil. +Hvis du vil overskrive en fil, så tilføj et +udråbstegn til Ex-kommandoen, som i ":w!". +\-R-tilvalget indebærer også \-n-tilvalget (se ovenfor). +'readonly'-valgmuligheden kan slås fra med ":set noro". +Se ":help 'readonly'". +.TP +\-r +Oplist swap-filer, med information om at bruge dem til gendannelse. +.TP +\-r {fil} +Gendannelsestilstand. +Swap-filen bruges til at gendanne en redigeringssession som holdt +op med at virke. Swap-filen er en fil med det samme filnavn som tekstfilen, +med ".swp" tilføjet i slutningen. +Se ":help recovery". +.TP +\-s +Stille tilstand. Kun når der startes som "Ex" eller +når "\-e"-tilvalget blev givet inden "\-s"-tilvalget. +.TP +\-s {scriptind} +Script-filen {scriptind} læses. +Tegnene i filen fortolkes som havde du skrevet dem. +Det samme kan gøres med kommandoen ":source! {scriptind}". +Hvis slutningen af filen nås inden editoren afslutter, +så læses yderligere tegn fra tastaturet. +.TP +\-T {terminal} +Fortæller +.B Vim +navnet på terminalen som du bruger. +Kræves kun når den automatisk måde ikke virker. +Skal være en terminal som kendes af +.B Vim +(indbygget) eller defineret i termcap- eller terminfo-filen. +.TP +\-u {vimrc} +Brug kommandoerne i {vimrc}-filen til initialiseringer. +Alle de andre initialiseringer springes over. +Brug den til at redigere en særlig slags filer. +Den kan også bruges til at springe alle initialiseringer over, +ved at give navnet "NONE". Se ":help initialization" i vim for flere detaljer. +.TP +\-U {gvimrc} +Brug kommandoerne i {gvimrc}-filen til GUI-initialiseringer. +Alle de andre GUI-initialiseringer springes over. +Den kan også bruges til at springe alle GUI-initialiseringer over, +ved at give navnet "NONE". Se ":help gui\-init" i vim for flere detaljer. +.TP +\-V[N] +Uddybende. Giv meddelelser om hvilke filer som er sourced og til læsning og +skrivning af en viminfo-fil. Det valgfrie nummer N er værdien af 'verbose'. +Standard er 10. +.TP +\-v +Start +.B Vim +i Vi-tilstand, ligesom eksekverbaren kaldet "vi". Det har kun virkning når +eksekverbaren kaldes "ex". +.TP +\-w {scriptud} +Alle tegnene som du skrev optages i filen {scriptud}, indtil du afslutter +.B Vim\c +\&. +Det er nyttigt hvis du vil oprette en script-fil som skal bruges med +"vim \-s" eller ":source!". +Hvis {scriptud}-filen findes, så tilføjes tegnene til slutningen. +.TP +\-W {scriptud} +Ligesom \-w, men en eksisterende fil overskrives. +.TP +\-x +Brug kryptering når der skrives filer. Spørger efter en krypteringsnøgle. +.TP +\-X +Opret ikke forbindelse til X-serveren. Afkorter opstartstiden i en terminal, +men vinduets titel og udklipsholder bruges ikke. +.TP +\-y +Start +.B Vim +i easy-tilstand, ligesom hvis "evim"- eller "eview"-eksekverbarene blev kaldt. +Får +.B Vim +til at opføre sig som en klik og skriv-editor. +.TP +\-Z +Restriktiv tilstand. Virker ligesom eksekverbaren som begynder med "r". +.TP +\-\- +Betegner slutningen af tilvalgene. +Argumenter efter dette håndteres som et filnavn. +Det kan bruges til at redigere et filnavn som begynder med et '\-'. +.TP +\-\-echo\-wid +Kun GTK GUI: Ekko vinduets id på stdout. +.TP +\-\-help +Giv en hjælpemeddelelse og afslut, ligesom "\-h". +.TP +\-\-literal +Tag filnavnets argumenter bogstaveligt, udvid ikke jokertegn. +Det har ingen virkning i Unix hvor skallen udvidder jokertegn. +.TP +\-\-noplugin +Spring indlæsning af plugins over. Indebæres af \-u NONE. +.TP +\-\-remote +Opret forbindelse til en Vim-server og få den til at redigere filerne +som gives i resten af argumenterne. Hvis der ikke findes nogen server, +så gives der en advarsel og filerne redigeres i den nuværende Vim. +.TP +\-\-remote\-expr {udtryk} +Opret forbindelse til en Vim-server, evaluer +{udtryk} i den og udskriv resultatet på stdout. +.TP +\-\-remote\-send {nøgler} +Opret forbindelse til en Vim-server and send {nøgler} til den. +.TP +\-\-remote\-silent +Som \-\-remote, men uden advarslen når der ikke findes nogen server. +.TP +\-\-remote\-wait +Som \-\-remote, men Vim afslutter ikke før filerne er blevet redigeret. +.TP +\-\-remote\-wait\-silent +Som \-\-remote\-wait, men uden advarslen når der ikke findes nogen server. +.TP +\-\-serverlist +Oplist navnene på alle Vim-servere som der kan findes. +.TP +\-\-servername {navn} +Brug servernavnet {navn}. Bruges til den nuværende Vim, +medmindre det bruges med et \-\-remote-argument, +så er det navnet på serveren som der skal oprettes forbindelse til. +.TP +\-\-socketid {id} +Kun GTK GUI: Brug GtkPlug-mekanismen til at køre gvim i et andet vindue. +.TP +\-\-version +Udskriv versionsinformation og afslut. +.SH ONLINEHJÆLP +Skriv ":help" i +.B Vim +for at begynde. +Skriv ":help emne" for at få hjælp til et bestemt emne. +F.eks.: ":help ZZ" for at få hjælpe til "ZZ"-kommandoen. +Brug og CTRL-D for at fuldføre emner (":help cmdline\-completion"). +Tags findes til at hoppe fra et sted til et andet (en slags hypertekst-links, +se ":help"). +Alle dokumentationsfiler kan vises på denne måde, f.eks. +":help syntax.txt". +.SH FILER +.TP 15 +/usr/local/lib/vim/doc/*.txt +.B Vim\c +-dokumentationsfilerne. +Brug ":help doc\-file\-list" for at få den fulde liste. +.TP +/usr/local/lib/vim/doc/tags +Tags-filen som bruges til at finde information i dokumentationsfilerne. +.TP +/usr/local/lib/vim/syntax/syntax.vim +Systembrede syntaksinitialiseringer. +.TP +/usr/local/lib/vim/syntax/*.vim +Syntaksfiler til diverse sprog. +.TP +/usr/local/lib/vim/vimrc +Systembrede +.B Vim\c +-initialiseringer. +.TP +~/.vimrc +Dine personlige +.B Vim\c +-initialiseringer. +.TP +/usr/local/lib/vim/gvimrc +Systembrede gvim-initialiseringer. +.TP +~/.gvimrc +Dine personlige gvim-initialiseringer. +.TP +/usr/local/lib/vim/optwin.vim +Script som bruges til ":options"-kommandoen, +en god måde til at vise og sætte valgmuligheder. +.TP +/usr/local/lib/vim/menu.vim +Systembrede menu-initialiseringer til gvim. +.TP +/usr/local/lib/vim/bugreport.vim +Script til at generere en fejlrapport. Se ":help bugs". +.TP +/usr/local/lib/vim/filetype.vim +Script til at registrere filtypen ud fra navnet. Se ":help 'filetype'". +.TP +/usr/local/lib/vim/scripts.vim +Script til at registrere filtypen ud fra indholdet. Se ":help 'filetype'". +.TP +/usr/local/lib/vim/print/*.ps +Filer som bruges til PostScript-udskrivning. +.PP +Læs VIM-hjemmesiden for seneste info: +.br + +.SH SE OGSÅ +vimtutor(1) +.SH FORFATTER +Det meste af +.B Vim +blev lavet af Bram Moolenaar, med en masse hjælp fra andre. +Se ":help credits" i +.B Vim\c +\&. +.br +.B Vim +er baseret på Stevie, arbejdet på af: Tim Thompson, +Tony Andrews og G.R. (Fred) Walter. +Selvom der næsten ikke er noget af den originale kode tilbage. +.SH FEJL +Formodentligt. +Se ":help todo" for en liste over kendte problemer. +.PP +Bemærk at flere ting som af nogle kan anses som værende fejl, +faktisk er pga. en for nær reproduktion af Vi's opførsel. +Og hvis du tænker at andre ting er fejl "fordi Vi gør det anderledes", +så kig nærmere på vi_diff.txt-filen (eller skriv :help vi_diff.txt i Vim). +Se også 'compatible'- og 'cpoptions'-valgmulighederne. diff --git a/runtime/doc/vimdiff-da.1 b/runtime/doc/vimdiff-da.1 index a700f5e9d5..194bce207a 100644 --- a/runtime/doc/vimdiff-da.1 +++ b/runtime/doc/vimdiff-da.1 @@ -1,6 +1,7 @@ .TH VIMDIFF 1 "30. marts 2001" .SH NAVN -vimdiff \- rediger to, tre eller fire version af en fil med Vim, og vis forskellene +vimdiff \- rediger to, tre eller fire version af en fil med Vim, +og vis forskellene .SH SYNOPSIS .br .B vimdiff @@ -14,8 +15,8 @@ starter p to (eller tre eller fire) filer. Hver fil fr sit eget vindue. Forskellene mellem filerne fremhves. -Det er en fin mde til at inspicere ndringer og til at flytte ndringer fra en version -til en anden version af den samme fil. +Det er en fin mde til at inspicere ndringer og til at flytte ndringer fra +en version til en anden version af den samme fil. .PP Se vim(1) for detaljer om selve Vim. .PP @@ -26,13 +27,15 @@ N I hvert vindue sttes 'diff'-valgmuligheden, som fr forskellene til at blive fremhvet. .br -\'wrap'- og 'scrollbind'-valgmulighederne sttes for at f teksten til at se godt ud. +\'wrap'- og 'scrollbind'-valgmulighederne sttes for at f teksten til +at se godt ud. .br -\'foldmethod'-valgmuligheden sttes til "diff", hvilket lgger omrder af linjer uden -ndringer i en sammenfoldning. 'foldcolumn' sttes til to, for at gre det lettere at se -sammenfoldningerne og bne eller lukke dem. +\'foldmethod'-valgmuligheden sttes til "diff", hvilket lgger omrder af +linjer uden ndringer i en sammenfoldning. 'foldcolumn' sttes til to, +for at gre det lettere at se sammenfoldningerne og bne eller lukke dem. .SH TILVALG -Lodrette opdelinger bruges til at opstille linjerne, som hvis "\-O"-argumentet blev brugt. +Lodrette opdelinger bruges til at opstille linjerne, som hvis "\-O"-argumentet +blev brugt. Brug "\-o"-argumentet, for i stedet at bruge vandrette opdelinger. .PP Se vim(1) for alle andre argumenter. @@ -43,4 +46,5 @@ Det meste af .B Vim blev lavet af Bram Moolenaar, med en masse hjlp fra andre. Se ":help credits" i -.B Vim. +.B Vim\c +\&. \ No newline at end of file diff --git a/runtime/doc/vimdiff-da.UTF-8.1 b/runtime/doc/vimdiff-da.UTF-8.1 index 5a824cda93..e8373a8c83 100644 --- a/runtime/doc/vimdiff-da.UTF-8.1 +++ b/runtime/doc/vimdiff-da.UTF-8.1 @@ -1,6 +1,7 @@ .TH VIMDIFF 1 "30. marts 2001" .SH NAVN -vimdiff \- rediger to, tre eller fire version af en fil med Vim, og vis forskellene +vimdiff \- rediger to, tre eller fire version af en fil med Vim, +og vis forskellene .SH SYNOPSIS .br .B vimdiff @@ -14,8 +15,8 @@ starter på to (eller tre eller fire) filer. Hver fil får sit eget vindue. Forskellene mellem filerne fremhæves. -Det er en fin måde til at inspicere ændringer og til at flytte ændringer fra en version -til en anden version af den samme fil. +Det er en fin måde til at inspicere ændringer og til at flytte ændringer fra +en version til en anden version af den samme fil. .PP Se vim(1) for detaljer om selve Vim. .PP @@ -26,13 +27,15 @@ Når den startes som I hvert vindue sættes 'diff'-valgmuligheden, som får forskellene til at blive fremhævet. .br -\'wrap'- og 'scrollbind'-valgmulighederne sættes for at få teksten til at se godt ud. +\'wrap'- og 'scrollbind'-valgmulighederne sættes for at få teksten til +at se godt ud. .br -\'foldmethod'-valgmuligheden sættes til "diff", hvilket lægger områder af linjer uden -ændringer i en sammenfoldning. 'foldcolumn' sættes til to, for at gøre det lettere at se -sammenfoldningerne og åbne eller lukke dem. +\'foldmethod'-valgmuligheden sættes til "diff", hvilket lægger områder af +linjer uden ændringer i en sammenfoldning. 'foldcolumn' sættes til to, +for at gøre det lettere at se sammenfoldningerne og åbne eller lukke dem. .SH TILVALG -Lodrette opdelinger bruges til at opstille linjerne, som hvis "\-O"-argumentet blev brugt. +Lodrette opdelinger bruges til at opstille linjerne, som hvis "\-O"-argumentet +blev brugt. Brug "\-o"-argumentet, for i stedet at bruge vandrette opdelinger. .PP Se vim(1) for alle andre argumenter. @@ -43,4 +46,5 @@ Det meste af .B Vim blev lavet af Bram Moolenaar, med en masse hjælp fra andre. Se ":help credits" i -.B Vim. +.B Vim\c +\&. diff --git a/runtime/doc/vimtutor-da.1 b/runtime/doc/vimtutor-da.1 index ea96e9082d..ec8cde037d 100644 --- a/runtime/doc/vimtutor-da.1 +++ b/runtime/doc/vimtutor-da.1 @@ -32,8 +32,7 @@ startes altid i Vi-kompatibel tilstand. .TP 15 /usr/local/lib/vim/tutor/tutor[.sprog] .B Vimtutor\c --tekstfilerne -. +-tekstfilerne. .TP 15 /usr/local/lib/vim/tutor/tutor.vim Vim-scriptet som bruges til at kopiere diff --git a/runtime/doc/vimtutor-da.UTF-8.1 b/runtime/doc/vimtutor-da.UTF-8.1 index 9f676ffa89..feb7ea3955 100644 --- a/runtime/doc/vimtutor-da.UTF-8.1 +++ b/runtime/doc/vimtutor-da.UTF-8.1 @@ -32,8 +32,7 @@ startes altid i Vi-kompatibel tilstand. .TP 15 /usr/local/lib/vim/tutor/tutor[.sprog] .B Vimtutor\c --tekstfilerne -. +-tekstfilerne. .TP 15 /usr/local/lib/vim/tutor/tutor.vim Vim-scriptet som bruges til at kopiere diff --git a/runtime/gvim.desktop b/runtime/gvim.desktop index e160df13a8..b5f461aa8f 100644 --- a/runtime/gvim.desktop +++ b/runtime/gvim.desktop @@ -1,7 +1,7 @@ [Desktop Entry] -Name=GVim +Name=gVim GenericName=Text Editor -GenericName[da]=Tekstredigering +GenericName[da]=Teksteditor GenericName[de]=Texteditor GenericName[eo]=Tekstoredaktilo GenericName[fr]=Éditeur de texte diff --git a/runtime/tools/unicode.vim b/runtime/tools/unicode.vim index ad664727ce..b518d0541f 100644 --- a/runtime/tools/unicode.vim +++ b/runtime/tools/unicode.vim @@ -383,7 +383,7 @@ let s:ambitable = [] call BuildWidthTable('A', 'ambiguous') " Edit the emoji text file. Requires the netrw plugin. -edit http://unicode.org/Public/emoji/5.0/emoji-data.txt +edit https://www.unicode.org/Public/emoji/11.0/emoji-data.txt "edit http://www.unicode.org/Public/emoji/latest/emoji-data.txt " Build the emoji table. Ver. 1.0 - 6.0 diff --git a/runtime/tutor/tutor b/runtime/tutor/tutor index a1a9c8715f..c076e3bfdc 100644 --- a/runtime/tutor/tutor +++ b/runtime/tutor/tutor @@ -372,7 +372,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ** Type p to put previously deleted text after the cursor. ** - 1. Move the cursor to the first ---> line below. + 1. Move the cursor to the first line below marked --->. 2. Type dd to delete the line and store it in a Vim register. @@ -447,7 +447,7 @@ Notice that ce deletes the word and places you in Insert mode. 2. The motions are the same, such as w (word) and $ (end of line). - 3. Move to the first line below marked --->. + 3. Move the cursor to the first line below marked --->. 4. Move the cursor to the first error. @@ -740,7 +740,7 @@ NOTE: You can also read the output of an external command. For example, ** Type a to insert text AFTER the cursor. ** - 1. Move the cursor to the start of the line below marked --->. + 1. Move the cursor to the start of the first line below marked --->. 2. Press e until the cursor is on the end of li . diff --git a/runtime/tutor/tutor.ca.utf-8 b/runtime/tutor/tutor.ca.utf-8 index 7e8e570135..627c0cee33 100644 --- a/runtime/tutor/tutor.ca.utf-8 +++ b/runtime/tutor/tutor.ca.utf-8 @@ -2,86 +2,87 @@ = B e n v i n g u t s a l t u t o r d e l V I M - Versió 1.5 = =============================================================================== - El Vim és un editor molt potent que té moltes ordres, masses com per - explicar-les totes un tutor com aquest. Aquest tutor està dissenyat - per descriure les ordres bàsiques que us permetin fer servir el Vim com - a editor de propòsit general. + El Vim és un editor potent i té moltes ordres, massa com per a + explicar-les totes un tutor com aquest. Aquest tutor està pensat per a + ensenyar les ordres bàsiques que us permetin fer servir el Vim com a + editor de propòsit general. - El temps aproximat de seguir el tutor complet és d'uns 25 o 30 minuts + El temps aproximat de completar el tutor és d'uns 25 o 30 minuts depenent de quant temps dediqueu a experimentar. - Feu una còpia d'aquest fitxer per practicar-hi (si heu començat amb el - programa vimtutor això que esteu llegint ja és una còpia). + Feu una còpia d'aquest fitxer per a practicar-hi (si heu començat amb + el programa vimtutor això que esteu llegint ja és una còpia). - És important recordar que aquest tutor està pensat per ensenyar - practicant. És a dir, que haureu d'executar les ordres si les voleu + És important recordar que aquest tutor està pensat per a ensenyar + practicant, és a dir que haureu d'executar les ordres si les voleu aprendre. Si només llegiu el text el més probable és que les oblideu. Ara assegureu-vos que la tecla de bloqueig de majúscules no està - activada i premeu la tecla j per moure el cursor avall, fins que - la lliçó 1.1 ocupi completament la pantalla. + activada i premeu la tecla j per a moure el cursor avall, fins que la + lliçó 1.1 ocupi completament la pantalla. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.1: MOURE EL CURSOR + Lliçó 1.1: MOURE EL CURSOR - ** Per moure el cursor premeu les tecles h,j,k,l tal com està indicat. ** + ** Per a moure el cursor premeu les tecles h, j, k, l tal com s'indica. ** ^ - k Pista: La h és a l'esquerra i mou el cursor cap a l'esquerra. - < h l > La l és a la dreta i mou el cursor cap a la dreta. - j La j sembla una fletxa cap avall. + k Pista: La h és a l'esquerra i mou el cursor cap a l'esquerra. + < h l > La l és a la dreta i mou el cursor cap a la dreta. + j La j sembla una fletxa cap avall. v 1. Moveu el cursor per la pantalla fins que us sentiu confortables. 2. Mantingueu premuda la tecla avall (j) una estona. ----> Ara sabeu com moure-us fins a la pròxima lliçó. +---> Ara ja sabeu com moure-us fins a la següent lliçó. 3. Usant la tecla avall, aneu a la lliçó 1.2. -Nota: Si no esteu segurs de la tecla que heu premut, premeu per tornar - al mode Normal. Llavors torneu a teclejar l'ordre que volíeu. +Nota: Si no esteu segurs de la tecla que heu premut, premeu per a + tornar al mode Normal. Llavors torneu a teclejar l'ordre que volíeu. -Nota: Les tecles de moviment del cursor (fletxes) també funcionen. Però usant - hjkl anireu més ràpid, quan us hi hàgiu acostumant. +Nota: Les tecles de moviment del cursor (fletxes) també funcionen. Però + usant hjkl anireu més ràpid un cop us hi hagueu acostumant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.2: ENTRAR I SORTIR DEL VIM + Lliçó 1.2: ENTRAR I SORTIR DEL VIM !! NOTA: Abans de seguir els passos següents llegiu *tota* la lliçó!! - 1. Premeu (per estar segurs que esteu en el mode Normal). + 1. Premeu (per a estar segurs que esteu en el mode Normal). - 2. Teclegeu: :q! . + 2. Teclegeu: :q! . ----> Amb això sortireu de l'editor SENSE desar els canvis que hàgiu pogut +---> Amb això sortireu de l'editor SENSE desar els canvis que hagueu pogut fer. Si voleu desar els canvis teclegeu: - :wq + :wq - 3. Quan vegeu l'introductor de la shell escriviu l'ordre amb la qual heu - arribat a aquest tutor. Podria ser: vimtutor - O bé: vim tutor + 3. Quan vegeu l'introductor de l'intèrpret escriviu l'ordre amb la + qual heu arribat a aquest tutor. Podria ser: vimtutor + O bé: vim tutor ---> 'vim' és l'editor vim, i 'tutor' és el fitxer que voleu editar. 4. Si heu memoritzat les ordres, feu els passos anteriors, de l'1 al 3, - per sortir i tornar a entrar a l'editor. Llavors moveu el cursor avall - fins la lliçó 1.3. + per a sortir i tornar a entrar a l'editor. Llavors moveu el cursor + avall fins a la lliçó 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.3: EDITAR TEXT - ESBORRAR + Lliçó 1.3: EDITAR TEXT - ESBORRAR - ** En mode Normal premeu x per esborrar el caràcter de sota el cursor. ** + ** En mode Normal premeu x per a esborrar el caràcter sota el cursor. ** - 1. Moveu el cursor fins la línia que hi ha més avall marcada amb --->. + 1. Moveu el cursor fins a la línia que hi ha més avall senyalada amb --->. - 2. Poseu el cursor a sobre el caràcter que cal esborrar, per corregir els - errors. + 2. Poseu el cursor a sobre el caràcter que cal esborrar per a corregir + els errors. - 3. Premeu la tecla x per esborrar el caràcter. + 3. Premeu la tecla x per a esborrar el caràcter. 4. Repetiu els passos 2 i 3 fins que la frase sigui correcta. ----> Unna vaaca vva salttar sobbree la llluna. +---> Unna vaaca vva salttar perr sobbree la llluna. 5. Ara que la línia és correcta, aneu a la lliçó 1.4. @@ -90,20 +91,20 @@ NOTA: Mentre aneu fent no tracteu de memoritzar, practiqueu i prou. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.4: EDITAR TEXT - INSERIR + Lliçó 1.4: EDITAR TEXT - INSERIR - ** En mode Normal premeu i per inserir text. ** + ** En mode Normal premeu i per a inserir text. ** - 1. Moveu el cursor avall fins la primera línia marcada amb --->. + 1. Moveu el cursor avall fins la primera línia senyalada amb --->. - 2. Per fer la primera línia igual que la segona poseu el cursor sobre el - primer caràcter POSTERIOR al text que s'ha d'inserir. + 2. Per a fer la primera línia igual que la segona poseu el cursor sobre + el primer caràcter POSTERIOR al text que s'ha d'inserir. 3. Premeu la tecla i i escriviu el text que falta. - 4. Quan hàgiu acabat premeu per tornar al mode Normal. Repetiu - els passos 2, 3 i 4 per corregir la frase. + 4. Quan hageu acabat premeu per tornar al mode Normal. Repetiu + els passos 2, 3 i 4 fins a corregir la frase. ---> Falten carctrs en aquesta . ---> Falten alguns caràcters en aquesta línia. @@ -113,110 +114,111 @@ NOTA: Mentre aneu fent no tracteu de memoritzar, practiqueu i prou. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 1 SUMARI + LLIÇÓ 1 SUMARI 1. El cursor es mou amb les fletxes o bé amb les tecles hjkl. - h (esquerra) j (avall) k (amunt) l (dreta) + h (esquerra) j (avall) k (amunt) l (dreta) - 2. Per entrar al Vim (des de la shell) escriviu: vim FITXER + 2. Per a entrar al Vim (des de l'intèrpret) escriviu: vim FITXER - 3. Per sortir teclegeu: :q! per descartar els canvis. - O BÉ teclegeu: :wq per desar els canvis. + 3. Per a sortir teclegeu: :q! per a descartar els canvis. + O BÉ teclegeu: :wq per a desar els canvis. - 4. Per esborrar el caràcter de sota el cursor en el mode Normal premeu: x + 4. Per a esborrar el caràcter de sota el cursor en el mode Normal premeu: x - 5. Per inserir text on hi ha el cursor, en mode Normal, premeu: - i escriviu el text + 5. Per a inserir text on hi ha el cursor, en mode Normal, premeu: + i escriviu el text -NOTA: La tecla us portarà al mode Normal o cancel·larà una ordre - que estigui a mitges. +NOTA: La tecla us porta al mode Normal o cancel·la una ordre que + estigui a mitges. -Ara continueu amb la lliçó 2. +Ara continueu a la lliçó 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 2.1: ORDRES PER ESBORRAR + Lliçó 2.1: ORDRES PER ESBORRAR - ** Teclegeu dw per esborrar fins al final d'una paraula. ** + ** Teclegeu dw per a esborrar fins al final d'una paraula. ** 1. Premeu per estar segurs que esteu en mode normal. - 2. Moveu el cursor avall fins la línia marcada amb --->. + 2. Moveu el cursor avall fins a la línia senyalada amb --->. - 3. Moveu el cursor fins el principi de la paraula que s'ha d'esborrar. + 3. Moveu el cursor fins al principi de la paraula que s'ha d'esborrar. - 4. Teclegeu dw per fer desaparèixer la paraula. + 4. Teclegeu dw per a fer desaparèixer la paraula. NOTA: Les lletres dw apareixeran a la línia de baix de la pantalla mentre les aneu escrivint. Si us equivoqueu premeu i torneu a començar. ----> Hi han algunes paraules divertit que no pertanyen paper a aquesta frase. +---> Hi ha algunes paraules divertit que no pertanyen paper a aquesta frase. - 5. Repetiu el passos 3 i 4 fins que la frase sigui correcta i continueu a - la lliçó 2.2. + 5. Repetiu el passos 3 i 4 fins que la frase sigui correcta i continueu + a la lliçó 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 2.2: MÉS ORDRES PER ESBORRAR + Lliçó 2.2: MÉS ORDRES PER ESBORRAR - ** Escriviu d$ per esborrar fins al final de la línia. ** + ** Escriviu d$ per a esborrar fins al final de la línia. ** - 1. Premeu per estar segurs que esteu en el mode Normal. + 1. Premeu per a estar segurs que esteu en el mode Normal. - 2. Moveu el cursor avall fins a la línia marcada amb --->. + 2. Moveu el cursor avall fins a la línia senyalada amb --->. - 3. Moveu el cursor fins el final de la línia correcta + 3. Moveu el cursor fins al final de la línia correcta (DESPRÉS del primer . ). - 4. Teclegeu d$ per esborrar fins al final de la línia. + 4. Teclegeu d$ per a esborrar fins al final de la línia. ---> Algú ha escrit el final d'aquesta línia dos cops. línia dos cops. - 5. Aneu a la lliçó 2.3 per entendre què està passant. + 5. Aneu a la lliçó 2.3 per a entendre què està passant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 2.3: SOBRE ORDRES I OBJECTES + Lliçó 2.3: SOBRE ORDRES I OBJECTES El format de l'ordre d'esborrar d és el següent: - [nombre] d objecte O BÉ d [nombre] objecte + [nombre] d objecte O BÉ d [nombre] objecte On: nombre - és el nombre de cops que s'ha d'executar (opcional, omissió=1). - d - és l'ordre per esborrar. + d - és l'ordre d'esborrar. objecte - és la cosa amb la qual operar (llista a baix). Una petita llista d'objectes: - w - des del cursor fins al final de la paraula, incloent-hi l'espai. + w - des del cursor fins al final de la paraula, incloent l'espai. e - des del cursor fins al final de la paraula, SENSE incloure l'espai. $ - des del cursor fins al final de la línia. -NOTA: Per als aventurers: si teclegeu només l'objecte, en el mode Normal, - sense cap ordre, el cursor es mourà tal com està especificat a la - llista d'objectes. +NOTA: Per als aventurers: si teclegeu només l'objecte, en el mode Normal, + sense cap ordre, el cursor es mourà tal com està descrit a la llista + d'objectes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 2.4: UNA EXCEPCIÓ A 'ORDRE-OBJECTE' + Lliçó 2.4: UNA EXCEPCIÓ A 'ORDRE-OBJECTE' - ** Teclegeu dd esborrar tota la línia. ** + ** Teclegeu dd per a esborrar tota la línia. ** - Com que molt sovint s'han d'eliminar línies senceres els dissenyadors del - Vi van creure que seria més fàcil teclejar dd per esborrar tota la línia. + Com que molt sovint s'han d'eliminar línies senceres, els programadors + del Vi van creure que seria més convenient teclejar dd per a esborrar + tota la línia. 1. Moveu el cursor a la segona línia de la frase de baix. - 2. Teclegeu dd per esborrar la línia. + 2. Teclegeu dd per a esborrar la línia. 3. Ara aneu a la quarta línia. - 4. Teclegeu 2dd per esborrar dues línies (recordeu nombre-ordre-objecte). + 4. Teclegeu 2dd per a esborrar dues línies (recordeu nombre-ordre-objecte). 1) Les roses són vermelles, 2) El fang és divertit, @@ -226,21 +228,20 @@ NOTA: Per als aventurers: si teclegeu només l'objecte, en el mode Normal, 6) El sucre és dolç, 7) Igual que tu. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 2.5: L'ORDRE DESFER + Lliçó 2.5: L'ORDRE DESFER - ** Premeu u per desfer els últims canvis, U per arreglar tota la línia. ** + ** Premeu u per a desfer els canvis, U per a restaurar tota la línia. ** - 1. Moveu el cursor sobre el primer error de línia de baix marcada amb ---> - 2. Premeu x per esborrar el caràcter no desitjat. - 3. Ara premeu u per desfer l'última ordre executada. + 1. Moveu el cursor sobre el primer error de línia de baix senyalada amb ---> + 2. Premeu x per a esborrar el caràcter no desitjat. + 3. Ara premeu u per a desfer l'última ordre executada. 4. Aquest cop corregiu tots els errors de la línia amb l'ordre x. - 5. Ara premeu U per restablir la línia al seu estat original. - 6. Ara premeu u uns quants cops per desfer U i les ordres anteriors. + 5. Ara premeu U per a restablir la línia al seu estat original. + 6. Ara premeu u uns quants cops per a desfer U i les ordres anteriors. 7. Ara premeu CONTROL-R (les dues tecles al mateix temps) uns quants cops - per refer les ordres. + per a refer les ordres. ---> Correegiu els errors d'aqquesta línia i dessfeu-los aamb desfer. @@ -249,86 +250,87 @@ NOTA: Per als aventurers: si teclegeu només l'objecte, en el mode Normal, + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 2 SUMARI + LLIÇÓ 2 SUMARI - 1. Per esborrar del cursor al final de la paraula teclegeu: dw + 1. Per a esborrar del cursor al final de la paraula teclegeu: dw - 2. Per esborrar del cursor al final de la línia teclegeu: d$ + 2. Per a esborrar del cursor al final de la línia teclegeu: d$ - 3. Per esborrar una línia sencera teclegeu: dd + 3. Per a esborrar una línia sencera teclegeu: dd 4. El format de qualsevol ordre del mode Normal és: - [nombre] ordre objecte O BÉ ordre [nombre] objecte + [nombre] ordre objecte O BÉ ordre [nombre] objecte on: nombre - és quants cops repetir l'ordre ordre - és què fer, com ara d per esborrar objecte - és amb què s'ha d'actuar, com ara w (paraula), - $ (fins a final de línia), etc. + $ (fins a final de línia), etc. - 5. Per desfer les accions anteriors premeu: u - Per desfer tots el canvis en una línia premeu: U - Per desfer l'ordre desfer premeu: CTRL-R + 5. Per a desfer les accions anteriors premeu: u + Per a desfer tots el canvis en una línia premeu: U + Per a desfer l'ordre desfer premeu: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 3.1: L'ORDRE 'POSAR' + Lliçó 3.1: L'ORDRE 'POSAR' - ** Premeu p per posar l'última cosa que heu esborrat després del cursor. ** + ** Premeu p per a inserir l'última cosa que heu esborrat + després del cursor. ** 1. Moveu el cursor a la primera línia de llista de baix. - 2. Teclegeu dd per esborrar la línia i desar-la a la memòria. + 2. Teclegeu dd per a esborrar la línia i desar-la a la memòria. - 3. Moveu el cursor a la línia ANTERIOR on hauria d'anar. + 3. Moveu el cursor a la línia ANTERIOR d'on hauria d'anar. - 4. En mode Normal, premeu p per inserir la línia. + 4. En mode Normal, premeu p per a inserir la línia. - 5. Repetiu els passos 2, 3 i 4 per ordenar les línies correctament. + 5. Repetiu els passos 2, 3 i 4 per a ordenar les línies correctament. d) Pots aprendre tu? b) Les violetes són blaves, - c) L'intel·ligència s'aprèn, + c) La intel·ligència s'aprèn, a) Les roses són vermelles, - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 3.2: L'ORDRE SUBSTITUIR + Lliçó 3.2: L'ORDRE SUBSTITUIR - ** Premeu r i un caràcter per substituir el caràcter de sota el cursor. ** + ** Premeu r i un caràcter per a substituir el caràcter + de sota el cursor. ** - 1. Moveu el cursor a la primera línia de sota marcada amb --->. + 1. Moveu el cursor a la primera línia de sota senyalada amb --->. 2. Moveu el cursor a sobre del primer caràcter equivocat. - 3. Premeu r i tot seguit el caràcter correcte per corregir l'error. + 3. Premeu r i tot seguit el caràcter correcte per a corregir l'error. 4. Repetiu els passos 2 i 3 fins que la línia sigui correcta. ----> Quen van escroure aquerta línia, algh va apretar tikles equivocades! ----> Quan van escriure aquesta línia, algú va apretar tecles equivocades! +---> Quen van escroure aquerta línia, algh va prémer tikles equivocades! +---> Quan van escriure aquesta línia, algú va prémer tecles equivocades! 5. Ara continueu a la lliçó 3.2. NOTA: Recordeu que heu de practicar, no memoritzar. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 3.3: L'ORDRE CANVIAR + Lliçó 3.3: L'ORDRE CANVIAR - ** Per canviar una part o tota la paraula, escriviu cw . ** + ** Per a canviar una part o tota la paraula, escriviu cw . ** - 1. Moveu el cursor a la primera línia de sota marcada amb --->. + 1. Moveu el cursor a la primera línia de sota senyalada amb --->. 2. Poseu el cursor sobre la u de 'lughc'. - 3. Teclegeu cw i corregiu la paraula (en aquest cas escriviu 'ínia'.) + 3. Teclegeu cw i corregiu la paraula (en aquest cas, escrivint 'ínia'.) 4. Premeu i aneu al següent error. @@ -342,18 +344,18 @@ Noteu que cw no només canvia la paraula, també us posa en mode d'inserció. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 3.4: MÉS CANVIS AMB c + Lliçó 3.4: MÉS CANVIS AMB c ** L'ordre canviar s'usa amb els mateixos objectes que l'ordre esborrar. ** 1. L'ordre canviar funciona igual que la d'esborrar. El format és: - [nombre] c objecte O BÉ c [nombre] objecte + [nombre] c objecte O BÉ c [nombre] objecte - 2. Els objectes són els mateixos, com w (paraula), $ (final de línia), etc. + 2. Els objectes són els mateixos, w (paraula), $ (final de línia), etc. - 3. Moveu el cursor fins la primera línia marcada amb --->. + 3. Moveu el cursor fins la primera línia senyalada amb --->. 4. Avanceu fins al primer error. @@ -365,44 +367,44 @@ Noteu que cw no només canvia la paraula, també us posa en mode d'inserció. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 3 SUMARI + LLIÇÓ 3 SUMARI - 1. Per tornar a posar el text que s'ha esborrat, premeu p . Això posa el - text esborrat DESPRÉS del cursor (si heu esborrat una línia anirà a - parar a la línia SEGÜENT d'on hi ha el cursor). + 1. Per a tornar a posar el text que heu esborrat, premeu p . Això posa + el text esborrat DESPRÉS del cursor (si heu esborrat una línia anirà + a parar a la línia SEGÜENT d'on hi ha el cursor). - 2. Per substituir el caràcter de sota el cursor, premeu r i tot seguit - el caràcter que ha de reemplaçar l'original. + 2. Per a substituir el caràcter de sota el cursor, premeu r i tot + seguit el caràcter que ha de reemplaçar l'original. - 3. L'ordre canviar permet canviar l'objecte especificat des del cursor + 3. L'ordre canviar permet canviar l'objecte especificat, des del cursor fins el final de l'objecte. Per exemple, cw canvia el que hi ha des - del cursor fins al final de la paraula, i c$ fins al final de línia. + del cursor fins al final de la paraula, i c$ fins al final de + línia. 4. El format de l'ordre canviar és: - [nombre] c objecte O BÉ c [nombre] objecte - -Ara aneu a la pròxima lliçó. + [nombre] c objecte O BÉ c [nombre] objecte +Ara aneu a la següent lliçó. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 4.1: SITUACIÓ I ESTAT DEL FITXER + Lliçó 4.1: SITUACIÓ I ESTAT DEL FITXER - ** Premeu CTRL-g per veure la situació dins del fitxer i el seu estat. - Premeu SHIFT-G per anar a una línia determinada. ** + ** Premeu CTRL-g per a veure la situació dins del fitxer i el seu estat. + Premeu SHIFT-g per a anar a una línia determinada. ** - Nota: No proveu res fins que hàgiu llegit TOTA la lliçó!! + Nota: No proveu res fins que hagueu llegit TOTA la lliçó!! - 1. Mantingueu premuda la tecla Control i premeu g . A la part de baix de - la pàgina apareixerà un línia amb el nom del fitxer i la línia en la - qual us trobeu. Recordeu el número de la línia pel Pas 3. + 1. Mantingueu premuda la tecla Control i premeu g . A la part de baix + de la pàgina apareixerà un línia amb el nom del fitxer i la línia en + la qual us trobeu. Recordeu el número de la línia pel Pas 3. - 2. Premeu Shift-G per anar al final de tot del fitxer. + 2. Premeu Shift-g per a anar al final de tot del fitxer. - 3. Teclegeu el número de la línia on éreu i després premeu Shift-G. Això + 3. Teclegeu el número de la línia on éreu i després premeu Shift-g. Això us tornarà a la línia on éreu quan heu premut per primer cop Ctrl-g. (Quan teclegeu el número NO es veurà a la pantalla.) @@ -411,45 +413,45 @@ Ara aneu a la pròxima lliçó. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 4.2: L'ORDRE CERCAR + Lliçó 4.2: L'ORDRE CERCAR - ** Premeu / seguit de la frase que vulgueu cercar. ** + ** Premeu / seguit de la frase que vulgueu cercar. ** 1. En el mode Normal premeu el caràcter / . Noteu que el cursor apareix - a la part de baix de la pantalla igual que amb l'ordre : . + a la part de baix de la pantalla igual que amb l'ordre : . 2. Ara escriviu 'errroor' . Aquesta és la paraula que voleu cercar. - 3. Per tornar a cercar la mateixa frase, premeu n . - Per cercar la mateixa frase en direcció contraria, premeu Shift-N . + 3. Per a tornar a cercar la mateixa frase, premeu n . Per a cercar la + mateixa frase en direcció contraria, premeu Shift-n . 4. Si voleu cercar una frase en direcció ascendent, useu l'ordre ? en lloc de /. ---> "errroor" no és com s'escriu error; errroor és un error. -Note: Quan la cerca arribi al final del fitxer continuarà a l'inici. +Nota: Quan la cerca arribi al final del fitxer continuarà a l'inici. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 4.3: CERCA DE PARÈNTESIS + Lliçó 4.3: CERCA DE PARÈNTESIS - ** Premeu % per cercar el ),], o } corresponent. ** + ** Premeu % per cercar el ), ], o } corresponent. ** - 1. Poseu el cursor en qualsevol (, [, o { de la línia marcada amb --->. + 1. Poseu el cursor a qualsevol (, [, o { de la línia senyalada amb --->. 2. Ara premeu el caràcter % . 3. El cursor hauria d'anar a la clau o parèntesis corresponent. - 4. Premeu % per tornar el cursor al primer parèntesi. + 4. Premeu % per a tornar el cursor al primer parèntesi. ---> Això ( és una línia amb caràcters (, [ ] i { } de prova. )) -Nota: Això és molt útil per trobar errors en programes informàtics! +Nota: Això és molt útil per a trobar errors en programes informàtics! @@ -457,68 +459,68 @@ Nota: Això és molt útil per trobar errors en programes informàtics! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 4.4: UNA MANERA DE CANVIAR ERRORS + Lliçó 4.4: UNA MANERA DE CORREGIR ERRORS - ** Escriviu :s/vell/nou/g per substituir 'vell' per 'nou'. ** + ** Escriviu :s/vell/nou/g per a substituir 'vell' per 'nou'. ** - 1. Moveu el cursor a la línia de sota marcada amb --->. + 1. Moveu el cursor a la línia de sota senyalada amb --->. - 2. Escriviu :s/laa/la . Aquesta ordre només canvia la primera + 2. Escriviu :s/laa/la . Aquesta ordre només canvia la primera coincidència que es trobi a la línia. - 3. Ara escriviu :s/laa/la/g per fer una substitució global. Això + 3. Ara escriviu :s/laa/la/g per a fer una substitució global. Això canviarà totes les coincidències que es trobin a la línia. ----> laa millor època per veure laa flor és laa primavera. +---> laa millor època per a veure laa flor és laa primavera. - 4. Per canviar totes les coincidències d'una cadena entre dues línies, + 4. Per a canviar totes les coincidències d'una cadena entre dues línies, escriviu :#,#s/vell/nou/g on #,# són els nombres de les línies. - Escriviu :%s/vell/nou/g per substituir la cadena a tot el fitxer. + Escriviu :%s/vell/nou/g per a substituir la cadena a tot el fitxer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 4 SUMARI + LLIÇÓ 4 SUMARI 1. Ctrl-g mostra la posició dins del fitxer i l'estat del mateix. - Shift-G us porta al final del fitxer. Un número seguit de Shift-G - us porta a la línia corresponent. + Shift-g us porta al final del fitxer. Un número seguit de Shift-g us + porta a la línia corresponent. - 2. L'ordre / seguida d'una frase cerca la frase ENDAVANT. - L'ordre ? seguida d'una frase cerca la frase ENDARRERE. - Després d'una cerca premeu n per trobar la pròxima coincidència en - la mateixa direcció, o Shift-N per cercar en la direcció contrària. + 2. L'ordre / seguida d'una frase cerca la frase cap ENDAVANT. + L'ordre ? seguida d'una frase cerca la frase cap ENDARRERE. + Després d'una cerca premeu n per a trobar la pròxima coincidència en + la mateixa direcció, o Shift-n per a cercar en la direcció contrària. - 3. L'ordre % quan el cursor és a sobre un (,),[,],{, o } troba la + 3. L'ordre % quan el cursor es troba en un (, ), [, ], {, o } troba la parella corresponent. - 4. Per substituir el primer 'vell' per 'nou' en una línia :s/vell/nou - Per substituir tots els 'vell' per 'nou' en una línia :s/vell/nou/g - Per substituir frases entre les línies # i # :#,#s/vell/nou/g - Per substituir totes les coincidències en el fitxer :%s/vell/nou/g - Per demanar confirmació cada cop afegiu 'c' :%s/vell/nou/gc + 4. Per a substituir el primer 'vell' per 'nou' en una línia :s/vell/nou + Per a substituir tots els 'vell' per 'nou' en una línia :s/vell/nou/g + Per a substituir frases entre les línies # i # :#,#s/vell/nou/g + Per a substituir totes les coincidències en el fitxer :%s/vell/nou/g + Per a demanar confirmació cada cop afegiu 'c' :%s/vell/nou/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 5.1: COM EXECUTAR UNA ORDRE EXTERNA + Lliçó 5.1: COM EXECUTAR UNA ORDRE EXTERNA - ** Teclegeu :! seguit d'una ordre externa per executar-la. ** + ** Teclegeu :! seguit d'una ordre externa per a executar-la. ** - 1. Premeu el familiar : per col·locar el cursor a la part de baix de + 1. Premeu el familiar : per a col·locar el cursor a la part de baix de la pantalla. Això us permet entrar una ordre. 2. Ara teclegeu el caràcter ! (signe d'exclamació). Això us permet - executar qualsevol ordre de la shell. + executar qualsevol ordre de l'intèrpret del sistema. - 3. Com a exemple escriviu ls i tot seguit premeu . Això us + 3. Per exemple, escriviu ls i tot seguit premeu . Això us mostrarà el contingut del directori, tal com si estiguéssiu a la - línia d'ordres. Feu servir :!dir si ls no funciona. + línia d'ordres. Proveu :!dir si ls no funciona. -Nota: D'aquesta manera es pot executar qualsevol ordre externa. +Nota: D'aquesta manera és possible executar qualsevol ordre externa. Nota: Totes les ordres : s'han d'acabar amb la tecla @@ -526,36 +528,36 @@ Nota: Totes les ordres : s'han d'acabar amb la tecla ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 5.2: MÉS SOBRE L'ESCRIPTURA DE FITXERS + Lliçó 5.2: MÉS SOBRE L'ESCRIPTURA DE FITXERS - ** Per desar els canvis fets, escriviu :w FITXER. *** + ** Per a desar els canvis fets, escriviu :w FITXER. ** - 1. Escriviu :!dir o bé :!ls per obtenir un llistat del directori. + 1. Escriviu :!dir o bé :!ls per a obtenir un llistat del directori. Ja sabeu que heu de prémer després d'això. 2. Trieu un nom de fitxer que no existeixi, com ara PROVA. 3. Ara feu: :w PROVA (on PROVA és el nom que heu triat.) - 4. Això desa tot el fitxer amb el nom de PROVA. Per comprovar-ho - escriviu :!dir per veure el contingut del directori. + 4. Això desa el text en un fitxer amb el nom de PROVA. Per a comprovar-ho + escriviu :!dir i mireu el contingut del directori. Note: Si sortiu del Vim i entreu una altra vegada amb el fitxer PROVA, el fitxer serà una còpia exacta del tutor que heu desat. 5. Ara esborreu el fitxer teclejant (MS-DOS): :!del PROVA - o bé (Unix): :!rm PROVA + o bé (Unix): :!rm PROVA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 5.3: UNA ORDRE SELECTIVA PER DESAR + Lliçó 5.3: UNA ORDRE SELECTIVA PER A DESAR - ** Per desar una part del fitxer, escriviu :#,# w FITXER ** + ** Per a desar una part del fitxer, escriviu :#,# w FITXER ** - 1. Un altre cop, feu :!dir o :!ls per obtenir un llistat del directori - i trieu un nom de fitxer adequat com ara PROVA. + 1. Un altre cop, feu :!dir o :!ls per a obtenir un llistat del + directori i trieu un nom de fitxer adequat com ara PROVA. 2. Moveu el cursor a dalt de tot de la pàgina i premeu Ctrl-g per saber el número de la línia. RECORDEU AQUEST NÚMERO! @@ -563,47 +565,47 @@ Note: Si sortiu del Vim i entreu una altra vegada amb el fitxer PROVA, el 3. Ara aneu a baix de tot de la pàgina i torneu a prémer Ctrl-g. RECORDEU AQUEST NÚMERO TAMBÉ! - 4. Per desar NOMÉS una secció en un fitxer, escriviu :#,# w PROVA on - #,# són els dos números que heu recordat (dalt,baix) i PROVA el nom + 4. Per a desar NOMÉS una secció en un fitxer, escriviu :#,# w PROVA on + #,# són els dos números que heu recordat (dalt, baix) i PROVA el nom del fitxer. - 5. Mireu que el fitxer nou hi sigui amb :!dir però no l'esborreu. + 5. Comproveu que el fitxer nou hi sigui amb :!dir però no l'esborreu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 5.4: OBTENIR I AJUNTAR FITXERS + Lliçó 5.4: OBTENIR I AJUNTAR FITXERS - ** Per inserir el contingut d'un fitxer, feu :r FITXER ** + ** Per a inserir el contingut d'un fitxer, feu :r FITXER ** 1. Assegureu-vos, amb l'ordre :!dir , que el fitxer PROVA encara hi és. - 2. Poseu el cursor a dalt de tot d'aquesta pàgina. + 2. Situeu el cursor a dalt de tot d'aquesta pàgina. -NOTA: Després d'executar el Pas 3 veureu la lliçó 5.3. Aleshores moveu-vos - cap avall fins a aquesta lliçó un altre cop. +NOTA: Després d'executar el Pas 3 veureu la lliçó 5.3. Tireu cap avall + fins a aquesta lliçó un altre cop. 3. Ara obtingueu el fitxer PROVA amb l'ordre :r PROVA on PROVA és el nom del fitxer. -NOTA: El fitxer que obtingueu es posa en el lloc on hi hagi el cursor. +NOTA: El fitxer que obtingueu s'insereix en el lloc on hi hagi el cursor. - 4. Per comprovar que s'ha obtingut el fitxer tireu enrere i mireu com - ara hi han dues còpies de la lliçó 5.3: l'original i la del fitxer. + 4. Per a comprovar que s'ha obtingut el fitxer tireu enrere i mireu com + ara hi ha dues còpies de la lliçó 5.3, l'original i la del fitxer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 5 SUMARI + LLIÇÓ 5 SUMARI 1. :!ordre executa una ordre externa. - Alguns exemples útils són: - (MS-DOS) (Unix) - :!dir :!ls - mostra un llistat del directori - :!del FITXER :!rm FITXER - esborra el fitxer FITXER + Alguns exemples útils: + (MS-DOS) (Unix) + :!dir :!ls - mostra un llistat del directori + :!del FITXER :!rm FITXER - esborra el fitxer FITXER 2. :w FITXER escriu el fitxer editat al disc dur, amb el nom FITXER. @@ -618,39 +620,39 @@ NOTA: El fitxer que obtingueu es posa en el lloc on hi hagi el cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 6.1: L'ORDRE OBRIR + Lliçó 6.1: L'ORDRE OBRIR -** Premeu o per obrir una línia sota el cursor i entrar en mode inserció. ** + ** Premeu o per a obrir una línia i entrar en mode inserció. ** - 1. Moveu el cursor a la línia de sota marcada amb --->. + 1. Moveu el cursor a la línia de sota senyalada amb --->. - 2. Premeu o (minúscula) per obrir una línia SOTA el cursor i situar-vos - en mode d'inserció. + 2. Premeu o (minúscula) per a obrir una línia a BAIX del cursor i + situar-vos en mode d'inserció. - 3. Ara copieu la línia marcada amb ---> i premeu per tornar al mode + 3. Copieu la línia senyalada amb ---> i premeu per a tornar al mode normal. ----> Després de prémer o el cursor es situa a la línia nova en mode inserció. +---> Després de prémer o el cursor se situa a la línia nova en mode inserció. - 4. Per obrir una línia SOBRE el cursor, premeu la O majúscula, en lloc + 4. Per a obrir una línia a SOBRE del cursor, premeu la O majúscula, en lloc de la minúscula. Proveu-ho amb la línia de sota. -Obriu una línia sobre aquesta amb Shift-O amb el cursor en aquesta línia. +Obriu una línia sobre aquesta prement Shift-o amb el cursor en aquesta línia. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 6.2: L'ORDRE AFEGIR + Lliçó 6.2: L'ORDRE AFEGIR - ** Premeu a per afegir text DESPRÉS del cursor. ** + ** Premeu a per a afegir text DESPRÉS del cursor. ** - 1. Moveu el cursor al final de la primera línia de sota marcada + 1. Moveu el cursor al final de la primera línia de sota senyalada amb ---> prement $ en el mode Normal. - 2. Premeu la lletra a (minúscula) per afegir text DESPRÉS del caràcter - sota el cursor. (La A majúscula afegeix text al final de línia.) + 2. Premeu la lletra a (minúscula) per a afegir text DESPRÉS del caràcter + sota el cursor. (La A majúscula afegeix text al final de la línia.) Nota: Així s'evita haver de prémer i , l'últim caràcter, el text a inserir, la tecla , cursor a la dreta, i finalment x , només per afegir @@ -664,38 +666,38 @@ Nota: Així s'evita haver de prémer i , l'últim caràcter, el text a inserir, ---> Aquesta línia us permetrà practicar afegir text a final de línia. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 6.3: UNA ALTRA MANERA DE SUBSTITUIR + Lliçó 6.3: UNA ALTRA MANERA DE SUBSTITUIR - ** Teclegeu una R majúscula per substituir més d'un caràcter. ** + ** Teclegeu una R majúscula per a substituir més d'un caràcter. ** - 1. Moveu el cursor a la línia de sota marcada amb --->. + 1. Moveu el cursor a la línia de sota senyalada amb --->. - 2. Poseu el cursor al principi de la primera paraula que es diferent - respecte a la segona línia marcada amb ---> (la paraula "l'última"). + 2. Poseu el cursor al principi de la primera paraula que és diferent + respecte a la segona línia senyalada amb ---> (la paraula "l'última"). 3. Ara premeu R i substituïu el que queda de text a la primera línia - escrivint sobre el text vell, per fer-la igual que la segona. + escrivint sobre el text vell, per a fer-la igual que la segona. ----> Per fer aquesta línia igual que l'última useu les tecles. ----> Per fer aquesta línia igual que la segona, premeu R i el text nou. +---> Per a fer aquesta línia igual que l'última useu les tecles. +---> Per a fer aquesta línia igual que la segona, premeu R i el text nou. - 4. Tingueu en compte que en prémer per sortir, el text que no + 4. Tingueu en compte que en prémer per a sortir, el text que no s'hagi alterat es manté. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 6.4: ESTABLIR OPCIONS + Lliçó 6.4: ESTABLIR OPCIONS ** Feu que les ordres cercar o substituir ignorin les diferències - entre majúscules i minúscules ** + entre majúscules i minúscules ** 1. Cerqueu la paraula 'ignorar' amb: /ignorar Repetiu-ho uns quants cops amb la tecla n. - 2. Establiu l'opció 'ic' (Ignorar Capitals) escrivint: + 2. Establiu l'opció 'ic' (ignore case) escrivint: :set ic 3. Ara cerqueu 'ignorar' un altre cop amb la tecla n. @@ -707,22 +709,22 @@ Nota: Així s'evita haver de prémer i , l'últim caràcter, el text a inserir, 5. Ara torneu a executar una ordre de cerca, i mireu què passa: /ignorar - 6. Per treure el ressalt dels resultats, feu: + 6. Per a treure el ressaltat dels resultats, feu: :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 6 SUMARI + LLIÇÓ 6 SUMARI - 1. L'ordre o obre una línia SOTA la del cursor i mou el cursor a la nova + 1. L'ordre o obre una línia a SOTA la del cursor i mou el cursor a la nova línia, en mode Inserció. La O majúscula obre la línia a SOBRE la que hi ha el cursor. - 2. Premeu una a per afegir text DESPRÉS del caràcter sota el cursor. + 2. Premeu una a per a afegir text DESPRÉS del caràcter a sota del cursor. La A majúscula afegeix automàticament el text a final de línia. 3. L'ordre R majúscula us posa en mode substitució fins que premeu . - 4. Escriviu ":set xxx" per establir l'opció "xxx" + 4. Escriviu ":set xxx" per a establir l'opció "xxx" @@ -733,74 +735,74 @@ Nota: Així s'evita haver de prémer i , l'últim caràcter, el text a inserir, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 7: ORDRES D'AJUDA + LLIÇÓ 7: ORDRES D'AJUDA - ** Utilitzeu el sistema intern d'ajuda ** + ** Utilitzeu el sistema intern d'ajuda ** - El Vim té un extens sistema d'ajuda. Per llegir una introducció proveu una + El Vim té un extens sistema d'ajuda. Per a llegir una introducció proveu una d'aquestes tres coses: - - premeu la tecla (si en teniu alguna) - - premeu la tecla (si en teniu alguna) - - escriviu :help + - premeu la tecla (si la teniu) + - premeu la tecla (si la teniu) + - escriviu :help - Teclegeu :q per tancar la finestra d'ajuda. + Teclegeu :q per a tancar la finestra d'ajuda. - Podeu trobar ajuda sobre pràcticament qualsevol tema donant un argument - a l'ordre ":help". Proveu això (no oblideu prémer ): + Podeu trobar ajuda sobre pràcticament qualsevol tema passant un argument + a l'ordre ":help". Proveu el següent (no oblideu prémer ): - :help w - :help c_ , um Dich in den Normalmodus zu begeben. Dann gib das gewnschte Kommando noch einmal ein. -Anmerkung: Die Cursor-Tasten sollten ebenfalls funktionieren. Aber wenn Du +Anmerkung: Die Cursor-Tasten sollten ebenfalls funktionieren. Aber wenn Du hjkl benutzt, wirst Du in der Lage sein, Dich sehr viel schneller umherzubewegen, wenn Du Dich einmal daran gewhnt hast. Wirklich! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.de.utf-8 b/runtime/tutor/tutor.de.utf-8 index 799962c8d2..fe7a590086 100644 --- a/runtime/tutor/tutor.de.utf-8 +++ b/runtime/tutor/tutor.de.utf-8 @@ -41,7 +41,7 @@ Anmerkung: Immer, wenn Du Dir unsicher bist über das, was Du getippt hast, drücke , um Dich in den Normalmodus zu begeben. Dann gib das gewünschte Kommando noch einmal ein. -Anmerkung: Die Cursor-Tasten sollten ebenfalls funktionieren. Aber wenn Du +Anmerkung: Die Cursor-Tasten sollten ebenfalls funktionieren. Aber wenn Du hjkl benutzt, wirst Du in der Lage sein, Dich sehr viel schneller umherzubewegen, wenn Du Dich einmal daran gewöhnt hast. Wirklich! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.es.utf-8 b/runtime/tutor/tutor.es.utf-8 index 49c9cdbbf9..7ddb8d458e 100644 --- a/runtime/tutor/tutor.es.utf-8 +++ b/runtime/tutor/tutor.es.utf-8 @@ -542,7 +542,7 @@ Nota: ¡Esto es muy útil en la detección de errores en un programa con ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lección 5.3: UN MANDATO DE ESCRITURA SELECTIVO - ** Para guardar parte del fuchero escriba :#,# NOMBRE_DEL_FICHERO ** + ** Para guardar parte del fichero escriba :#,# NOMBRE_DEL_FICHERO ** 1. Escriba de nuevo, una vez más, :!dir o :!ls para obtener una lista diff --git a/runtime/tutor/tutor.fr b/runtime/tutor/tutor.fr index cdfdcd665b..1dd2621b52 100644 --- a/runtime/tutor/tutor.fr +++ b/runtime/tutor/tutor.fr @@ -88,7 +88,7 @@ NOTE : :q! La vvache saut au-ddessus dde la luune. +---> La vvache a saut au-ddessus dde la luune. 5. Maintenant que la ligne est correcte, passez la Leon 1.4. @@ -1034,5 +1034,5 @@ NOTE : Le compl Dernires mises jour par Dominique Pell. E-mail : dominique.pelle@gmail.com - Last Change : 2017 Jan 16 + Last Change : 2017 Jun 30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor.utf-8 b/runtime/tutor/tutor.utf-8 index 2afefbb533..c076e3bfdc 100644 --- a/runtime/tutor/tutor.utf-8 +++ b/runtime/tutor/tutor.utf-8 @@ -19,7 +19,7 @@ properly. If you only read the text, you will forget the commands! Now, make sure that your Caps-Lock key is NOT depressed and press - the j key enough times to move the cursor so that Lesson 1.1 + the j key enough times to move the cursor so that lesson 1.1 completely fills the screen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1.1: MOVING THE CURSOR @@ -36,7 +36,7 @@ 2. Hold down the down key (j) until it repeats. Now you know how to move to the next lesson. - 3. Using the down key, move to Lesson 1.2. + 3. Using the down key, move to lesson 1.2. NOTE: If you are ever unsure about something you typed, press to place you in Normal mode. Then retype the command you wanted. @@ -64,7 +64,7 @@ NOTE: The cursor keys should also work. But using hjkl you will be able to NOTE: :q! discards any changes you made. In a few lessons you will learn how to save the changes to a file. - 5. Move the cursor down to Lesson 1.3. + 5. Move the cursor down to lesson 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -84,7 +84,7 @@ NOTE: :q! discards any changes you made. In a few lessons you ---> The ccow jumpedd ovverr thhe mooon. - 5. Now that the line is correct, go on to Lesson 1.4. + 5. Now that the line is correct, go on to lesson 1.4. NOTE: As you go through this tutor, do not try to memorize, learn by usage. @@ -126,7 +126,7 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. 3. As the text has been appended press to return to Normal mode. - 4. Move the cursor to the second line marked ---> and repeat + 4. Move the cursor to the second line marked ---> and repeat steps 2 and 3 to correct this sentence. ---> There is some text missing from th @@ -152,13 +152,13 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. 3. Insert and delete text as you learned in the previous lessons. - 4. Save the file with changes and exit Vim with: :wq + 4. Save the file with changes and exit Vim with: :wq 5. If you have quit vimtutor in step 1 restart the vimtutor and move down to the following summary. 6. After reading the above steps and understanding them: do it. - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 1 SUMMARY @@ -180,7 +180,7 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. NOTE: Pressing will place you in Normal mode or will cancel an unwanted and partially completed command. -Now continue with Lesson 2. +Now continue with lesson 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 2.1: DELETION COMMANDS @@ -202,7 +202,7 @@ Now continue with Lesson 2. ---> There are a some words fun that don't belong paper in this sentence. - 5. Repeat steps 3 and 4 until the sentence is correct and go to Lesson 2.2. + 5. Repeat steps 3 and 4 until the sentence is correct and go to lesson 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -222,7 +222,7 @@ Now continue with Lesson 2. ---> Somebody typed the end of this line twice. end of this line twice. - 5. Move on to Lesson 2.3 to understand what is happening. + 5. Move on to lesson 2.3 to understand what is happening. @@ -257,7 +257,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ** Typing a number before a motion repeats it that many times. ** - 1. Move the cursor to the start of the line marked ---> below. + 1. Move the cursor to the start of the line below marked --->. 2. Type 2w to move the cursor two words forward. @@ -269,7 +269,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ---> This is just a line with words you can move around in. - 6. Move on to Lesson 2.5. + 6. Move on to lesson 2.5. @@ -286,10 +286,10 @@ NOTE: Pressing just the motion while in Normal mode without an operator will 1. Move the cursor to the first UPPER CASE word in the line marked --->. - 2. Type d2w to delete the two UPPER CASE words + 2. Type d2w to delete the two UPPER CASE words. 3. Repeat steps 1 and 2 with a different count to delete the consecutive - UPPER CASE words with one command + UPPER CASE words with one command. ---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. @@ -338,7 +338,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ---> Fiix the errors oon thhis line and reeplace them witth undo. - 8. These are very useful commands. Now move on to the Lesson 2 Summary. + 8. These are very useful commands. Now move on to the lesson 2 Summary. @@ -372,7 +372,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ** Type p to put previously deleted text after the cursor. ** - 1. Move the cursor to the first ---> line below. + 1. Move the cursor to the first line below marked --->. 2. Type dd to delete the line and store it in a Vim register. @@ -406,7 +406,7 @@ NOTE: Pressing just the motion while in Normal mode without an operator will ---> Whan this lime was tuoed in, someone presswd some wrojg keys! ---> When this line was typed in, someone pressed some wrong keys! - 5. Now move on to Lesson 3.3. + 5. Now move on to lesson 3.3. NOTE: Remember that you should be learning by doing, not memorization. @@ -447,7 +447,7 @@ Notice that ce deletes the word and places you in Insert mode. 2. The motions are the same, such as w (word) and $ (end of line). - 3. Move to the first line below marked --->. + 3. Move the cursor to the first line below marked --->. 4. Move the cursor to the first error. @@ -558,7 +558,7 @@ NOTE: This is very useful in debugging a program with unmatched parentheses! 1. Move the cursor to the line below marked --->. - 2. Type :s/thee/the . Note that this command only changes the + 2. Type :s/thee/the . Note that this command only changes the first occurrence of "thee" in the line. 3. Now type :s/thee/the/g . Adding the g flag means to substitute @@ -623,7 +623,7 @@ NOTE: All : commands must be finished by hitting Lesson 5.2: MORE ON WRITING FILES - ** To save the changes made to the text, type :w FILENAME. ** + ** To save the changes made to the text, type :w FILENAME ** 1. Type :!dir or :!ls to get a listing of your directory. You already know you must hit after this. @@ -638,7 +638,7 @@ NOTE: All : commands must be finished by hitting NOTE: If you were to exit Vim and start it again with vim TEST , the file would be an exact copy of the tutor when you saved it. - 5. Now remove the file by typing (MS-DOS): :!del TEST + 5. Now remove the file by typing (Windows): :!del TEST or (Unix): :!rm TEST @@ -673,7 +673,7 @@ NOTE: Pressing v starts Visual selection. You can move the cursor around 1. Place the cursor just above this line. -NOTE: After executing Step 2 you will see text from Lesson 5.3. Then move +NOTE: After executing Step 2 you will see text from lesson 5.3. Then move DOWN to see this lesson again. 2. Now retrieve your TEST file using the command :r TEST where TEST is @@ -681,7 +681,7 @@ NOTE: After executing Step 2 you will see text from Lesson 5.3. Then move The file you retrieve is placed below the cursor line. 3. To verify that a file was retrieved, cursor back and notice that there - are now two copies of Lesson 5.3, the original and the file version. + are now two copies of lesson 5.3, the original and the file version. NOTE: You can also read the output of an external command. For example, :r !ls reads the output of the ls command and puts it below the @@ -695,7 +695,7 @@ NOTE: You can also read the output of an external command. For example, 1. :!command executes an external command. Some useful examples are: - (MS-DOS) (Unix) + (Windows) (Unix) :!dir :!ls - shows a directory listing. :!del FILENAME :!rm FILENAME - removes file FILENAME. @@ -717,7 +717,7 @@ NOTE: You can also read the output of an external command. For example, ** Type o to open a line below the cursor and place you in Insert mode. ** - 1. Move the cursor to the line below marked --->. + 1. Move the cursor to the first line below marked --->. 2. Type the lowercase letter o to open up a line BELOW the cursor and place you in Insert mode. @@ -740,8 +740,8 @@ NOTE: You can also read the output of an external command. For example, ** Type a to insert text AFTER the cursor. ** - 1. Move the cursor to the start of the line below marked --->. - + 1. Move the cursor to the start of the first line below marked --->. + 2. Press e until the cursor is on the end of li . 3. Type an a (lowercase) to append text AFTER the cursor. @@ -750,7 +750,7 @@ NOTE: You can also read the output of an external command. For example, mode. 5. Use e to move to the next incomplete word and repeat steps 3 and 4. - + ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. @@ -786,10 +786,10 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an ** Use the y operator to copy text and p to paste it ** - 1. Go to the line marked with ---> below and place the cursor after "a)". - + 1. Move to the line below marked ---> and place the cursor after "a)". + 2. Start Visual mode with v and move the cursor to just before "first". - + 3. Type y to yank (copy) the highlighted text. 4. Move the cursor to the end of the next line: j$ @@ -802,14 +802,14 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an ---> a) this is the first item. b) - NOTE: you can also use y as an operator; yw yanks one word. + NOTE: You can also use y as an operator; yw yanks one word. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6.5: SET OPTION ** Set an option so a search or substitute ignores case ** - 1. Search for 'ignore' by entering: /ignore + 1. Search for 'ignore' by entering: /ignore Repeat several times by pressing n . 2. Set the 'ic' (Ignore case) option by entering: :set ic @@ -823,9 +823,9 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an 6. To disable ignoring case enter: :set noic -NOTE: To remove the highlighting of matches enter: :nohlsearch +NOTE: To remove the highlighting of matches enter: :nohlsearch NOTE: If you want to ignore case for just one search command, use \c - in the phrase: /ignore\c + in the phrase: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lesson 6 SUMMARY @@ -883,7 +883,7 @@ NOTE: If you want to ignore case for just one search command, use \c 1. Start editing the "vimrc" file. This depends on your system: :e ~/.vimrc for Unix - :e $VIM/_vimrc for MS-Windows + :e $VIM/_vimrc for Windows 2. Now read the example "vimrc" file contents: :r $VIMRUNTIME/vimrc_example.vim @@ -909,7 +909,7 @@ NOTE: If you want to ignore case for just one search command, use \c 4. Press CTRL-D and Vim will show a list of commands that start with "e". - 5. Press and Vim will complete the command name to ":edit". + 5. Type d and Vim will complete the command name to ":edit". 6. Now add a space and the start of an existing file name: :edit FIL @@ -922,13 +922,13 @@ NOTE: Completion works for many commands. Just try pressing CTRL-D and Lesson 7 SUMMARY - 1. Type :help or press or to open a help window. + 1. Type :help or press or to open a help window. 2. Type :help cmd to find help on cmd . - 3. Type CTRL-W CTRL-W to jump to another window + 3. Type CTRL-W CTRL-W to jump to another window. - 4. Type :q to close the help window + 4. Type :q to close the help window. 5. Create a vimrc startup script to keep your preferred settings. diff --git a/runtime/tutor/tutor.zh.big5 b/runtime/tutor/tutor.zh.big5 index 9da8b1a352..710926af89 100644 --- a/runtime/tutor/tutor.zh.big5 +++ b/runtime/tutor/tutor.zh.big5 @@ -35,7 +35,7 @@ ---> {bzӤwgǷ|p󲾰ʨU@aC - 3. {bШϥΤUANвʨĤGC + 3. {bШϥΤUANвʨĤ@ĤG`C ܡJpGzTwzҫUrAЫU^쥿`(Normal)ҦC MAqLJzQnROC diff --git a/runtime/vim.desktop b/runtime/vim.desktop index d6be896d10..863cd24435 100644 --- a/runtime/vim.desktop +++ b/runtime/vim.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=Vim GenericName=Text Editor -GenericName[da]=Tekstredigering +GenericName[da]=Teksteditor GenericName[de]=Texteditor GenericName[pl]=Edytor tekstu Comment=Edit text files @@ -16,7 +16,7 @@ Comment[bs]=Izmijeni tekstualne datoteke Comment[ca]=Edita fitxers de text Comment[cs]=Úprava textových souborů Comment[cy]=Golygu ffeiliau testun -Comment[da]=Redigér tekstfiler +Comment[da]=Rediger tekstfiler Comment[de]=Textdateien bearbeiten Comment[el]=Επεξεργασία αρχείων κειμένου Comment[en_CA]=Edit text files diff --git a/src/po/sr.po b/src/po/sr.po index b4433efe36..88c5d18866 100644 --- a/src/po/sr.po +++ b/src/po/sr.po @@ -1,4 +1,4 @@ -# Serbian Cyrillic Translation for Vim +# Serbian Cyrillic translation for Vim # # Do ":help uganda" in Vim to read copying and usage conditions. # Do ":help credits" in Vim to see a list of people who contributed. @@ -13,7 +13,8 @@ msgstr "" "POT-Creation-Date: 2018-05-15 11:55+0400\n" "PO-Revision-Date: 2018-05-15 10:50+0400\n" "Last-Translator: Ivan Pešić \n" -"Language-Team: Serbian \n" +"Language-Team: Serbian\n" +"Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -2027,7 +2028,7 @@ msgid "" "--- Autocommands ---" msgstr "" "\n" -"--- Ауто-Команде ---" +"--- Аутокоманде ---" #, c-format msgid "E680: : invalid buffer number " @@ -2040,11 +2041,11 @@ msgid "No matching autocommands" msgstr "Нема подударајућих аутокоманди" msgid "E218: autocommand nesting too deep" -msgstr "E218: Угњшждавање аутокоманде је сувише дубоко" +msgstr "E218: Угњеждавање аутокоманде је сувише дубоко" #, c-format msgid "%s Autocommands for \"%s\"" -msgstr "%s Ауто команде за \"%s\"" +msgstr "%s Аутокоманде за \"%s\"" #, c-format msgid "Executing %s" @@ -2962,7 +2963,7 @@ msgid "" msgstr "" "\n" "\n" -"употреба:" +"Употреба:" msgid " vim [arguments] " msgstr " vim [аргументи] " @@ -4765,7 +4766,7 @@ msgid "E66: \\z( not allowed here" msgstr "E66: \\z( овде није дозвољено" msgid "E67: \\z1 - \\z9 not allowed here" -msgstr "E67: \\z1 и остали онвде нису дозвољени" +msgstr "E67: \\z1 - \\z9 овде нису дозвољени" #, c-format msgid "E69: Missing ] after %s%%[" @@ -4891,7 +4892,7 @@ msgid "E873: (NFA regexp) proper termination error" msgstr "E873: (NFA regexp) грешка правилне терминације" msgid "E874: (NFA) Could not pop the stack!" -msgstr "E874: (NFA) Скидање са стека није успело !" +msgstr "E874: (NFA) Скидање са стека није успело!" msgid "" "E875: (NFA regexp) (While converting from postfix to NFA), too many states " From d90a144eda047816acffc7a8f297b43a7120710e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 15 Jul 2018 20:24:31 +0200 Subject: [PATCH 12/31] patch 8.1.0189: function defined in sandbox not tested Problem: Function defined in sandbox not tested. Solution: Add a text. --- src/testdir/test_functions.vim | 16 ++++++++++++++++ src/version.c | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 7efbbe8829..5cfaaa0643 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -984,3 +984,19 @@ func Test_libcall_libcallnr() call assert_fails("call libcall('Xdoesnotexist_', 'getenv', 'HOME')", 'E364:') call assert_fails("call libcallnr('Xdoesnotexist_', 'strlen', 'abcd')", 'E364:') endfunc + +sandbox function Fsandbox() + normal ix +endfunc + +func Test_func_sandbox() + sandbox let F = {-> 'hello'} + call assert_equal('hello', F()) + + sandbox let F = {-> execute("normal ix\")} + call assert_fails('call F()', 'E48:') + unlet F + + call assert_fails('call Fsandbox()', 'E48:') + delfunc Fsandbox +endfunc diff --git a/src/version.c b/src/version.c index 892b9aea1d..c48804cc73 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 189, /**/ 188, /**/ From 18c4f1badbc96d39de5b348f268ac8d55c2b0b67 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 16 Jul 2018 17:45:38 +0200 Subject: [PATCH 13/31] patch 8.1.0190: Perl refcounts are wrong Problem: Perl refcounts are wrong. Solution: Improve refcounting. Add a test. (Damien) --- src/if_perl.xs | 49 +++++++++++++++++++++++++++++---------- src/testdir/test_perl.vim | 32 +++++++++++++++++++++---- src/version.c | 2 ++ 3 files changed, 66 insertions(+), 17 deletions(-) diff --git a/src/if_perl.xs b/src/if_perl.xs index 40955ebf0e..9f50a87c32 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -845,6 +845,14 @@ newBUFrv(SV *rv, buf_T *ptr) return sv_bless(rv, gv_stashpv("VIBUF", TRUE)); } +#if 0 +SV *__sv_save[1024]; +int __sv_save_ix; +# define D_Save_Sv(sv) do { if (__sv_save_ix < 1024) __sv_save[__sv_save_ix++] = (sv); } while (0) +#else +# define D_Save_Sv(sv) NOOP +#endif + /* * perl_win_free * Remove all references to the window to be destroyed @@ -852,17 +860,27 @@ newBUFrv(SV *rv, buf_T *ptr) void perl_win_free(win_T *wp) { - if (wp->w_perl_private) - sv_setiv((SV *)wp->w_perl_private, 0); - return; + if (wp->w_perl_private && perl_interp != NULL) + { + SV *sv = (SV*)wp->w_perl_private; + D_Save_Sv(sv); + sv_setiv(sv, 0); + SvREFCNT_dec(sv); + } + wp->w_perl_private = NULL; } void perl_buf_free(buf_T *bp) { - if (bp->b_perl_private) - sv_setiv((SV *)bp->b_perl_private, 0); - return; + if (bp->b_perl_private && perl_interp != NULL) + { + SV *sv = (SV *)bp->b_perl_private; + D_Save_Sv(sv); + sv_setiv(sv, 0); + SvREFCNT_dec(sv); + } + bp->b_perl_private = NULL; } #ifndef PROTO @@ -885,12 +903,19 @@ I32 cur_val(IV iv, SV *sv) # endif { SV *rv; + if (iv == 0) rv = newWINrv(newSV(0), curwin); else rv = newBUFrv(newSV(0), curbuf); - sv_setsv(sv, rv); - SvREFCNT_dec(SvRV(rv)); + + if (SvRV(sv) == SvRV(rv)) + SvREFCNT_dec(SvRV(rv)); + else /* XXX: Not sure if the `else` condition are right + * Test_SvREFCNT() pass in all case. + */ + sv_setsv(sv, rv); + return 0; } #endif /* !PROTO */ @@ -1539,7 +1564,7 @@ Buffers(...) else { FOR_ALL_BUFFERS(vimbuf) - XPUSHs(newBUFrv(newSV(0), vimbuf)); + XPUSHs(sv_2mortal(newBUFrv(newSV(0), vimbuf))); } } else @@ -1564,7 +1589,7 @@ Buffers(...) { vimbuf = buflist_findnr(b); if (vimbuf) - XPUSHs(newBUFrv(newSV(0), vimbuf)); + XPUSHs(sv_2mortal(newBUFrv(newSV(0), vimbuf))); } } } @@ -1584,7 +1609,7 @@ Windows(...) else { FOR_ALL_WINDOWS(vimwin) - XPUSHs(newWINrv(newSV(0), vimwin)); + XPUSHs(sv_2mortal(newWINrv(newSV(0), vimwin))); } } else @@ -1594,7 +1619,7 @@ Windows(...) w = (int) SvIV(ST(i)); vimwin = win_find_nr(w); if (vimwin) - XPUSHs(newWINrv(newSV(0), vimwin)); + XPUSHs(sv_2mortal(newWINrv(newSV(0), vimwin))); } } diff --git a/src/testdir/test_perl.vim b/src/testdir/test_perl.vim index 6ef17ad8bb..4934780a62 100644 --- a/src/testdir/test_perl.vim +++ b/src/testdir/test_perl.vim @@ -219,20 +219,42 @@ EOF call assert_equal(['&VIM::Msg', 'STDOUT', 'STDERR'], split(l:out, "\n")) endfunc -func Test_SvREFCNT() +" Run first to get a clean namespace +func Test_000_SvREFCNT() + for i in range(10) + exec 'new X'.i + endfor new t perl <<--perl +#line 5 "Test_000_SvREFCNT()" my ($b, $w); - $b = $curbuf for 0 .. 10; - $w = $curwin for 0 .. 10; + + $b = $curbuf for 0 .. 100; + $w = $curwin for 0 .. 100; + () = VIM::Buffers for 0 .. 100; + () = VIM::Windows for 0 .. 100; + VIM::DoCommand('bw! t'); if (exists &Internals::SvREFCNT) { my $cb = Internals::SvREFCNT($$b); my $cw = Internals::SvREFCNT($$w); - VIM::Eval("assert_equal(2, $cb)"); - VIM::Eval("assert_equal(2, $cw)"); + VIM::Eval("assert_equal(2, $cb, 'T1')"); + VIM::Eval("assert_equal(2, $cw, 'T2')"); + foreach ( VIM::Buffers, VIM::Windows ) { + my $c = Internals::SvREFCNT($_); + VIM::Eval("assert_equal(2, $c, 'T3')"); + $c = Internals::SvREFCNT($$_); + # Why only one ref? + # Look wrong but work. Maybe not portable... + VIM::Eval("assert_equal(1, $c, 'T4')"); + } + $cb = Internals::SvREFCNT($$curbuf); + $cw = Internals::SvREFCNT($$curwin); + VIM::Eval("assert_equal(3, $cb, 'T5')"); + VIM::Eval("assert_equal(3, $cw, 'T6')"); } VIM::Eval("assert_false($$b)"); VIM::Eval("assert_false($$w)"); --perl + %bw! endfunc diff --git a/src/version.c b/src/version.c index c48804cc73..ffc651dc5e 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 190, /**/ 189, /**/ From 3166afd945e57f04b231e71e054b9593cc29ff0b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 16 Jul 2018 18:09:14 +0200 Subject: [PATCH 14/31] patch 8.1.0191: Perl test fails in 24 line terminal Problem: Perl test fails in 24 line terminal. Solution: Create fewer windows. --- src/testdir/test_perl.vim | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_perl.vim b/src/testdir/test_perl.vim index 4934780a62..0528814b42 100644 --- a/src/testdir/test_perl.vim +++ b/src/testdir/test_perl.vim @@ -221,7 +221,7 @@ endfunc " Run first to get a clean namespace func Test_000_SvREFCNT() - for i in range(10) + for i in range(8) exec 'new X'.i endfor new t diff --git a/src/version.c b/src/version.c index ffc651dc5e..670c2e3053 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 191, /**/ 190, /**/ From 0270f38e1ae484c31a80c813a08691c47a207f1a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jul 2018 05:43:58 +0200 Subject: [PATCH 15/31] patch 8.1.0192: executing regexp recursively fails with a crash Problem: Executing regexp recursively fails with a crash. Solution: Move global variables into "rex". --- src/regexp.c | 405 +++++++++++++++++++++++--------------------- src/regexp.h | 11 +- src/regexp_nfa.c | 429 +++++++++++++++++++++++------------------------ src/version.c | 2 + 4 files changed, 434 insertions(+), 413 deletions(-) diff --git a/src/regexp.c b/src/regexp.c index 7344928ff0..88cf8817ab 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -344,7 +344,6 @@ toggle_Magic(int x) #define MAX_LIMIT (32767L << 16L) -static int re_multi_type(int); static int cstrncmp(char_u *s1, char_u *s2, int *n); static char_u *cstrchr(char_u *, int); @@ -371,6 +370,8 @@ static char_u e_z1_not_allowed[] = N_("E67: \\z1 - \\z9 not allowed here"); #endif static char_u e_missing_sb[] = N_("E69: Missing ] after %s%%["); static char_u e_empty_sb[] = N_("E70: Empty %s%%[]"); +static char_u e_recursive[] = N_("E956: Cannot use pattern recursively"); + #define NOT_MULTI 0 #define MULTI_ONE 1 #define MULTI_MULT 2 @@ -426,14 +427,6 @@ static char_u *reg_prev_sub = NULL; static char_u REGEXP_INRANGE[] = "]^-n\\"; static char_u REGEXP_ABBR[] = "nrtebdoxuU"; -static int backslash_trans(int c); -static int get_char_class(char_u **pp); -static int get_equi_class(char_u **pp); -static void reg_equi_class(int c); -static int get_coll_element(char_u **pp); -static char_u *skip_anyof(char_u *p); -static void init_class_tab(void); - /* * Translate '\x' to its control character, except "\n", which is Magic. */ @@ -688,8 +681,6 @@ typedef struct * Forward declarations for vim_regcomp()'s friends. */ static void initchr(char_u *); -static void save_parse_state(parse_state_T *ps); -static void restore_parse_state(parse_state_T *ps); static int getchr(void); static void skipchr_keepstart(void); static int peekchr(void); @@ -1171,7 +1162,6 @@ get_coll_element(char_u **pp) return 0; } -static void get_cpo_flags(void); static int reg_cpo_lit; /* 'cpoptions' contains 'l' flag */ static int reg_cpo_bsl; /* 'cpoptions' contains '\' flag */ @@ -1322,9 +1312,6 @@ seen_endbrace(int refnum) return TRUE; } -static regprog_T *bt_regcomp(char_u *expr, int re_flags); -static void bt_regfree(regprog_T *prog); - /* * bt_regcomp() - compile a regular expression into internal code for the * traditional back track matcher. @@ -1373,6 +1360,7 @@ bt_regcomp(char_u *expr, int re_flags) r = (bt_regprog_T *)lalloc(sizeof(bt_regprog_T) + regsize, TRUE); if (r == NULL) return NULL; + r->re_in_use = FALSE; /* * Second pass: emit code. @@ -1525,9 +1513,9 @@ vim_regcomp_had_eol(void) } #endif -/* variables for parsing reginput */ -static int at_start; /* True when on the first character */ -static int prev_at_start; /* True when on the second character */ +// variables used for parsing +static int at_start; // True when on the first character +static int prev_at_start; // True when on the second character /* * Parse regular expression, i.e. main body or parenthesized thing. @@ -3443,18 +3431,6 @@ read_limits(long *minval, long *maxval) * Global work variables for vim_regexec(). */ -/* The current match-position is remembered with these variables: */ -static linenr_T reglnum; /* line number, relative to first line */ -static char_u *regline; /* start of current line */ -static char_u *reginput; /* current input, points into "regline" */ - -static int need_clear_subexpr; /* subexpressions still need to be - * cleared */ -#ifdef FEAT_SYN_HL -static int need_clear_zsubexpr = FALSE; /* extmatch subexpressions - * still need to be cleared */ -#endif - /* * Structure used to save the current input state, when it needs to be * restored after trying a match. Used by reg_save() and reg_restore(). @@ -3464,8 +3440,8 @@ typedef struct { union { - char_u *ptr; /* reginput pointer, for single-line regexp */ - lpos_T pos; /* reginput pos, for multi-line regexp */ + char_u *ptr; /* rex.input pointer, for single-line regexp */ + lpos_T pos; /* rex.input pos, for multi-line regexp */ } rs_u; int rs_len; } regsave_T; @@ -3564,13 +3540,24 @@ typedef struct { linenr_T reg_maxline; int reg_line_lbr; /* "\n" in string is line break */ + // The current match-position is stord in these variables: + linenr_T lnum; // line number, relative to first line + char_u *line; // start of current line + char_u *input; // current input, points into "regline" + + int need_clear_subexpr; // subexpressions still need to be cleared +#ifdef FEAT_SYN_HL + int need_clear_zsubexpr; // extmatch subexpressions still need to be + // cleared +#endif + /* Internal copy of 'ignorecase'. It is set at each call to vim_regexec(). * Normally it gets the value of "rm_ic" or "rmm_ic", but when the pattern * contains '\c' or '\C' the value is overruled. */ int reg_ic; #ifdef FEAT_MBYTE - /* Similar to rex.reg_ic, but only for 'combining' characters. Set with \Z + /* Similar to "reg_ic", but only for 'combining' characters. Set with \Z * flag in the regexp. Defaults to false, always. */ int reg_icombine; #endif @@ -3578,6 +3565,22 @@ typedef struct { /* Copy of "rmm_maxcol": maximum column to search for a match. Zero when * there is no maximum. */ colnr_T reg_maxcol; + + // State for the NFA engine regexec. + int nfa_has_zend; // NFA regexp \ze operator encountered. + int nfa_has_backref; // NFA regexp \1 .. \9 encountered. + int nfa_nsubexpr; // Number of sub expressions actually being used + // during execution. 1 if only the whole match + // (subexpr 0) is used. + // listid is global, so that it increases on recursive calls to + // nfa_regmatch(), which means we don't have to clear the lastlist field of + // all the states. + int nfa_listid; + int nfa_alt_listid; + +#ifdef FEAT_SYN_HL + int nfa_has_zsubexpr; // NFA regexp has \z( ), set zsubexpr. +#endif } regexec_T; static regexec_T rex; @@ -3619,7 +3622,7 @@ typedef struct regitem_S { save_se_T sesave; regsave_T regsave; - } rs_un; /* room for saving reginput */ + } rs_un; /* room for saving rex.input */ short rs_no; /* submatch nr or BEHIND/NOBEHIND */ } regitem_T; @@ -3896,8 +3899,8 @@ bt_regexec_both( goto theend; } - regline = line; - reglnum = 0; + rex.line = line; + rex.lnum = 0; reg_toolong = FALSE; /* Simplest case: Anchored match need be tried only once. */ @@ -3907,10 +3910,10 @@ bt_regexec_both( #ifdef FEAT_MBYTE if (has_mbyte) - c = (*mb_ptr2char)(regline + col); + c = (*mb_ptr2char)(rex.line + col); else #endif - c = regline[col]; + c = rex.line[col]; if (prog->regstart == NUL || prog->regstart == c || (rex.reg_ic && (( @@ -3940,15 +3943,15 @@ bt_regexec_both( && !has_mbyte #endif ) - s = vim_strbyte(regline + col, prog->regstart); + s = vim_strbyte(rex.line + col, prog->regstart); else - s = cstrchr(regline + col, prog->regstart); + s = cstrchr(rex.line + col, prog->regstart); if (s == NULL) { retval = 0; break; } - col = (int)(s - regline); + col = (int)(s - rex.line); } /* Check for maximum column to try. */ @@ -3963,16 +3966,16 @@ bt_regexec_both( break; /* if not currently on the first line, get it again */ - if (reglnum != 0) + if (rex.lnum != 0) { - reglnum = 0; - regline = reg_getline((linenr_T)0); + rex.lnum = 0; + rex.line = reg_getline((linenr_T)0); } - if (regline[col] == NUL) + if (rex.line[col] == NUL) break; #ifdef FEAT_MBYTE if (has_mbyte) - col += (*mb_ptr2len)(regline + col); + col += (*mb_ptr2len)(rex.line + col); else #endif ++col; @@ -4052,7 +4055,7 @@ unref_extmatch(reg_extmatch_T *em) #endif /* - * regtry - try match of "prog" with at regline["col"]. + * regtry - try match of "prog" with at rex.line["col"]. * Returns 0 for failure, number of lines contained in the match otherwise. */ static long @@ -4062,12 +4065,11 @@ regtry( proftime_T *tm, /* timeout limit or NULL */ int *timed_out) /* flag set on timeout or NULL */ { - reginput = regline + col; - need_clear_subexpr = TRUE; + rex.input = rex.line + col; + rex.need_clear_subexpr = TRUE; #ifdef FEAT_SYN_HL - /* Clear the external match subpointers if necessary. */ - if (prog->reghasz == REX_SET) - need_clear_zsubexpr = TRUE; + // Clear the external match subpointers if necessary. + rex.need_clear_zsubexpr = (prog->reghasz == REX_SET); #endif if (regmatch(prog->program + 1, tm, timed_out) == 0) @@ -4083,19 +4085,19 @@ regtry( } if (rex.reg_endpos[0].lnum < 0) { - rex.reg_endpos[0].lnum = reglnum; - rex.reg_endpos[0].col = (int)(reginput - regline); + rex.reg_endpos[0].lnum = rex.lnum; + rex.reg_endpos[0].col = (int)(rex.input - rex.line); } else /* Use line number of "\ze". */ - reglnum = rex.reg_endpos[0].lnum; + rex.lnum = rex.reg_endpos[0].lnum; } else { if (rex.reg_startp[0] == NULL) - rex.reg_startp[0] = regline + col; + rex.reg_startp[0] = rex.line + col; if (rex.reg_endp[0] == NULL) - rex.reg_endp[0] = reginput; + rex.reg_endp[0] = rex.input; } #ifdef FEAT_SYN_HL /* Package any found \z(...\) matches for export. Default is none. */ @@ -4131,7 +4133,7 @@ regtry( } } #endif - return 1 + reglnum; + return 1 + rex.lnum; } #ifdef FEAT_MBYTE @@ -4143,9 +4145,9 @@ static int reg_prev_class(void); static int reg_prev_class(void) { - if (reginput > regline) - return mb_get_class_buf(reginput - 1 - - (*mb_head_off)(regline, reginput - 1), rex.reg_buf); + if (rex.input > rex.line) + return mb_get_class_buf(rex.input - 1 + - (*mb_head_off)(rex.line, rex.input - 1), rex.reg_buf); return -1; } #endif @@ -4153,7 +4155,7 @@ reg_prev_class(void) static int reg_match_visual(void); /* - * Return TRUE if the current reginput position matches the Visual area. + * Return TRUE if the current rex.input position matches the Visual area. */ static int reg_match_visual(void) @@ -4199,13 +4201,13 @@ reg_match_visual(void) } mode = curbuf->b_visual.vi_mode; } - lnum = reglnum + rex.reg_firstlnum; + lnum = rex.lnum + rex.reg_firstlnum; if (lnum < top.lnum || lnum > bot.lnum) return FALSE; if (mode == 'v') { - col = (colnr_T)(reginput - regline); + col = (colnr_T)(rex.input - rex.line); if ((lnum == top.lnum && col < top.col) || (lnum == bot.lnum && col >= bot.col + (*p_sel != 'e'))) return FALSE; @@ -4220,14 +4222,14 @@ reg_match_visual(void) end = end2; if (top.col == MAXCOL || bot.col == MAXCOL) end = MAXCOL; - cols = win_linetabsize(wp, regline, (colnr_T)(reginput - regline)); + cols = win_linetabsize(wp, rex.line, (colnr_T)(rex.input - rex.line)); if (cols < start || cols > end - (*p_sel == 'e')) return FALSE; } return TRUE; } -#define ADVANCE_REGINPUT() MB_PTR_ADV(reginput) +#define ADVANCE_REGINPUT() MB_PTR_ADV(rex.input) /* * The arguments from BRACE_LIMITS are stored here. They are actually local @@ -4247,9 +4249,9 @@ static long bl_maxval; * (that don't need to know whether the rest of the match failed) by a nested * loop. * - * Returns TRUE when there is a match. Leaves reginput and reglnum just after + * Returns TRUE when there is a match. Leaves rex.input and rex.lnum just after * the last matched character. - * Returns FALSE when there is no match. Leaves reginput and reglnum in an + * Returns FALSE when there is no match. Leaves rex.input and rex.lnum in an * undefined state! */ static int @@ -4349,11 +4351,11 @@ regmatch( op = OP(scan); /* Check for character class with NL added. */ if (!rex.reg_line_lbr && WITH_NL(op) && REG_MULTI - && *reginput == NUL && reglnum <= rex.reg_maxline) + && *rex.input == NUL && rex.lnum <= rex.reg_maxline) { reg_nextline(); } - else if (rex.reg_line_lbr && WITH_NL(op) && *reginput == '\n') + else if (rex.reg_line_lbr && WITH_NL(op) && *rex.input == '\n') { ADVANCE_REGINPUT(); } @@ -4363,14 +4365,14 @@ regmatch( op -= ADD_NL; #ifdef FEAT_MBYTE if (has_mbyte) - c = (*mb_ptr2char)(reginput); + c = (*mb_ptr2char)(rex.input); else #endif - c = *reginput; + c = *rex.input; switch (op) { case BOL: - if (reginput != regline) + if (rex.input != rex.line) status = RA_NOMATCH; break; @@ -4383,13 +4385,13 @@ regmatch( /* We're not at the beginning of the file when below the first * line where we started, not at the start of the line or we * didn't start at the first line of the buffer. */ - if (reglnum != 0 || reginput != regline + if (rex.lnum != 0 || rex.input != rex.line || (REG_MULTI && rex.reg_firstlnum > 1)) status = RA_NOMATCH; break; case RE_EOF: - if (reglnum != rex.reg_maxline || c != NUL) + if (rex.lnum != rex.reg_maxline || c != NUL) status = RA_NOMATCH; break; @@ -4397,9 +4399,9 @@ regmatch( /* Check if the buffer is in a window and compare the * rex.reg_win->w_cursor position to the match position. */ if (rex.reg_win == NULL - || (reglnum + rex.reg_firstlnum + || (rex.lnum + rex.reg_firstlnum != rex.reg_win->w_cursor.lnum) - || ((colnr_T)(reginput - regline) + || ((colnr_T)(rex.input - rex.line) != rex.reg_win->w_cursor.col)) status = RA_NOMATCH; break; @@ -4414,13 +4416,13 @@ regmatch( pos = getmark_buf(rex.reg_buf, mark, FALSE); if (pos == NULL /* mark doesn't exist */ || pos->lnum <= 0 /* mark isn't set in reg_buf */ - || (pos->lnum == reglnum + rex.reg_firstlnum - ? (pos->col == (colnr_T)(reginput - regline) + || (pos->lnum == rex.lnum + rex.reg_firstlnum + ? (pos->col == (colnr_T)(rex.input - rex.line) ? (cmp == '<' || cmp == '>') - : (pos->col < (colnr_T)(reginput - regline) + : (pos->col < (colnr_T)(rex.input - rex.line) ? cmp != '>' : cmp != '<')) - : (pos->lnum < reglnum + rex.reg_firstlnum + : (pos->lnum < rex.lnum + rex.reg_firstlnum ? cmp != '>' : cmp != '<'))) status = RA_NOMATCH; @@ -4433,24 +4435,24 @@ regmatch( break; case RE_LNUM: - if (!REG_MULTI || !re_num_cmp((long_u)(reglnum + rex.reg_firstlnum), + if (!REG_MULTI || !re_num_cmp((long_u)(rex.lnum + rex.reg_firstlnum), scan)) status = RA_NOMATCH; break; case RE_COL: - if (!re_num_cmp((long_u)(reginput - regline) + 1, scan)) + if (!re_num_cmp((long_u)(rex.input - rex.line) + 1, scan)) status = RA_NOMATCH; break; case RE_VCOL: if (!re_num_cmp((long_u)win_linetabsize( rex.reg_win == NULL ? curwin : rex.reg_win, - regline, (colnr_T)(reginput - regline)) + 1, scan)) + rex.line, (colnr_T)(rex.input - rex.line)) + 1, scan)) status = RA_NOMATCH; break; - case BOW: /* \ regline - && vim_iswordc_buf(reginput[-1], rex.reg_buf))) + if (!vim_iswordc_buf(c, rex.reg_buf) || (rex.input > rex.line + && vim_iswordc_buf(rex.input[-1], rex.reg_buf))) status = RA_NOMATCH; } break; - case EOW: /* word\>; reginput points after d */ - if (reginput == regline) /* Can't match at start of line */ + case EOW: /* word\>; rex.input points after d */ + if (rex.input == rex.line) /* Can't match at start of line */ status = RA_NOMATCH; #ifdef FEAT_MBYTE else if (has_mbyte) @@ -4483,7 +4485,7 @@ regmatch( int this_class, prev_class; /* Get class of current and previous char (if it exists). */ - this_class = mb_get_class_buf(reginput, rex.reg_buf); + this_class = mb_get_class_buf(rex.input, rex.reg_buf); prev_class = reg_prev_class(); if (this_class == prev_class || prev_class == 0 || prev_class == 1) @@ -4492,8 +4494,8 @@ regmatch( #endif else { - if (!vim_iswordc_buf(reginput[-1], rex.reg_buf) - || (reginput[0] != NUL + if (!vim_iswordc_buf(rex.input[-1], rex.reg_buf) + || (rex.input[0] != NUL && vim_iswordc_buf(c, rex.reg_buf))) status = RA_NOMATCH; } @@ -4515,22 +4517,22 @@ regmatch( break; case SIDENT: - if (VIM_ISDIGIT(*reginput) || !vim_isIDc(c)) + if (VIM_ISDIGIT(*rex.input) || !vim_isIDc(c)) status = RA_NOMATCH; else ADVANCE_REGINPUT(); break; case KWORD: - if (!vim_iswordp_buf(reginput, rex.reg_buf)) + if (!vim_iswordp_buf(rex.input, rex.reg_buf)) status = RA_NOMATCH; else ADVANCE_REGINPUT(); break; case SKWORD: - if (VIM_ISDIGIT(*reginput) - || !vim_iswordp_buf(reginput, rex.reg_buf)) + if (VIM_ISDIGIT(*rex.input) + || !vim_iswordp_buf(rex.input, rex.reg_buf)) status = RA_NOMATCH; else ADVANCE_REGINPUT(); @@ -4544,21 +4546,21 @@ regmatch( break; case SFNAME: - if (VIM_ISDIGIT(*reginput) || !vim_isfilec(c)) + if (VIM_ISDIGIT(*rex.input) || !vim_isfilec(c)) status = RA_NOMATCH; else ADVANCE_REGINPUT(); break; case PRINT: - if (!vim_isprintc(PTR2CHAR(reginput))) + if (!vim_isprintc(PTR2CHAR(rex.input))) status = RA_NOMATCH; else ADVANCE_REGINPUT(); break; case SPRINT: - if (VIM_ISDIGIT(*reginput) || !vim_isprintc(PTR2CHAR(reginput))) + if (VIM_ISDIGIT(*rex.input) || !vim_isprintc(PTR2CHAR(rex.input))) status = RA_NOMATCH; else ADVANCE_REGINPUT(); @@ -4697,12 +4699,12 @@ regmatch( opnd = OPERAND(scan); /* Inline the first byte, for speed. */ - if (*opnd != *reginput + if (*opnd != *rex.input && (!rex.reg_ic || ( #ifdef FEAT_MBYTE !enc_utf8 && #endif - MB_TOLOWER(*opnd) != MB_TOLOWER(*reginput)))) + MB_TOLOWER(*opnd) != MB_TOLOWER(*rex.input)))) status = RA_NOMATCH; else if (*opnd == NUL) { @@ -4723,7 +4725,7 @@ regmatch( { /* Need to match first byte again for multi-byte. */ len = (int)STRLEN(opnd); - if (cstrncmp(opnd, reginput, &len) != 0) + if (cstrncmp(opnd, rex.input, &len) != 0) status = RA_NOMATCH; } #ifdef FEAT_MBYTE @@ -4731,7 +4733,7 @@ regmatch( * follows (skips over all composing chars). */ if (status != RA_NOMATCH && enc_utf8 - && UTF_COMPOSINGLIKE(reginput, reginput + len) + && UTF_COMPOSINGLIKE(rex.input, rex.input + len) && !rex.reg_icombine && OP(next) != RE_COMPOSING) { @@ -4742,7 +4744,7 @@ regmatch( } #endif if (status != RA_NOMATCH) - reginput += len; + rex.input += len; } } break; @@ -4780,10 +4782,10 @@ regmatch( /* When only a composing char is given match at any * position where that composing char appears. */ status = RA_NOMATCH; - for (i = 0; reginput[i] != NUL; - i += utf_ptr2len(reginput + i)) + for (i = 0; rex.input[i] != NUL; + i += utf_ptr2len(rex.input + i)) { - inpc = utf_ptr2char(reginput + i); + inpc = utf_ptr2char(rex.input + i); if (!utf_iscomposing(inpc)) { if (i > 0) @@ -4792,7 +4794,7 @@ regmatch( else if (opndc == inpc) { /* Include all following composing chars. */ - len = i + utfc_ptr2len(reginput + i); + len = i + utfc_ptr2len(rex.input + i); status = RA_MATCH; break; } @@ -4800,12 +4802,12 @@ regmatch( } else for (i = 0; i < len; ++i) - if (opnd[i] != reginput[i]) + if (opnd[i] != rex.input[i]) { status = RA_NOMATCH; break; } - reginput += len; + rex.input += len; } else status = RA_NOMATCH; @@ -4816,8 +4818,8 @@ regmatch( if (enc_utf8) { /* Skip composing characters. */ - while (utf_iscomposing(utf_ptr2char(reginput))) - MB_CPTR_ADV(reginput); + while (utf_iscomposing(utf_ptr2char(rex.input))) + MB_CPTR_ADV(rex.input); } #endif break; @@ -5003,7 +5005,7 @@ regmatch( /* Compare current input with back-ref in the same * line. */ len = (int)(rex.reg_endp[no] - rex.reg_startp[no]); - if (cstrncmp(rex.reg_startp[no], reginput, &len) != 0) + if (cstrncmp(rex.reg_startp[no], rex.input, &len) != 0) status = RA_NOMATCH; } } @@ -5017,14 +5019,14 @@ regmatch( } else { - if (rex.reg_startpos[no].lnum == reglnum - && rex.reg_endpos[no].lnum == reglnum) + if (rex.reg_startpos[no].lnum == rex.lnum + && rex.reg_endpos[no].lnum == rex.lnum) { /* Compare back-ref within the current line. */ len = rex.reg_endpos[no].col - rex.reg_startpos[no].col; - if (cstrncmp(regline + rex.reg_startpos[no].col, - reginput, &len) != 0) + if (cstrncmp(rex.line + rex.reg_startpos[no].col, + rex.input, &len) != 0) status = RA_NOMATCH; } else @@ -5045,7 +5047,7 @@ regmatch( } /* Matched the backref, skip over it. */ - reginput += len; + rex.input += len; } break; @@ -5069,10 +5071,10 @@ regmatch( { len = (int)STRLEN(re_extmatch_in->matches[no]); if (cstrncmp(re_extmatch_in->matches[no], - reginput, &len) != 0) + rex.input, &len) != 0) status = RA_NOMATCH; else - reginput += len; + rex.input += len; } else { @@ -5319,16 +5321,16 @@ regmatch( case BHPOS: if (REG_MULTI) { - if (behind_pos.rs_u.pos.col != (colnr_T)(reginput - regline) - || behind_pos.rs_u.pos.lnum != reglnum) + if (behind_pos.rs_u.pos.col != (colnr_T)(rex.input - rex.line) + || behind_pos.rs_u.pos.lnum != rex.lnum) status = RA_NOMATCH; } - else if (behind_pos.rs_u.ptr != reginput) + else if (behind_pos.rs_u.ptr != rex.input) status = RA_NOMATCH; break; case NEWL: - if ((c != NUL || !REG_MULTI || reglnum > rex.reg_maxline + if ((c != NUL || !REG_MULTI || rex.lnum > rex.reg_maxline || rex.reg_line_lbr) && (c != '\n' || !rex.reg_line_lbr)) status = RA_NOMATCH; @@ -5562,7 +5564,7 @@ regmatch( if (limit > 0 && ((rp->rs_un.regsave.rs_u.pos.lnum < behind_pos.rs_u.pos.lnum - ? (colnr_T)STRLEN(regline) + ? (colnr_T)STRLEN(rex.line) : behind_pos.rs_u.pos.col) - rp->rs_un.regsave.rs_u.pos.col >= limit)) no = FAIL; @@ -5578,7 +5580,7 @@ regmatch( { reg_restore(&rp->rs_un.regsave, &backpos); rp->rs_un.regsave.rs_u.pos.col = - (colnr_T)STRLEN(regline); + (colnr_T)STRLEN(rex.line); } } else @@ -5600,11 +5602,11 @@ regmatch( } else { - if (rp->rs_un.regsave.rs_u.ptr == regline) + if (rp->rs_un.regsave.rs_u.ptr == rex.line) no = FAIL; else { - MB_PTR_BACK(regline, rp->rs_un.regsave.rs_u.ptr); + MB_PTR_BACK(rex.line, rp->rs_un.regsave.rs_u.ptr); if (limit > 0 && (long)(behind_pos.rs_u.ptr - rp->rs_un.regsave.rs_u.ptr) > limit) no = FAIL; @@ -5678,20 +5680,20 @@ regmatch( * didn't match -- back up one char. */ if (--rst->count < rst->minval) break; - if (reginput == regline) + if (rex.input == rex.line) { /* backup to last char of previous line */ - --reglnum; - regline = reg_getline(reglnum); + --rex.lnum; + rex.line = reg_getline(rex.lnum); /* Just in case regrepeat() didn't count * right. */ - if (regline == NULL) + if (rex.line == NULL) break; - reginput = regline + STRLEN(regline); + rex.input = rex.line + STRLEN(rex.line); fast_breakcheck(); } else - MB_PTR_BACK(regline, reginput); + MB_PTR_BACK(rex.line, rex.input); } else { @@ -5711,8 +5713,8 @@ regmatch( status = RA_NOMATCH; /* If it could match, try it. */ - if (rst->nextb == NUL || *reginput == rst->nextb - || *reginput == rst->nextb_ic) + if (rst->nextb == NUL || *rex.input == rst->nextb + || *rex.input == rst->nextb_ic) { reg_save(&rp->rs_un.regsave, &backpos); scan = regnext(rp->rs_scan); @@ -5807,7 +5809,7 @@ regstack_pop(char_u **scan) /* * regrepeat - repeatedly match something simple, return how many. - * Advances reginput (and reglnum) to just after the matched chars. + * Advances rex.input (and rex.lnum) to just after the matched chars. */ static int regrepeat( @@ -5820,7 +5822,7 @@ regrepeat( int mask; int testval = 0; - scan = reginput; /* Make local copy of reginput for speed. */ + scan = rex.input; /* Make local copy of rex.input for speed. */ opnd = OPERAND(p); switch (OP(p)) { @@ -5835,12 +5837,12 @@ regrepeat( ++count; MB_PTR_ADV(scan); } - if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > rex.reg_maxline + if (!REG_MULTI || !WITH_NL(OP(p)) || rex.lnum > rex.reg_maxline || rex.reg_line_lbr || count == maxcount) break; ++count; /* count the line-break */ reg_nextline(); - scan = reginput; + scan = rex.input; if (got_int) break; } @@ -5860,11 +5862,11 @@ regrepeat( } else if (*scan == NUL) { - if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > rex.reg_maxline + if (!REG_MULTI || !WITH_NL(OP(p)) || rex.lnum > rex.reg_maxline || rex.reg_line_lbr) break; reg_nextline(); - scan = reginput; + scan = rex.input; if (got_int) break; } @@ -5891,11 +5893,11 @@ regrepeat( } else if (*scan == NUL) { - if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > rex.reg_maxline + if (!REG_MULTI || !WITH_NL(OP(p)) || rex.lnum > rex.reg_maxline || rex.reg_line_lbr) break; reg_nextline(); - scan = reginput; + scan = rex.input; if (got_int) break; } @@ -5921,11 +5923,11 @@ regrepeat( } else if (*scan == NUL) { - if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > rex.reg_maxline + if (!REG_MULTI || !WITH_NL(OP(p)) || rex.lnum > rex.reg_maxline || rex.reg_line_lbr) break; reg_nextline(); - scan = reginput; + scan = rex.input; if (got_int) break; } @@ -5947,11 +5949,11 @@ regrepeat( { if (*scan == NUL) { - if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > rex.reg_maxline + if (!REG_MULTI || !WITH_NL(OP(p)) || rex.lnum > rex.reg_maxline || rex.reg_line_lbr) break; reg_nextline(); - scan = reginput; + scan = rex.input; if (got_int) break; } @@ -5979,11 +5981,11 @@ do_class: #endif if (*scan == NUL) { - if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > rex.reg_maxline + if (!REG_MULTI || !WITH_NL(OP(p)) || rex.lnum > rex.reg_maxline || rex.reg_line_lbr) break; reg_nextline(); - scan = reginput; + scan = rex.input; if (got_int) break; } @@ -6144,11 +6146,11 @@ do_class: #endif if (*scan == NUL) { - if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum > rex.reg_maxline + if (!REG_MULTI || !WITH_NL(OP(p)) || rex.lnum > rex.reg_maxline || rex.reg_line_lbr) break; reg_nextline(); - scan = reginput; + scan = rex.input; if (got_int) break; } @@ -6174,7 +6176,7 @@ do_class: case NEWL: while (count < maxcount - && ((*scan == NUL && reglnum <= rex.reg_maxline + && ((*scan == NUL && rex.lnum <= rex.reg_maxline && !rex.reg_line_lbr && REG_MULTI) || (*scan == '\n' && rex.reg_line_lbr))) { @@ -6183,7 +6185,7 @@ do_class: ADVANCE_REGINPUT(); else reg_nextline(); - scan = reginput; + scan = rex.input; if (got_int) break; } @@ -6197,7 +6199,7 @@ do_class: break; } - reginput = scan; + rex.input = scan; return (int)count; } @@ -6255,7 +6257,7 @@ prog_magic_wrong(void) static void cleanup_subexpr(void) { - if (need_clear_subexpr) + if (rex.need_clear_subexpr) { if (REG_MULTI) { @@ -6268,7 +6270,7 @@ cleanup_subexpr(void) vim_memset(rex.reg_startp, 0, sizeof(char_u *) * NSUBEXP); vim_memset(rex.reg_endp, 0, sizeof(char_u *) * NSUBEXP); } - need_clear_subexpr = FALSE; + rex.need_clear_subexpr = FALSE; } } @@ -6276,7 +6278,7 @@ cleanup_subexpr(void) static void cleanup_zsubexpr(void) { - if (need_clear_zsubexpr) + if (rex.need_clear_zsubexpr) { if (REG_MULTI) { @@ -6289,7 +6291,7 @@ cleanup_zsubexpr(void) vim_memset(reg_startzp, 0, sizeof(char_u *) * NSUBEXP); vim_memset(reg_endzp, 0, sizeof(char_u *) * NSUBEXP); } - need_clear_zsubexpr = FALSE; + rex.need_clear_zsubexpr = FALSE; } } #endif @@ -6303,10 +6305,10 @@ save_subexpr(regbehind_T *bp) { int i; - /* When "need_clear_subexpr" is set we don't need to save the values, only + /* When "rex.need_clear_subexpr" is set we don't need to save the values, only * remember that this flag needs to be set again when restoring. */ - bp->save_need_clear_subexpr = need_clear_subexpr; - if (!need_clear_subexpr) + bp->save_need_clear_subexpr = rex.need_clear_subexpr; + if (!rex.need_clear_subexpr) { for (i = 0; i < NSUBEXP; ++i) { @@ -6333,8 +6335,8 @@ restore_subexpr(regbehind_T *bp) int i; /* Only need to restore saved values when they are not to be cleared. */ - need_clear_subexpr = bp->save_need_clear_subexpr; - if (!need_clear_subexpr) + rex.need_clear_subexpr = bp->save_need_clear_subexpr; + if (!rex.need_clear_subexpr) { for (i = 0; i < NSUBEXP; ++i) { @@ -6353,13 +6355,13 @@ restore_subexpr(regbehind_T *bp) } /* - * Advance reglnum, regline and reginput to the next line. + * Advance rex.lnum, rex.line and rex.input to the next line. */ static void reg_nextline(void) { - regline = reg_getline(++reglnum); - reginput = regline; + rex.line = reg_getline(++rex.lnum); + rex.input = rex.line; fast_breakcheck(); } @@ -6371,11 +6373,11 @@ reg_save(regsave_T *save, garray_T *gap) { if (REG_MULTI) { - save->rs_u.pos.col = (colnr_T)(reginput - regline); - save->rs_u.pos.lnum = reglnum; + save->rs_u.pos.col = (colnr_T)(rex.input - rex.line); + save->rs_u.pos.lnum = rex.lnum; } else - save->rs_u.ptr = reginput; + save->rs_u.ptr = rex.input; save->rs_len = gap->ga_len; } @@ -6387,17 +6389,17 @@ reg_restore(regsave_T *save, garray_T *gap) { if (REG_MULTI) { - if (reglnum != save->rs_u.pos.lnum) + if (rex.lnum != save->rs_u.pos.lnum) { /* only call reg_getline() when the line number changed to save * a bit of time */ - reglnum = save->rs_u.pos.lnum; - regline = reg_getline(reglnum); + rex.lnum = save->rs_u.pos.lnum; + rex.line = reg_getline(rex.lnum); } - reginput = regline + save->rs_u.pos.col; + rex.input = rex.line + save->rs_u.pos.col; } else - reginput = save->rs_u.ptr; + rex.input = save->rs_u.ptr; gap->ga_len = save->rs_len; } @@ -6408,9 +6410,9 @@ reg_restore(regsave_T *save, garray_T *gap) reg_save_equal(regsave_T *save) { if (REG_MULTI) - return reglnum == save->rs_u.pos.lnum - && reginput == regline + save->rs_u.pos.col; - return reginput == save->rs_u.ptr; + return rex.lnum == save->rs_u.pos.lnum + && rex.input == rex.line + save->rs_u.pos.col; + return rex.input == save->rs_u.ptr; } /* @@ -6424,15 +6426,15 @@ reg_save_equal(regsave_T *save) save_se_multi(save_se_T *savep, lpos_T *posp) { savep->se_u.pos = *posp; - posp->lnum = reglnum; - posp->col = (colnr_T)(reginput - regline); + posp->lnum = rex.lnum; + posp->col = (colnr_T)(rex.input - rex.line); } static void save_se_one(save_se_T *savep, char_u **pp) { savep->se_u.ptr = *pp; - *pp = reginput; + *pp = rex.input; } /* @@ -6475,9 +6477,9 @@ match_with_backref( { /* Since getting one line may invalidate the other, need to make copy. * Slow! */ - if (regline != reg_tofree) + if (rex.line != reg_tofree) { - len = (int)STRLEN(regline); + len = (int)STRLEN(rex.line); if (reg_tofree == NULL || len >= (int)reg_tofreelen) { len += 50; /* get some extra */ @@ -6487,9 +6489,9 @@ match_with_backref( return RA_FAIL; /* out of memory!*/ reg_tofreelen = len; } - STRCPY(reg_tofree, regline); - reginput = reg_tofree + (reginput - regline); - regline = reg_tofree; + STRCPY(reg_tofree, rex.line); + rex.input = reg_tofree + (rex.input - rex.line); + rex.line = reg_tofree; } /* Get the line to compare with. */ @@ -6499,13 +6501,13 @@ match_with_backref( else len = (int)STRLEN(p + ccol); - if (cstrncmp(p + ccol, reginput, &len) != 0) + if (cstrncmp(p + ccol, rex.input, &len) != 0) return RA_NOMATCH; /* doesn't match */ if (bytelen != NULL) *bytelen += len; if (clnum == end_lnum) break; /* match and at end! */ - if (reglnum >= rex.reg_maxline) + if (rex.lnum >= rex.reg_maxline) return RA_NOMATCH; /* text too short */ /* Advance to next line. */ @@ -6518,7 +6520,7 @@ match_with_backref( return RA_FAIL; } - /* found a match! Note that regline may now point to a copy of the line, + /* found a match! Note that rex.line may now point to a copy of the line, * that should not matter. */ return RA_MATCH; } @@ -8144,8 +8146,10 @@ vim_regcomp(char_u *expr_arg, int re_flags) regexp_engine = AUTOMATIC_ENGINE; } } +#ifdef DEBUG bt_regengine.expr = expr; nfa_regengine.expr = expr; +#endif /* * First try the NFA engine, unless backtracking was requested. @@ -8243,10 +8247,19 @@ vim_regexec_string( regexec_T rex_save; int rex_in_use_save = rex_in_use; + // Cannot use the same prog recursively, it contains state. + if (rmp->regprog->re_in_use) + { + EMSG(_(e_recursive)); + return FALSE; + } + rmp->regprog->re_in_use = TRUE; + if (rex_in_use) - /* Being called recursively, save the state. */ + // Being called recursively, save the state. rex_save = rex; rex_in_use = TRUE; + rex.reg_startp = NULL; rex.reg_endp = NULL; rex.reg_startpos = NULL; @@ -8281,6 +8294,7 @@ vim_regexec_string( rex_in_use = rex_in_use_save; if (rex_in_use) rex = rex_save; + rmp->regprog->re_in_use = FALSE; return result > 0; } @@ -8353,6 +8367,14 @@ vim_regexec_multi( regexec_T rex_save; int rex_in_use_save = rex_in_use; + // Cannot use the same prog recursively, it contains state. + if (rmp->regprog->re_in_use) + { + EMSG(_(e_recursive)); + return FALSE; + } + rmp->regprog->re_in_use = TRUE; + if (rex_in_use) /* Being called recursively, save the state. */ rex_save = rex; @@ -8397,6 +8419,7 @@ vim_regexec_multi( rex_in_use = rex_in_use_save; if (rex_in_use) rex = rex_save; + rmp->regprog->re_in_use = FALSE; return result <= 0 ? 0 : result; } diff --git a/src/regexp.h b/src/regexp.h index a3526e6975..fa3ff42dce 100644 --- a/src/regexp.h +++ b/src/regexp.h @@ -50,8 +50,9 @@ typedef struct regprog { regengine_T *engine; unsigned regflags; - unsigned re_engine; /* automatic, backtracking or nfa engine */ - unsigned re_flags; /* second argument for vim_regcomp() */ + unsigned re_engine; // automatic, backtracking or nfa engine + unsigned re_flags; // second argument for vim_regcomp() + int re_in_use; // prog is being executed } regprog_T; /* @@ -65,7 +66,8 @@ typedef struct regengine_T *engine; unsigned regflags; unsigned re_engine; - unsigned re_flags; /* second argument for vim_regcomp() */ + unsigned re_flags; + int re_in_use; int regstart; char_u reganch; @@ -101,7 +103,8 @@ typedef struct regengine_T *engine; unsigned regflags; unsigned re_engine; - unsigned re_flags; /* second argument for vim_regcomp() */ + unsigned re_flags; + int re_in_use; nfa_state_T *start; /* points into state[] */ diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index d72430fadd..ff6215e73b 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -244,41 +244,17 @@ static char_u e_nul_found[] = N_("E865: (NFA) Regexp end encountered prematurely static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c"); static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %ld"); -/* re_flags passed to nfa_regcomp() */ -static int nfa_re_flags; - -/* NFA regexp \ze operator encountered. */ -static int nfa_has_zend; - -/* NFA regexp \1 .. \9 encountered. */ -static int nfa_has_backref; - -#ifdef FEAT_SYN_HL -/* NFA regexp has \z( ), set zsubexpr. */ -static int nfa_has_zsubexpr; -#endif - -/* Number of sub expressions actually being used during execution. 1 if only - * the whole match (subexpr 0) is used. */ -static int nfa_nsubexpr; - -static int *post_start; /* holds the postfix form of r.e. */ +// Variables only used in nfa_regcomp() and descendants. +static int nfa_re_flags; // re_flags passed to nfa_regcomp() +static int *post_start; // holds the postfix form of r.e. static int *post_end; static int *post_ptr; - -static int nstate; /* Number of states in the NFA. Also used when - * executing. */ -static int istate; /* Index in the state vector, used in alloc_state() */ +static int nstate; // Number of states in the NFA. +static int istate; // Index in the state vector, used in alloc_state() /* If not NULL match must end at this position */ static save_se_T *nfa_endp = NULL; -/* listid is global, so that it increases on recursive calls to - * nfa_regmatch(), which means we don't have to clear the lastlist field of - * all the states. */ -static int nfa_listid; -static int nfa_alt_listid; - /* 0 for first call to nfa_regmatch(), 1 for recursive call. */ static int nfa_ll_index = 0; @@ -326,8 +302,8 @@ nfa_regcomp_start( return FAIL; post_ptr = post_start; post_end = post_start + nstate_max; - nfa_has_zend = FALSE; - nfa_has_backref = FALSE; + rex.nfa_has_zend = FALSE; + rex.nfa_has_backref = FALSE; /* shared with BT engine */ regcomp_start(expr, re_flags); @@ -1422,7 +1398,7 @@ nfa_regatom(void) if (!seen_endbrace(refnum + 1)) return FAIL; EMIT(NFA_BACKREF1 + refnum); - nfa_has_backref = TRUE; + rex.nfa_has_backref = TRUE; } break; @@ -1437,7 +1413,7 @@ nfa_regatom(void) break; case 'e': EMIT(NFA_ZEND); - nfa_has_zend = TRUE; + rex.nfa_has_zend = TRUE; if (re_mult_next("\\ze") == FAIL) return FAIL; break; @@ -1455,7 +1431,7 @@ nfa_regatom(void) if ((reg_do_extmatch & REX_USE) == 0) EMSG_RET_FAIL(_(e_z1_not_allowed)); EMIT(NFA_ZREF1 + (no_Magic(c) - '1')); - /* No need to set nfa_has_backref, the sub-matches don't + /* No need to set rex.nfa_has_backref, the sub-matches don't * change when \z1 .. \z9 matches or not. */ re_has_z = REX_USE; break; @@ -2920,11 +2896,11 @@ st_error(int *postfix UNUSED, int *end UNUSED, int *p UNUSED) if (df) { fprintf(df, "Error popping the stack!\n"); -#ifdef DEBUG +# ifdef DEBUG fprintf(df, "Current regexp is \"%s\"\n", nfa_regengine.expr); -#endif +# endif fprintf(df, "Postfix form is: "); -#ifdef DEBUG +# ifdef DEBUG for (p2 = postfix; p2 < end; p2++) { nfa_set_code(*p2); @@ -2937,7 +2913,7 @@ st_error(int *postfix UNUSED, int *end UNUSED, int *p UNUSED) nfa_set_code(*p2); fprintf(df, "%s, ", code); } -#else +# else for (p2 = postfix; p2 < end; p2++) { fprintf(df, "%d, ", *p2); @@ -2947,7 +2923,7 @@ st_error(int *postfix UNUSED, int *end UNUSED, int *p UNUSED) { fprintf(df, "%d, ", *p2); } -#endif +# endif fprintf(df, "\n--------------------------\n"); fclose(df); } @@ -3887,7 +3863,7 @@ log_subsexpr(regsubs_T *subs) { log_subexpr(&subs->norm); # ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) log_subexpr(&subs->synt); # endif } @@ -3927,7 +3903,7 @@ pim_info(nfa_pim_T *pim) else { sprintf(buf, " PIM col %d", REG_MULTI ? (int)pim->end.pos.col - : (int)(pim->end.ptr - reginput)); + : (int)(pim->end.ptr - rex.input)); } return buf; } @@ -3955,7 +3931,7 @@ copy_pim(nfa_pim_T *to, nfa_pim_T *from) to->state = from->state; copy_sub(&to->subs.norm, &from->subs.norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub(&to->subs.synt, &from->subs.synt); #endif to->end = from->end; @@ -3967,9 +3943,10 @@ clear_sub(regsub_T *sub) if (REG_MULTI) /* Use 0xff to set lnum to -1 */ vim_memset(sub->list.multi, 0xff, - sizeof(struct multipos) * nfa_nsubexpr); + sizeof(struct multipos) * rex.nfa_nsubexpr); else - vim_memset(sub->list.line, 0, sizeof(struct linepos) * nfa_nsubexpr); + vim_memset(sub->list.line, 0, + sizeof(struct linepos) * rex.nfa_nsubexpr); sub->in_use = 0; } @@ -4022,7 +3999,7 @@ copy_sub_off(regsub_T *to, regsub_T *from) static void copy_ze_off(regsub_T *to, regsub_T *from) { - if (nfa_has_zend) + if (rex.nfa_has_zend) { if (REG_MULTI) { @@ -4073,7 +4050,7 @@ sub_equal(regsub_T *sub1, regsub_T *sub2) != sub2->list.multi[i].start_col) return FALSE; - if (nfa_has_backref) + if (rex.nfa_has_backref) { if (i < sub1->in_use) s1 = sub1->list.multi[i].end_lnum; @@ -4105,7 +4082,7 @@ sub_equal(regsub_T *sub1, regsub_T *sub2) sp2 = NULL; if (sp1 != sp2) return FALSE; - if (nfa_has_backref) + if (rex.nfa_has_backref) { if (i < sub1->in_use) sp1 = sub1->list.line[i].end; @@ -4139,7 +4116,7 @@ report_state(char *action, else if (REG_MULTI) col = sub->list.multi[0].start_col; else - col = (int)(sub->list.line[0].start - regline); + col = (int)(sub->list.line[0].start - rex.line); nfa_set_code(state->c); fprintf(log_fd, "> %s state %d to list %d. char %d: %s (start col %d)%s\n", action, abs(state->id), lid, state->c, code, col, @@ -4167,7 +4144,7 @@ has_state_with_pos( if (thread->state->id == state->id && sub_equal(&thread->subs.norm, &subs->norm) #ifdef FEAT_SYN_HL - && (!nfa_has_zsubexpr + && (!rex.nfa_has_zsubexpr || sub_equal(&thread->subs.synt, &subs->synt)) #endif && pim_equal(&thread->pim, pim)) @@ -4306,7 +4283,7 @@ state_in_list( { if (state->lastlist[nfa_ll_index] == l->id) { - if (!nfa_has_backref || has_state_with_pos(l, state, subs, NULL)) + if (!rex.nfa_has_backref || has_state_with_pos(l, state, subs, NULL)) return TRUE; } return FALSE; @@ -4390,11 +4367,11 @@ addstate( /* "^" won't match past end-of-line, don't bother trying. * Except when at the end of the line, or when we are going to the * next line for a look-behind match. */ - if (reginput > regline - && *reginput != NUL + if (rex.input > rex.line + && *rex.input != NUL && (nfa_endp == NULL || !REG_MULTI - || reglnum == nfa_endp->se_u.pos.lnum)) + || rex.lnum == nfa_endp->se_u.pos.lnum)) goto skip_add; /* FALLTHROUGH */ @@ -4432,7 +4409,7 @@ addstate( * unless it is an MOPEN that is used for a backreference or * when there is a PIM. For NFA_MATCH check the position, * lower position is preferred. */ - if (!nfa_has_backref && pim == NULL && !l->has_pim + if (!rex.nfa_has_backref && pim == NULL && !l->has_pim && state->c != NFA_MATCH) { /* When called from addstate_here() do insert before @@ -4477,7 +4454,7 @@ skip_add: * copy before it becomes invalid. */ copy_sub(&temp_subs.norm, &subs->norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub(&temp_subs.synt, &subs->synt); #endif subs = &temp_subs; @@ -4501,7 +4478,7 @@ skip_add: } copy_sub(&thread->subs.norm, &subs->norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub(&thread->subs.synt, &subs->synt); #endif #ifdef ENABLE_LOG @@ -4597,14 +4574,14 @@ skip_add: } if (off == -1) { - sub->list.multi[subidx].start_lnum = reglnum + 1; + sub->list.multi[subidx].start_lnum = rex.lnum + 1; sub->list.multi[subidx].start_col = 0; } else { - sub->list.multi[subidx].start_lnum = reglnum; + sub->list.multi[subidx].start_lnum = rex.lnum; sub->list.multi[subidx].start_col = - (colnr_T)(reginput - regline + off); + (colnr_T)(rex.input - rex.line + off); } sub->list.multi[subidx].end_lnum = -1; } @@ -4625,7 +4602,7 @@ skip_add: } sub->in_use = subidx + 1; } - sub->list.line[subidx].start = reginput + off; + sub->list.line[subidx].start = rex.input + off; } subs = addstate(l, state->out, subs, pim, off_arg); @@ -4649,7 +4626,7 @@ skip_add: break; case NFA_MCLOSE: - if (nfa_has_zend && (REG_MULTI + if (rex.nfa_has_zend && (REG_MULTI ? subs->norm.list.multi[0].end_lnum >= 0 : subs->norm.list.line[0].end != NULL)) { @@ -4708,14 +4685,14 @@ skip_add: save_multipos = sub->list.multi[subidx]; if (off == -1) { - sub->list.multi[subidx].end_lnum = reglnum + 1; + sub->list.multi[subidx].end_lnum = rex.lnum + 1; sub->list.multi[subidx].end_col = 0; } else { - sub->list.multi[subidx].end_lnum = reglnum; + sub->list.multi[subidx].end_lnum = rex.lnum; sub->list.multi[subidx].end_col = - (colnr_T)(reginput - regline + off); + (colnr_T)(rex.input - rex.line + off); } /* avoid compiler warnings */ save_ptr = NULL; @@ -4723,7 +4700,7 @@ skip_add: else { save_ptr = sub->list.line[subidx].end; - sub->list.line[subidx].end = reginput + off; + sub->list.line[subidx].end = rex.input + off; /* avoid compiler warnings */ vim_memset(&save_multipos, 0, sizeof(save_multipos)); } @@ -4929,13 +4906,13 @@ retempty: if (sub->list.multi[subidx].start_lnum < 0 || sub->list.multi[subidx].end_lnum < 0) goto retempty; - if (sub->list.multi[subidx].start_lnum == reglnum - && sub->list.multi[subidx].end_lnum == reglnum) + if (sub->list.multi[subidx].start_lnum == rex.lnum + && sub->list.multi[subidx].end_lnum == rex.lnum) { len = sub->list.multi[subidx].end_col - sub->list.multi[subidx].start_col; - if (cstrncmp(regline + sub->list.multi[subidx].start_col, - reginput, &len) == 0) + if (cstrncmp(rex.line + sub->list.multi[subidx].start_col, + rex.input, &len) == 0) { *bytelen = len; return TRUE; @@ -4958,7 +4935,7 @@ retempty: || sub->list.line[subidx].end == NULL) goto retempty; len = (int)(sub->list.line[subidx].end - sub->list.line[subidx].start); - if (cstrncmp(sub->list.line[subidx].start, reginput, &len) == 0) + if (cstrncmp(sub->list.line[subidx].start, rex.input, &len) == 0) { *bytelen = len; return TRUE; @@ -4989,7 +4966,7 @@ match_zref( } len = (int)STRLEN(re_extmatch_in->matches[subidx]); - if (cstrncmp(re_extmatch_in->matches[subidx], reginput, &len) == 0) + if (cstrncmp(re_extmatch_in->matches[subidx], rex.input, &len) == 0) { *bytelen = len; return TRUE; @@ -5061,10 +5038,10 @@ recursive_regmatch( int **listids, int *listids_len) { - int save_reginput_col = (int)(reginput - regline); - int save_reglnum = reglnum; + int save_reginput_col = (int)(rex.input - rex.line); + int save_reglnum = rex.lnum; int save_nfa_match = nfa_match; - int save_nfa_listid = nfa_listid; + int save_nfa_listid = rex.nfa_listid; save_se_T *save_nfa_endp = nfa_endp; save_se_T endpos; save_se_T *endposp = NULL; @@ -5075,9 +5052,9 @@ recursive_regmatch( { /* start at the position where the postponed match was */ if (REG_MULTI) - reginput = regline + pim->end.pos.col; + rex.input = rex.line + pim->end.pos.col; else - reginput = pim->end.ptr; + rex.input = pim->end.ptr; } if (state->c == NFA_START_INVISIBLE_BEFORE @@ -5092,8 +5069,8 @@ recursive_regmatch( { if (pim == NULL) { - endpos.se_u.pos.col = (int)(reginput - regline); - endpos.se_u.pos.lnum = reglnum; + endpos.se_u.pos.col = (int)(rex.input - rex.line); + endpos.se_u.pos.lnum = rex.lnum; } else endpos.se_u.pos = pim->end.pos; @@ -5101,7 +5078,7 @@ recursive_regmatch( else { if (pim == NULL) - endpos.se_u.ptr = reginput; + endpos.se_u.ptr = rex.input; else endpos.se_u.ptr = pim->end.ptr; } @@ -5114,39 +5091,39 @@ recursive_regmatch( { if (REG_MULTI) { - regline = reg_getline(--reglnum); - if (regline == NULL) + rex.line = reg_getline(--rex.lnum); + if (rex.line == NULL) /* can't go before the first line */ - regline = reg_getline(++reglnum); + rex.line = reg_getline(++rex.lnum); } - reginput = regline; + rex.input = rex.line; } else { - if (REG_MULTI && (int)(reginput - regline) < state->val) + if (REG_MULTI && (int)(rex.input - rex.line) < state->val) { /* Not enough bytes in this line, go to end of * previous line. */ - regline = reg_getline(--reglnum); - if (regline == NULL) + rex.line = reg_getline(--rex.lnum); + if (rex.line == NULL) { /* can't go before the first line */ - regline = reg_getline(++reglnum); - reginput = regline; + rex.line = reg_getline(++rex.lnum); + rex.input = rex.line; } else - reginput = regline + STRLEN(regline); + rex.input = rex.line + STRLEN(rex.line); } - if ((int)(reginput - regline) >= state->val) + if ((int)(rex.input - rex.line) >= state->val) { - reginput -= state->val; + rex.input -= state->val; #ifdef FEAT_MBYTE if (has_mbyte) - reginput -= mb_head_off(regline, reginput); + rex.input -= mb_head_off(rex.line, rex.input); #endif } else - reginput = regline; + rex.input = rex.line; } } @@ -5161,29 +5138,29 @@ recursive_regmatch( { /* Already calling nfa_regmatch() recursively. Save the lastlist[1] * values and clear them. */ - if (*listids == NULL || *listids_len < nstate) + if (*listids == NULL || *listids_len < prog->nstate) { vim_free(*listids); - *listids = (int *)lalloc(sizeof(int) * nstate, TRUE); + *listids = (int *)lalloc(sizeof(int) * prog->nstate, TRUE); if (*listids == NULL) { EMSG(_("E878: (NFA) Could not allocate memory for branch traversal!")); return 0; } - *listids_len = nstate; + *listids_len = prog->nstate; } nfa_save_listids(prog, *listids); need_restore = TRUE; - /* any value of nfa_listid will do */ + /* any value of rex.nfa_listid will do */ } else { /* First recursive nfa_regmatch() call, switch to the second lastlist - * entry. Make sure nfa_listid is different from a previous recursive - * call, because some states may still have this ID. */ + * entry. Make sure rex.nfa_listid is different from a previous + * recursive call, because some states may still have this ID. */ ++nfa_ll_index; - if (nfa_listid <= nfa_alt_listid) - nfa_listid = nfa_alt_listid; + if (rex.nfa_listid <= rex.nfa_alt_listid) + rex.nfa_listid = rex.nfa_alt_listid; } /* Call nfa_regmatch() to check if the current concat matches at this @@ -5196,18 +5173,18 @@ recursive_regmatch( else { --nfa_ll_index; - nfa_alt_listid = nfa_listid; + rex.nfa_alt_listid = rex.nfa_listid; } /* restore position in input text */ - reglnum = save_reglnum; + rex.lnum = save_reglnum; if (REG_MULTI) - regline = reg_getline(reglnum); - reginput = regline + save_reginput_col; + rex.line = reg_getline(rex.lnum); + rex.input = rex.line + save_reginput_col; if (result != NFA_TOO_EXPENSIVE) { nfa_match = save_nfa_match; - nfa_listid = save_nfa_listid; + rex.nfa_listid = save_nfa_listid; } nfa_endp = save_nfa_endp; @@ -5407,12 +5384,12 @@ skip_to_start(int c, colnr_T *colp) && !has_mbyte #endif ) - s = vim_strbyte(regline + *colp, c); + s = vim_strbyte(rex.line + *colp, c); else - s = cstrchr(regline + *colp, c); + s = cstrchr(rex.line + *colp, c); if (s == NULL) return FAIL; - *colp = (int)(s - regline); + *colp = (int)(s - rex.line); return OK; } @@ -5436,7 +5413,7 @@ find_match_text(colnr_T startcol, int regstart, char_u *match_text) for (len1 = 0; match_text[len1] != NUL; len1 += MB_CHAR2LEN(c1)) { c1 = PTR2CHAR(match_text + len1); - c2 = PTR2CHAR(regline + col + len2); + c2 = PTR2CHAR(rex.line + col + len2); if (c1 != c2 && (!rex.reg_ic || MB_TOLOWER(c1) != MB_TOLOWER(c2))) { match = FALSE; @@ -5448,22 +5425,22 @@ find_match_text(colnr_T startcol, int regstart, char_u *match_text) #ifdef FEAT_MBYTE /* check that no composing char follows */ && !(enc_utf8 - && utf_iscomposing(PTR2CHAR(regline + col + len2))) + && utf_iscomposing(PTR2CHAR(rex.line + col + len2))) #endif ) { cleanup_subexpr(); if (REG_MULTI) { - rex.reg_startpos[0].lnum = reglnum; + rex.reg_startpos[0].lnum = rex.lnum; rex.reg_startpos[0].col = col; - rex.reg_endpos[0].lnum = reglnum; + rex.reg_endpos[0].lnum = rex.lnum; rex.reg_endpos[0].col = col + len2; } else { - rex.reg_startp[0] = regline + col; - rex.reg_endp[0] = regline + col + len2; + rex.reg_startp[0] = rex.line + col; + rex.reg_endp[0] = rex.line + col + len2; } return 1L; } @@ -5493,7 +5470,7 @@ nfa_did_time_out() /* * Main matching routine. * - * Run NFA to determine whether it matches reginput. + * Run NFA to determine whether it matches rex.input. * * When "nfa_endp" is not NULL it is a required end-of-match position. * @@ -5549,12 +5526,12 @@ nfa_regmatch( nfa_match = FALSE; /* Allocate memory for the lists of nodes. */ - size = (nstate + 1) * sizeof(nfa_thread_T); + size = (prog->nstate + 1) * sizeof(nfa_thread_T); list[0].t = (nfa_thread_T *)lalloc(size, TRUE); - list[0].len = nstate + 1; + list[0].len = prog->nstate + 1; list[1].t = (nfa_thread_T *)lalloc(size, TRUE); - list[1].len = nstate + 1; + list[1].len = prog->nstate + 1; if (list[0].t == NULL || list[1].t == NULL) goto theend; @@ -5584,7 +5561,7 @@ nfa_regmatch( #ifdef ENABLE_LOG fprintf(log_fd, "(---) STARTSTATE first\n"); #endif - thislist->id = nfa_listid + 1; + thislist->id = rex.nfa_listid + 1; /* Inline optimized code for addstate(thislist, start, m, 0) if we know * it's the first MOPEN. */ @@ -5592,11 +5569,11 @@ nfa_regmatch( { if (REG_MULTI) { - m->norm.list.multi[0].start_lnum = reglnum; - m->norm.list.multi[0].start_col = (colnr_T)(reginput - regline); + m->norm.list.multi[0].start_lnum = rex.lnum; + m->norm.list.multi[0].start_col = (colnr_T)(rex.input - rex.line); } else - m->norm.list.line[0].start = reginput; + m->norm.list.line[0].start = rex.input; m->norm.in_use = 1; addstate(thislist, start->out, m, NULL, 0); } @@ -5620,13 +5597,13 @@ nfa_regmatch( #ifdef FEAT_MBYTE if (has_mbyte) { - curc = (*mb_ptr2char)(reginput); - clen = (*mb_ptr2len)(reginput); + curc = (*mb_ptr2char)(rex.input); + clen = (*mb_ptr2len)(rex.input); } else #endif { - curc = *reginput; + curc = *rex.input; clen = 1; } if (curc == NUL) @@ -5640,9 +5617,9 @@ nfa_regmatch( nextlist = &list[flag ^= 1]; nextlist->n = 0; /* clear nextlist */ nextlist->has_pim = FALSE; - ++nfa_listid; + ++rex.nfa_listid; if (prog->re_engine == AUTOMATIC_ENGINE - && (nfa_listid >= NFA_MAX_STATES + && (rex.nfa_listid >= NFA_MAX_STATES # ifdef FEAT_EVAL || nfa_fail_for_testing # endif @@ -5653,12 +5630,12 @@ nfa_regmatch( goto theend; } - thislist->id = nfa_listid; - nextlist->id = nfa_listid + 1; + thislist->id = rex.nfa_listid; + nextlist->id = rex.nfa_listid + 1; #ifdef ENABLE_LOG fprintf(log_fd, "------------------------------------------\n"); - fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); + fprintf(log_fd, ">>> Reginput is \"%s\"\n", rex.input); fprintf(log_fd, ">>> Advanced one character... Current char is %c (code %d) \n", curc, (int)curc); fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n); { @@ -5710,7 +5687,7 @@ nfa_regmatch( else if (REG_MULTI) col = t->subs.norm.list.multi[0].start_col; else - col = (int)(t->subs.norm.list.line[0].start - regline); + col = (int)(t->subs.norm.list.line[0].start - rex.line); nfa_set_code(t->state->c); fprintf(log_fd, "(%d) char %d %s (start col %d)%s... \n", abs(t->state->id), (int)t->state->c, code, col, @@ -5738,7 +5715,7 @@ nfa_regmatch( nfa_match = TRUE; copy_sub(&submatch->norm, &t->subs.norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub(&submatch->synt, &t->subs.synt); #endif #ifdef ENABLE_LOG @@ -5746,7 +5723,7 @@ nfa_regmatch( #endif /* Found the left-most longest match, do not look at any other * states at this position. When the list of states is going - * to be empty quit without advancing, so that "reginput" is + * to be empty quit without advancing, so that "rex.input" is * correct. */ if (nextlist->n == 0) clen = 0; @@ -5772,23 +5749,23 @@ nfa_regmatch( { if (REG_MULTI) fprintf(log_fd, "Current lnum: %d, endp lnum: %d; current col: %d, endp col: %d\n", - (int)reglnum, + (int)rex.lnum, (int)nfa_endp->se_u.pos.lnum, - (int)(reginput - regline), + (int)(rex.input - rex.line), nfa_endp->se_u.pos.col); else fprintf(log_fd, "Current col: %d, endp col: %d\n", - (int)(reginput - regline), - (int)(nfa_endp->se_u.ptr - reginput)); + (int)(rex.input - rex.line), + (int)(nfa_endp->se_u.ptr - rex.input)); } #endif /* If "nfa_endp" is set it's only a match if it ends at * "nfa_endp" */ if (nfa_endp != NULL && (REG_MULTI - ? (reglnum != nfa_endp->se_u.pos.lnum - || (int)(reginput - regline) + ? (rex.lnum != nfa_endp->se_u.pos.lnum + || (int)(rex.input - rex.line) != nfa_endp->se_u.pos.col) - : reginput != nfa_endp->se_u.ptr)) + : rex.input != nfa_endp->se_u.ptr)) break; /* do not set submatches for \@! */ @@ -5796,7 +5773,7 @@ nfa_regmatch( { copy_sub(&m->norm, &t->subs.norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub(&m->synt, &t->subs.synt); #endif } @@ -5838,7 +5815,7 @@ nfa_regmatch( * of what happens on success below. */ copy_sub_off(&m->norm, &t->subs.norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub_off(&m->synt, &t->subs.synt); #endif @@ -5866,7 +5843,7 @@ nfa_regmatch( /* Copy submatch info from the recursive call */ copy_sub_off(&t->subs.norm, &m->norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub_off(&t->subs.synt, &m->synt); #endif /* If the pattern has \ze and it matched in the @@ -5899,11 +5876,11 @@ nfa_regmatch( #endif if (REG_MULTI) { - pim.end.pos.col = (int)(reginput - regline); - pim.end.pos.lnum = reglnum; + pim.end.pos.col = (int)(rex.input - rex.line); + pim.end.pos.lnum = rex.lnum; } else - pim.end.ptr = reginput; + pim.end.ptr = rex.input; /* t->state->out1 is the corresponding END_INVISIBLE * node; Add its out to the current list (zero-width @@ -5959,7 +5936,7 @@ nfa_regmatch( * happens afterwards. */ copy_sub_off(&m->norm, &t->subs.norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub_off(&m->synt, &t->subs.synt); #endif @@ -5982,7 +5959,7 @@ nfa_regmatch( /* Copy submatch info from the recursive call */ copy_sub_off(&t->subs.norm, &m->norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub_off(&t->subs.synt, &m->synt); #endif /* Now we need to skip over the matched text and then @@ -5990,9 +5967,9 @@ nfa_regmatch( if (REG_MULTI) /* TODO: multi-line match */ bytelen = m->norm.list.multi[0].end_col - - (int)(reginput - regline); + - (int)(rex.input - rex.line); else - bytelen = (int)(m->norm.list.line[0].end - reginput); + bytelen = (int)(m->norm.list.line[0].end - rex.input); #ifdef ENABLE_LOG fprintf(log_fd, "NFA_START_PATTERN length: %d\n", bytelen); @@ -6025,7 +6002,7 @@ nfa_regmatch( } case NFA_BOL: - if (reginput == regline) + if (rex.input == rex.line) { add_here = TRUE; add_state = t->state->out; @@ -6051,7 +6028,7 @@ nfa_regmatch( int this_class; /* Get class of current and previous char (if it exists). */ - this_class = mb_get_class_buf(reginput, rex.reg_buf); + this_class = mb_get_class_buf(rex.input, rex.reg_buf); if (this_class <= 1) result = FALSE; else if (reg_prev_class() == this_class) @@ -6059,8 +6036,8 @@ nfa_regmatch( } #endif else if (!vim_iswordc_buf(curc, rex.reg_buf) - || (reginput > regline - && vim_iswordc_buf(reginput[-1], rex.reg_buf))) + || (rex.input > rex.line + && vim_iswordc_buf(rex.input[-1], rex.reg_buf))) result = FALSE; if (result) { @@ -6071,7 +6048,7 @@ nfa_regmatch( case NFA_EOW: result = TRUE; - if (reginput == regline) + if (rex.input == rex.line) result = FALSE; #ifdef FEAT_MBYTE else if (has_mbyte) @@ -6079,15 +6056,15 @@ nfa_regmatch( int this_class, prev_class; /* Get class of current and previous char (if it exists). */ - this_class = mb_get_class_buf(reginput, rex.reg_buf); + this_class = mb_get_class_buf(rex.input, rex.reg_buf); prev_class = reg_prev_class(); if (this_class == prev_class || prev_class == 0 || prev_class == 1) result = FALSE; } #endif - else if (!vim_iswordc_buf(reginput[-1], rex.reg_buf) - || (reginput[0] != NUL + else if (!vim_iswordc_buf(rex.input[-1], rex.reg_buf) + || (rex.input[0] != NUL && vim_iswordc_buf(curc, rex.reg_buf))) result = FALSE; if (result) @@ -6098,7 +6075,7 @@ nfa_regmatch( break; case NFA_BOF: - if (reglnum == 0 && reginput == regline + if (rex.lnum == 0 && rex.input == rex.line && (!REG_MULTI || rex.reg_firstlnum == 1)) { add_here = TRUE; @@ -6107,7 +6084,7 @@ nfa_regmatch( break; case NFA_EOF: - if (reglnum == rex.reg_maxline && curc == NUL) + if (rex.lnum == rex.reg_maxline && curc == NUL) { add_here = TRUE; add_state = t->state->out; @@ -6159,7 +6136,7 @@ nfa_regmatch( * Get them into cchars[] first. */ while (len < clen) { - mc = mb_ptr2char(reginput + len); + mc = mb_ptr2char(rex.input + len); cchars[ccount++] = mc; len += mb_char2len(mc); if (ccount == MAX_MCO) @@ -6194,7 +6171,7 @@ nfa_regmatch( case NFA_NEWL: if (curc == NUL && !rex.reg_line_lbr && REG_MULTI - && reglnum <= rex.reg_maxline) + && rex.lnum <= rex.reg_maxline) { go_to_nextline = TRUE; /* Pass -1 for the offset, which means taking the position @@ -6323,13 +6300,13 @@ nfa_regmatch( break; case NFA_KWORD: /* \k */ - result = vim_iswordp_buf(reginput, rex.reg_buf); + result = vim_iswordp_buf(rex.input, rex.reg_buf); ADD_STATE_IF_MATCH(t->state); break; case NFA_SKWORD: /* \K */ result = !VIM_ISDIGIT(curc) - && vim_iswordp_buf(reginput, rex.reg_buf); + && vim_iswordp_buf(rex.input, rex.reg_buf); ADD_STATE_IF_MATCH(t->state); break; @@ -6344,12 +6321,12 @@ nfa_regmatch( break; case NFA_PRINT: /* \p */ - result = vim_isprintc(PTR2CHAR(reginput)); + result = vim_isprintc(PTR2CHAR(rex.input)); ADD_STATE_IF_MATCH(t->state); break; case NFA_SPRINT: /* \P */ - result = !VIM_ISDIGIT(curc) && vim_isprintc(PTR2CHAR(reginput)); + result = !VIM_ISDIGIT(curc) && vim_isprintc(PTR2CHAR(rex.input)); ADD_STATE_IF_MATCH(t->state); break; @@ -6552,7 +6529,7 @@ nfa_regmatch( case NFA_LNUM_LT: result = (REG_MULTI && nfa_re_num_cmp(t->state->val, t->state->c - NFA_LNUM, - (long_u)(reglnum + rex.reg_firstlnum))); + (long_u)(rex.lnum + rex.reg_firstlnum))); if (result) { add_here = TRUE; @@ -6564,7 +6541,7 @@ nfa_regmatch( case NFA_COL_GT: case NFA_COL_LT: result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_COL, - (long_u)(reginput - regline) + 1); + (long_u)(rex.input - rex.line) + 1); if (result) { add_here = TRUE; @@ -6577,7 +6554,7 @@ nfa_regmatch( case NFA_VCOL_LT: { int op = t->state->c - NFA_VCOL; - colnr_T col = (colnr_T)(reginput - regline); + colnr_T col = (colnr_T)(rex.input - rex.line); win_T *wp = rex.reg_win == NULL ? curwin : rex.reg_win; /* Bail out quickly when there can't be a match, avoid the @@ -6601,7 +6578,7 @@ nfa_regmatch( } if (!result) result = nfa_re_num_cmp(t->state->val, op, - (long_u)win_linetabsize(wp, regline, col) + 1); + (long_u)win_linetabsize(wp, rex.line, col) + 1); if (result) { add_here = TRUE; @@ -6619,13 +6596,13 @@ nfa_regmatch( /* Compare the mark position to the match position. */ result = (pos != NULL /* mark doesn't exist */ && pos->lnum > 0 /* mark isn't set in reg_buf */ - && (pos->lnum == reglnum + rex.reg_firstlnum - ? (pos->col == (colnr_T)(reginput - regline) + && (pos->lnum == rex.lnum + rex.reg_firstlnum + ? (pos->col == (colnr_T)(rex.input - rex.line) ? t->state->c == NFA_MARK - : (pos->col < (colnr_T)(reginput - regline) + : (pos->col < (colnr_T)(rex.input - rex.line) ? t->state->c == NFA_MARK_GT : t->state->c == NFA_MARK_LT)) - : (pos->lnum < reglnum + rex.reg_firstlnum + : (pos->lnum < rex.lnum + rex.reg_firstlnum ? t->state->c == NFA_MARK_GT : t->state->c == NFA_MARK_LT))); if (result) @@ -6638,9 +6615,9 @@ nfa_regmatch( case NFA_CURSOR: result = (rex.reg_win != NULL - && (reglnum + rex.reg_firstlnum + && (rex.lnum + rex.reg_firstlnum == rex.reg_win->w_cursor.lnum) - && ((colnr_T)(reginput - regline) + && ((colnr_T)(rex.input - rex.line) == rex.reg_win->w_cursor.col)); if (result) { @@ -6701,7 +6678,7 @@ nfa_regmatch( /* If rex.reg_icombine is not set only skip over the character * itself. When it is set skip over composing characters. */ if (result && enc_utf8 && !rex.reg_icombine) - clen = utf_ptr2len(reginput); + clen = utf_ptr2len(rex.input); #endif ADD_STATE_IF_MATCH(t->state); break; @@ -6746,7 +6723,7 @@ nfa_regmatch( /* Copy submatch info from the recursive call */ copy_sub_off(&pim->subs.norm, &m->norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub_off(&pim->subs.synt, &m->synt); #endif } @@ -6773,7 +6750,7 @@ nfa_regmatch( /* Copy submatch info from the recursive call */ copy_sub_off(&t->subs.norm, &pim->subs.norm); #ifdef FEAT_SYN_HL - if (nfa_has_zsubexpr) + if (rex.nfa_has_zsubexpr) copy_sub_off(&t->subs.synt, &pim->subs.synt); #endif } @@ -6817,17 +6794,17 @@ nfa_regmatch( * Also don't start a match past the first line. */ if (nfa_match == FALSE && ((toplevel - && reglnum == 0 + && rex.lnum == 0 && clen != 0 && (rex.reg_maxcol == 0 - || (colnr_T)(reginput - regline) < rex.reg_maxcol)) + || (colnr_T)(rex.input - rex.line) < rex.reg_maxcol)) || (nfa_endp != NULL && (REG_MULTI - ? (reglnum < nfa_endp->se_u.pos.lnum - || (reglnum == nfa_endp->se_u.pos.lnum - && (int)(reginput - regline) + ? (rex.lnum < nfa_endp->se_u.pos.lnum + || (rex.lnum == nfa_endp->se_u.pos.lnum + && (int)(rex.input - rex.line) < nfa_endp->se_u.pos.col)) - : reginput < nfa_endp->se_u.ptr)))) + : rex.input < nfa_endp->se_u.ptr)))) { #ifdef ENABLE_LOG fprintf(log_fd, "(---) STARTSTATE\n"); @@ -6843,7 +6820,7 @@ nfa_regmatch( { if (nextlist->n == 0) { - colnr_T col = (colnr_T)(reginput - regline) + clen; + colnr_T col = (colnr_T)(rex.input - rex.line) + clen; /* Nextlist is empty, we can skip ahead to the * character that must appear at the start. */ @@ -6851,15 +6828,15 @@ nfa_regmatch( break; #ifdef ENABLE_LOG fprintf(log_fd, " Skipping ahead %d bytes to regstart\n", - col - ((colnr_T)(reginput - regline) + clen)); + col - ((colnr_T)(rex.input - rex.line) + clen)); #endif - reginput = regline + col - clen; + rex.input = rex.line + col - clen; } else { /* Checking if the required start character matches is * cheaper than adding a state that won't match. */ - c = PTR2CHAR(reginput + clen); + c = PTR2CHAR(rex.input + clen); if (c != prog->regstart && (!rex.reg_ic || MB_TOLOWER(c) != MB_TOLOWER(prog->regstart))) { @@ -6875,9 +6852,9 @@ nfa_regmatch( { if (REG_MULTI) m->norm.list.multi[0].start_col = - (colnr_T)(reginput - regline) + clen; + (colnr_T)(rex.input - rex.line) + clen; else - m->norm.list.line[0].start = reginput + clen; + m->norm.list.line[0].start = rex.input + clen; addstate(nextlist, start->out, m, NULL, clen); } } @@ -6900,9 +6877,9 @@ nextchar: /* Advance to the next character, or advance to the next line, or * finish. */ if (clen != 0) - reginput += clen; + rex.input += clen; else if (go_to_nextline || (nfa_endp != NULL && REG_MULTI - && reglnum < nfa_endp->se_u.pos.lnum)) + && rex.lnum < nfa_endp->se_u.pos.lnum)) reg_nextline(); else break; @@ -6942,7 +6919,7 @@ theend: } /* - * Try match of "prog" with at regline["col"]. + * Try match of "prog" with at rex.line["col"]. * Returns <= 0 for failure, number of lines contained in the match otherwise. */ static long @@ -6960,7 +6937,7 @@ nfa_regtry( FILE *f; #endif - reginput = regline + col; + rex.input = rex.line + col; #ifdef FEAT_RELTIME nfa_time_limit = tm; nfa_timed_out = timed_out; @@ -6975,7 +6952,7 @@ nfa_regtry( #ifdef DEBUG fprintf(f, "\tRegexp is \"%s\"\n", nfa_regengine.expr); #endif - fprintf(f, "\tInput text is \"%s\" \n", reginput); + fprintf(f, "\tInput text is \"%s\" \n", rex.input); fprintf(f, "\t=======================================================\n\n"); nfa_print_state(f, start); fprintf(f, "\n\n"); @@ -7018,12 +6995,12 @@ nfa_regtry( if (rex.reg_endpos[0].lnum < 0) { /* pattern has a \ze but it didn't match, use current end */ - rex.reg_endpos[0].lnum = reglnum; - rex.reg_endpos[0].col = (int)(reginput - regline); + rex.reg_endpos[0].lnum = rex.lnum; + rex.reg_endpos[0].col = (int)(rex.input - rex.line); } else /* Use line number of "\ze". */ - reglnum = rex.reg_endpos[0].lnum; + rex.lnum = rex.reg_endpos[0].lnum; } else { @@ -7034,9 +7011,9 @@ nfa_regtry( } if (rex.reg_startp[0] == NULL) - rex.reg_startp[0] = regline + col; + rex.reg_startp[0] = rex.line + col; if (rex.reg_endp[0] == NULL) - rex.reg_endp[0] = reginput; + rex.reg_endp[0] = rex.input; } #ifdef FEAT_SYN_HL @@ -7077,7 +7054,7 @@ nfa_regtry( } #endif - return 1 + reglnum; + return 1 + rex.lnum; } /* @@ -7131,29 +7108,34 @@ nfa_regexec_both( rex.reg_icombine = TRUE; #endif - regline = line; - reglnum = 0; /* relative to line */ + rex.line = line; + rex.lnum = 0; /* relative to line */ - nfa_has_zend = prog->has_zend; - nfa_has_backref = prog->has_backref; - nfa_nsubexpr = prog->nsubexp; - nfa_listid = 1; - nfa_alt_listid = 2; + rex.nfa_has_zend = prog->has_zend; + rex.nfa_has_backref = prog->has_backref; + rex.nfa_nsubexpr = prog->nsubexp; + rex.nfa_listid = 1; + rex.nfa_alt_listid = 2; +#ifdef DEBUG nfa_regengine.expr = prog->pattern; +#endif if (prog->reganch && col > 0) return 0L; - need_clear_subexpr = TRUE; + rex.need_clear_subexpr = TRUE; #ifdef FEAT_SYN_HL /* Clear the external match subpointers if necessary. */ if (prog->reghasz == REX_SET) { - nfa_has_zsubexpr = TRUE; - need_clear_zsubexpr = TRUE; + rex.nfa_has_zsubexpr = TRUE; + rex.need_clear_zsubexpr = TRUE; } else - nfa_has_zsubexpr = FALSE; + { + rex.nfa_has_zsubexpr = FALSE; + rex.need_clear_zsubexpr = FALSE; + } #endif if (prog->regstart != NUL) @@ -7177,8 +7159,10 @@ nfa_regexec_both( if (rex.reg_maxcol > 0 && col >= rex.reg_maxcol) goto theend; - nstate = prog->nstate; - for (i = 0; i < nstate; ++i) + // Set the "nstate" used by nfa_regcomp() to zero to trigger an error when + // it's accidentally used during execution. + nstate = 0; + for (i = 0; i < prog->nstate; ++i) { prog->state[i].id = i; prog->state[i].lastlist[0] = 0; @@ -7187,7 +7171,9 @@ nfa_regexec_both( retval = nfa_regtry(prog, col, tm, timed_out); +#ifdef DEBUG nfa_regengine.expr = NULL; +#endif theend: return retval; @@ -7207,7 +7193,9 @@ nfa_regcomp(char_u *expr, int re_flags) if (expr == NULL) return NULL; +#ifdef DEBUG nfa_regengine.expr = expr; +#endif nfa_re_flags = re_flags; init_class_tab(); @@ -7255,6 +7243,7 @@ nfa_regcomp(char_u *expr, int re_flags) if (prog == NULL) goto fail; state_ptr = prog->state; + prog->re_in_use = FALSE; /* * PASS 2 @@ -7267,8 +7256,8 @@ nfa_regcomp(char_u *expr, int re_flags) prog->regflags = regflags; prog->engine = &nfa_regengine; prog->nstate = nstate; - prog->has_zend = nfa_has_zend; - prog->has_backref = nfa_has_backref; + prog->has_zend = rex.nfa_has_zend; + prog->has_backref = rex.nfa_has_backref; prog->nsubexp = regnpar; nfa_postprocess(prog); @@ -7286,7 +7275,9 @@ nfa_regcomp(char_u *expr, int re_flags) prog->reghasz = re_has_z; #endif prog->pattern = vim_strsave(expr); +#ifdef DEBUG nfa_regengine.expr = NULL; +#endif out: VIM_CLEAR(post_start); @@ -7299,7 +7290,9 @@ fail: #ifdef ENABLE_LOG nfa_postfix_dump(expr, FAIL); #endif +#ifdef DEBUG nfa_regengine.expr = NULL; +#endif goto out; } diff --git a/src/version.c b/src/version.c index 670c2e3053..cb2744d6d0 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 192, /**/ 191, /**/ From ca4cc018addbeb3ac5d0e05f18847015f91ff814 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jul 2018 05:55:12 +0200 Subject: [PATCH 16/31] patch 8.1.0193: terminal debugger buttons don't always work Problem: Terminal debugger buttons don't always work. (Dominique Pelle) Solution: Set 'cpo' to its default value. --- runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 6 ++++++ src/version.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 1bea8f5542..4ccbc4cb66 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -56,6 +56,9 @@ else finish endif +let s:keepcpo = &cpo +set cpo&vim + " The command that starts debugging, e.g. ":Termdebug vim". " To end type "quit" in the gdb window. command -nargs=* -complete=file -bang Termdebug call s:StartDebug(0, ) @@ -943,3 +946,6 @@ func s:BufUnloaded() endif endfor endfunc + +let &cpo = s:keepcpo +unlet s:keepcpo diff --git a/src/version.c b/src/version.c index cb2744d6d0..3c9676e517 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 193, /**/ 192, /**/ From 414998023fbff15cce20ef01a54d0366370ad8b6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 18 Jul 2018 06:02:09 +0200 Subject: [PATCH 17/31] patch 8.1.0194: possibly use of NULL pointer Problem: Possibly use of NULL pointer. (Coverity) Solution: Reset the re_in_use flag earlier. --- src/regexp.c | 12 ++++++++++-- src/version.c | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/regexp.c b/src/regexp.c index 88cf8817ab..9d7350b6ed 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -8266,6 +8266,7 @@ vim_regexec_string( rex.reg_endpos = NULL; result = rmp->regprog->engine->regexec_nl(rmp, line, col, nl); + rmp->regprog->re_in_use = FALSE; /* NFA engine aborted because it's very slow. */ if (rmp->regprog->re_engine == AUTOMATIC_ENGINE @@ -8284,7 +8285,11 @@ vim_regexec_string( #endif rmp->regprog = vim_regcomp(pat, re_flags); if (rmp->regprog != NULL) + { + rmp->regprog->re_in_use = TRUE; result = rmp->regprog->engine->regexec_nl(rmp, line, col, nl); + rmp->regprog->re_in_use = FALSE; + } vim_free(pat); } @@ -8294,7 +8299,6 @@ vim_regexec_string( rex_in_use = rex_in_use_save; if (rex_in_use) rex = rex_save; - rmp->regprog->re_in_use = FALSE; return result > 0; } @@ -8382,6 +8386,7 @@ vim_regexec_multi( result = rmp->regprog->engine->regexec_multi( rmp, win, buf, lnum, col, tm, timed_out); + rmp->regprog->re_in_use = FALSE; /* NFA engine aborted because it's very slow. */ if (rmp->regprog->re_engine == AUTOMATIC_ENGINE @@ -8409,8 +8414,12 @@ vim_regexec_multi( #endif if (rmp->regprog != NULL) + { + rmp->regprog->re_in_use = TRUE; result = rmp->regprog->engine->regexec_multi( rmp, win, buf, lnum, col, tm, timed_out); + rmp->regprog->re_in_use = FALSE; + } vim_free(pat); } p_re = save_p_re; @@ -8419,7 +8428,6 @@ vim_regexec_multi( rex_in_use = rex_in_use_save; if (rex_in_use) rex = rex_save; - rmp->regprog->re_in_use = FALSE; return result <= 0 ? 0 : result; } diff --git a/src/version.c b/src/version.c index 3c9676e517..f6542b672a 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 194, /**/ 193, /**/ From 963c1ad5d072346d9e95d4c3be066b5e03c601d3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 19 Jul 2018 02:55:01 +0200 Subject: [PATCH 18/31] patch 8.1.0195: terminal debugger commands don't always work Problem: Terminal debugger commands don't always work. (Dominique Pelle) Solution: Set 'cpo' to its default value when defining commands. (Christian Brabandt) --- runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 5 +++++ src/version.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 4ccbc4cb66..63a3b1d83d 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -566,6 +566,9 @@ endfunc " Install commands in the current window to control the debugger. func s:InstallCommands() + let save_cpo = &cpo + set cpo&vim + command Break call s:SetBreakpoint() command Clear call s:ClearBreakpoint() command Step call s:SendCommand('-exec-step') @@ -603,6 +606,8 @@ func s:InstallCommands() an 1.230 PopUp.Evaluate :Evaluate endif endif + + let &cpo = save_cpo endfunc let s:winbar_winids = [] diff --git a/src/version.c b/src/version.c index f6542b672a..997f4a0347 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 195, /**/ 194, /**/ From f63db65b2418140d1bdbc032511f530234bd2496 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 19 Jul 2018 04:13:36 +0200 Subject: [PATCH 19/31] patch 8.1.0196: terminal debugger error with .gdbinit file Problem: Terminal debugger error with .gdbinit file. Solution: Check two lines for the "new ui" response. (hint from Hirohito Higashi) --- runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 63a3b1d83d..ec55cf676a 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -200,7 +200,8 @@ func s:StartDebug_term(dict) let response = '' for lnum in range(1,200) if term_getline(s:gdbbuf, lnum) =~ 'new-ui mi ' - let response = term_getline(s:gdbbuf, lnum + 1) + " response can be in the same line or the next line + let response = term_getline(s:gdbbuf, lnum) . term_getline(s:gdbbuf, lnum + 1) if response =~ 'Undefined command' echoerr 'Sorry, your gdb is too old, gdb 7.12 is required' exe 'bwipe! ' . s:ptybuf diff --git a/src/version.c b/src/version.c index 997f4a0347..83518a98e8 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 196, /**/ 195, /**/ From 9e42c866484fe0199e8b17e7c44489386173acc9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 20 Jul 2018 05:03:16 +0200 Subject: [PATCH 20/31] patch 8.1.0197: Windows GUI: title for search/replace is wrong Problem: Windows GUI: title for search/replace is wrong. Solution: Remove remark about doubling backslash. (closes #3230) --- src/gui_w32.c | 6 ++---- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui_w32.c b/src/gui_w32.c index 147d98b391..8574b63fac 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -2820,8 +2820,7 @@ gui_mch_find_dialog(exarg_T *eap) s_findrep_hwnd = FindText((LPFINDREPLACE) &s_findrep_struct); } - set_window_title(s_findrep_hwnd, - _("Find string (use '\\\\' to find a '\\')")); + set_window_title(s_findrep_hwnd, _("Find string")); (void)SetFocus(s_findrep_hwnd); s_findrep_is_find = TRUE; @@ -2855,8 +2854,7 @@ gui_mch_replace_dialog(exarg_T *eap) (LPFINDREPLACE) &s_findrep_struct); } - set_window_title(s_findrep_hwnd, - _("Find & Replace (use '\\\\' to find a '\\')")); + set_window_title(s_findrep_hwnd, _("Find & Replace")); (void)SetFocus(s_findrep_hwnd); s_findrep_is_find = FALSE; diff --git a/src/version.c b/src/version.c index 83518a98e8..86413b0a06 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 197, /**/ 196, /**/ From 0a6efcd27d62935c465b4406c0c0db9be10a0ddb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 20 Jul 2018 19:56:10 +0200 Subject: [PATCH 21/31] patch 8.1.0198: there is no hint that syntax is disabled for 'redrawtime' Problem: There is no hint that syntax is disabled for 'redrawtime'. Solution: Add a message. --- src/syntax.c | 11 ++++++++--- src/version.c | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/syntax.c b/src/syntax.c index 7db69183ec..3c46a0e0e6 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -3355,8 +3355,11 @@ syn_regexec( } #endif #ifdef FEAT_RELTIME - if (timed_out) + if (timed_out && !syn_win->w_s->b_syn_slow) + { syn_win->w_s->b_syn_slow = TRUE; + MSG(_("'redrawtime' exceeded, syntax highlighting disabled")); + } #endif if (r > 0) @@ -3575,11 +3578,13 @@ syn_cmd_iskeyword(exarg_T *eap, int syncing UNUSED) if (*arg == NUL) { MSG_PUTS("\n"); - MSG_PUTS(_("syntax iskeyword ")); if (curwin->w_s->b_syn_isk != empty_option) + { + MSG_PUTS(_("syntax iskeyword ")); msg_outtrans(curwin->w_s->b_syn_isk); + } else - msg_outtrans((char_u *)"not set"); + msg_outtrans((char_u *)_("syntax iskeyword not set")); } else { diff --git a/src/version.c b/src/version.c index 86413b0a06..691800cfdf 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 198, /**/ 197, /**/ From 66ab916935585391b2efaa8e39075e1ef94717b1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 20 Jul 2018 20:28:48 +0200 Subject: [PATCH 22/31] patch 8.1.0199: spellbadword() does not check for caps error Problem: spellbadword() does not check for caps error. (Dominique Pelle) Solution: Adjust capcol when advancing. --- src/evalfunc.c | 1 + src/version.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/evalfunc.c b/src/evalfunc.c index 2e06c2063d..bb3257119f 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -11639,6 +11639,7 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv) break; } str += len; + capcol -= len; } } } diff --git a/src/version.c b/src/version.c index 691800cfdf..f5996d8bd1 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 199, /**/ 198, /**/ From 872e451e8c326d5dd3062ef621fcbf0a4c5bef78 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 20 Jul 2018 23:36:26 +0200 Subject: [PATCH 23/31] patch 8.1.0200: spellbadword() not tested Problem: spellbadword() not tested. Solution: Add a test. (Dominique Pelle, closes #3235) --- src/testdir/test_spell.vim | 41 ++++++++++++++++++++++++++++++++++++++ src/version.c | 2 ++ 2 files changed, 43 insertions(+) diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim index 3e8ba1defa..d9d8f6062e 100644 --- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim @@ -68,6 +68,47 @@ func Test_z_equal_on_invalid_utf8_word() bwipe! endfunc +" Test spellbadword() with argument +func Test_spellbadword() + set spell + + call assert_equal(['bycycle', 'bad'], spellbadword('My bycycle.')) + call assert_equal(['another', 'caps'], spellbadword('A sentence. another sentence')) + + set spelllang=en + call assert_equal(['', ''], spellbadword('centre')) + call assert_equal(['', ''], spellbadword('center')) + set spelllang=en_us + call assert_equal(['centre', 'local'], spellbadword('centre')) + call assert_equal(['', ''], spellbadword('center')) + set spelllang=en_gb + call assert_equal(['', ''], spellbadword('centre')) + call assert_equal(['center', 'local'], spellbadword('center')) + + " Create a small word list to test that spellbadword('...') + " can return ['...', 'rare']. + e Xwords + insert +foo +foobar/? +. + w! + mkspell! Xwords.spl Xwords + set spelllang=Xwords.spl + call assert_equal(['foobar', 'rare'], spellbadword('foo foobar')) + + " Typo should not be detected without the 'spell' option. + set spelllang=en_gb nospell + call assert_equal(['', ''], spellbadword('centre')) + call assert_equal(['', ''], spellbadword('My bycycle.')) + call assert_equal(['', ''], spellbadword('A sentence. another sentence')) + + call delete('Xwords.spl') + call delete('Xwords') + set spelllang& + set spell& +endfunc + func Test_spellreall() new set spell diff --git a/src/version.c b/src/version.c index f5996d8bd1..2d5a1310f4 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 200, /**/ 199, /**/ From a9604e61451707b38fdcb088fbfaeea2b922fef6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 21 Jul 2018 05:56:22 +0200 Subject: [PATCH 24/31] Update runtime files. --- CONTRIBUTING.md | 17 +- runtime/autoload/spellfile.vim | 11 +- runtime/doc/evim-ja.UTF-8.1 | 9 +- runtime/doc/motion.txt | 6 +- runtime/doc/options.txt | 8 +- runtime/doc/pattern.txt | 8 + runtime/doc/starting.txt | 4 +- runtime/doc/tags | 1 + runtime/doc/todo.txt | 32 +- runtime/doc/usr_05.txt | 3 +- runtime/doc/vim-ja.UTF-8.1 | 105 +++---- runtime/doc/vimdiff-ja.UTF-8.1 | 15 +- runtime/doc/vimtutor-ja.UTF-8.1 | 11 +- runtime/doc/xxd-ja.UTF-8.1 | 73 ++--- runtime/lang/README.txt | 13 +- runtime/lang/menu_ja_jp.euc-jp.vim | 9 +- runtime/lang/menu_ja_jp.utf-8.vim | 9 +- runtime/lang/menu_japanese_japan.932.vim | 9 +- runtime/mswin.vim | 5 +- runtime/plugin/README.txt | 1 + runtime/syntax/cs.vim | 280 +++++++++-------- runtime/syntax/pf.vim | 335 +++++++++++++++++---- runtime/syntax/sudoers.vim | 5 +- runtime/tutor/Makefile | 4 +- runtime/tutor/README.txt | 17 +- runtime/tutor/tutor.ja.euc | 49 +-- runtime/tutor/tutor.ja.sjis | 49 +-- runtime/tutor/tutor.ja.utf-8 | 49 +-- runtime/tutor/{tutor.lv => tutor.lv.utf-8} | 0 runtime/tutor/tutor.vim | 16 +- 30 files changed, 722 insertions(+), 431 deletions(-) rename runtime/tutor/{tutor.lv => tutor.lv.utf-8} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 70b633b4d5..d94e92a8c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,11 +57,18 @@ If the maintainer does not respond, contact the vim-dev maillist. # Translations Translating messages and runtime files is very much appreciated! These things can be translated: -* Messages in Vim, see src/po/README.txt -* Menus, see runtime/lang/README.txt -* Vim tutor, see runtime/tutor/README.txt -* Manual pages, see runtime/doc/*.1 for examples -* Desktop icon, see runtime/vim.desktop and runtime/gvim.desktop +* Messages in Vim, see [src/po/README.txt][1] +* Menus, see [runtime/lang/README.txt][2] +* Vim tutor, see [runtime/tutor/README.txt][3] +* Manual pages, see [runtime/doc/\*.1][4] for examples +* Desktop icon, see [runtime/vim.desktop][5] and [runtime/gvim.desktop][6] The help files can be translated and made available separately. See https://www.vim.org/translations.php for examples. + +[1]: https://github.com/vim/vim/blob/master/src/po/README.txt +[2]: https://github.com/vim/vim/blob/master/runtime/lang/README.txt +[3]: https://github.com/vim/vim/blob/master/runtime/tutor/README.txt +[4]: https://github.com/vim/vim/blob/master/runtime/doc/vim.1 +[5]: https://github.com/vim/vim/blob/master/runtime/vim.desktop +[6]: https://github.com/vim/vim/blob/master/runtime/gvim.desktop diff --git a/runtime/autoload/spellfile.vim b/runtime/autoload/spellfile.vim index e7fd1d8b17..886fd53939 100644 --- a/runtime/autoload/spellfile.vim +++ b/runtime/autoload/spellfile.vim @@ -22,6 +22,7 @@ function! spellfile#LoadFile(lang) endif return endif + let lang = tolower(a:lang) " If the URL changes we try all files again. if s:spellfile_URL != g:spellfile_URL @@ -30,13 +31,13 @@ function! spellfile#LoadFile(lang) endif " I will say this only once! - if has_key(s:donedict, a:lang . &enc) + if has_key(s:donedict, lang . &enc) if &verbose echomsg 'spellfile#LoadFile(): Tried this language/encoding before.' endif return endif - let s:donedict[a:lang . &enc] = 1 + let s:donedict[lang . &enc] = 1 " Find spell directories we can write in. let [dirlist, dirchoices] = spellfile#GetDirChoices() @@ -57,14 +58,14 @@ function! spellfile#LoadFile(lang) endif endif - let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc + let msg = 'Cannot find spell file for "' . lang . '" in ' . &enc let msg .= "\nDo you want me to try downloading it?" if confirm(msg, "&Yes\n&No", 2) == 1 let enc = &encoding if enc == 'iso-8859-15' let enc = 'latin1' endif - let fname = a:lang . '.' . enc . '.spl' + let fname = lang . '.' . enc . '.spl' " Split the window, read the file into a new buffer. " Remember the buffer number, we check it below. @@ -95,7 +96,7 @@ function! spellfile#LoadFile(lang) let newbufnr = winbufnr(0) endif - let fname = a:lang . '.ascii.spl' + let fname = lang . '.ascii.spl' echo 'Could not find it, trying ' . fname . '...' call spellfile#Nread(fname) if getline(2) !~ 'VIMspell' diff --git a/runtime/doc/evim-ja.UTF-8.1 b/runtime/doc/evim-ja.UTF-8.1 index 1b7a657ebc..1a03527202 100644 --- a/runtime/doc/evim-ja.UTF-8.1 +++ b/runtime/doc/evim-ja.UTF-8.1 @@ -25,11 +25,9 @@ MS-Windows のメモ帳のような動作です。 .PP 引数や Vim についての詳細は vim(1) を参照してください。 .PP -オプション 'insertmode' が設定され、テキストを直接、入力できるようになりま -す。 +オプション 'insertmode' が設定され、テキストを直接、入力できるようになります。 .br -コピーとペーストのキー操作が MS-Windows と同じになるように、マップが設定され -ます。 +コピーとペーストのキー操作が MS-Windows と同じになるように、マップが設定されます。 CTRL-X が切り取り、CTRL-C がコピー、CTRL-V がペーストです。 標準の CTRL-V の操作は CTRL-Q に割り当てられます。 .SH オプション @@ -41,8 +39,7 @@ eVim の初期化スクリプト。 .SH 別名 evim は "gumbies のための Vim" とも呼ばれています。 evim を使っているあなたはきっと、頭にハンカチをかぶっているのです。 -(訳注: gumbies は Monty Python に登場するおもしろ集団。ハンカチをかぶっ -ている。) +(訳注: gumbies は Monty Python に登場するおもしろ集団。ハンカチをかぶっている。) .SH 関連項目 vim(1) .SH 著者 diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 9a5c494304..2c0fd55304 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1164,7 +1164,7 @@ remembered. *:changes* :changes Print the change list. A ">" character indicates the current position. Just after a change it is below the - newest entry, indicating that "g;" takes you to the + newest entry, indicating that `g;` takes you to the newest entry position. The first column indicates the count needed to take you to this position. Example: @@ -1174,8 +1174,8 @@ remembered. 1 14 54 the latest changed line > - The "3g;" command takes you to line 9. Then the - output of ":changes is: + The `3g;` command takes you to line 9. Then the + output of `:changes` is: change line col text ~ > 0 9 8 bla bla bla diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 7d588dc510..469c363bc1 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2087,10 +2087,10 @@ A jump table for the options with a short description can be found at |Q_op|. See also |map_bar|. *cpo-B* B A backslash has no special meaning in mappings, - abbreviations and the "to" part of the menu commands. - Remove this flag to be able to use a backslash like a - CTRL-V. For example, the command ":map X \" - results in X being mapped to: + abbreviations, user commands and the "to" part of the + menu commands. Remove this flag to be able to use a + backslash like a CTRL-V. For example, the command + ":map X \" results in X being mapped to: 'B' included: "\^[" (^[ is a real ) 'B' excluded: "" (5 characters) ('<' excluded in both cases) diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 337cbf7269..09b4c2c1a2 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -293,6 +293,14 @@ the "#" is under your left hand middle finger (search to the left and up) and the "*" is under your right hand middle finger (search to the right and down). (this depends on your keyboard layout though). + *E956* +In very rare cases a regular expression is used recursively. This can happen +when executing a pattern takes a long time and when checkig for messages on +channels a callback is invoked that also uses a pattern or an autocommand is +triggered. In most cases this should be fine, but if a pattern is in use when +it's used again it fails. Usually this means there is something wrong with +the pattern. + ============================================================================== 2. The definition of a pattern *search-pattern* *pattern* *[pattern]* *regular-expression* *regexp* *Pattern* diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 47c032994c..7757088c86 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -511,9 +511,11 @@ a slash. Thus "-R" means recovery and "-/R" readonly. {not in Vi} *--clean* ---clean Equal to "-u DEFAULTS -U NONE -i NONE": +--clean Similar to "-u DEFAULTS -U NONE -i NONE": - initializations from files and environment variables is skipped + -'runtimepath'and 'packpath' are set to exclude home + directory entries (does not happen with -u DEFAULTS). - the |defaults.vim| script is loaded, which implies 'nocompatible': use Vim defaults - no |gvimrc| script is loaded diff --git a/runtime/doc/tags b/runtime/doc/tags index 58f3a6bd03..859db21704 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4620,6 +4620,7 @@ E952 autocmd.txt /*E952* E953 eval.txt /*E953* E954 options.txt /*E954* E955 eval.txt /*E955* +E956 pattern.txt /*E956* E96 diff.txt /*E96* E97 diff.txt /*E97* E98 diff.txt /*E98* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 38cc9a14bf..9b08aef8dc 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -38,10 +38,6 @@ browser use: https://github.com/vim/vim/issues/1234 *known-bugs* -------------------- Known bugs and current work ----------------------- -Crash when ui_breakcheck() called from regexec() calls regexec() recursively. -(Andy Massimino, #3175) -Make regexp work recursively, store all globals in "rex"? - Prompt buffer: - Add a command line history. - delay next prompt until plugin gives OK? @@ -81,6 +77,8 @@ Does not build with MinGW out of the box: - _stat64 is not defined, need to use "struct stat" in vim.h - WINVER conflict, should use 0x0600 by default? +Patches for Python: #3162, #3263 (Ozaki Kiichi) + Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May 13, #2910) Can't reproduce? @@ -96,29 +94,43 @@ Patch to fix that +packages is always in output of :version. More warnings from static analysis: https://lgtm.com/projects/g/vim/vim/alerts/?mode=list +Patch for Perl 5.28 on Windows. (#3196) + Pasting foo} causes Vim to behave weird. (John Little, 2018 Jun 17) Related to bracketed paste. I cannot reproduce it. Patch replacing imp with importlib. (#3163) +Patch to make CTRL-S in mswin.vim work better. (#3211) +But use "gi" instead of "a". + Using ":file" in quickfix window during an autocommand doesn't work. (Jason Franklin, 2018 May 23) Allow for using it when there is no argument. Patch in pull request #2967: Allow white space in sign text. (Ben Jackson) +Removing flags from 'cpoptions' breaks the Winbar buttons in termdebug. +(Dominique Pelle, 2018 Jul 16) + Whenever the file name is "~" then expand('%:p') returns $HOME. (Aidan Shafran, 2018 Jun 23, #3072) Proposed patch by Aidan, 2018 Jun 24. Patch to set w_set_curswant when setting the cursor in language interfaces. (David Hotham, 2018 Jun 22, #3060) +Problem with two buffers with the same name a/b, if it didn't exist before and +is created outside of Vim. (dskloetg, 2018 Jul 16, #3219) + Patch to make CTRL-W work properly in a quickfix window. (Jason Franklin, 2018 May 30) -Patch to make mode() return something different for Normal mode when coming -from Insert mode with CTRL-O. (#3000) +gethostbyname() is old, use getaddrinfo() if available. (#3227) -Patches for Python: #3162, #3263 (Ozaki Kiichi) +matchaddpos() gets slow with many matches. Proposal by Rick Howe, 2018 Jul +19. + +Patch to make mode() return something different for Normal mode when coming +from Insert mode with CTRL-O. (#3000) Useful for positioning the cursor. Script generated by :mksession does not work well if there are windows with modified buffers @@ -231,6 +243,10 @@ Does setting 'cursorline' cause syntax highlighting to slow down? Perhaps is mess up the cache? (Mike Lee Williams, 2018 Jan 27, #2539) Also: 'foldtext' is evaluated too often. (Daniel Hahler, #2773) +With 'foldmethod' "indent" and appending an empty line, what follows isn't +included in the existing fold. Deleting the empty line and undo fixes it. +(Oleg Koshovetc, 2018 Jul 15, #3214) + When using :packadd files under "later" are not used, which is inconsistent with packages under "start". (xtal8, #1994) @@ -256,6 +272,8 @@ confusing error message. (Wang Shidong, 2018 Jan 2, #2519) Add the debug command line history to viminfo. +Issue #686: apply 'F' in 'shortmess' to more messages. Also #3221. + Avoid that "sign unplace id" does a redraw right away, esp. when there is a sequence of these commands. (Andy Stewart, 2018 Mar 16) diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index 368551a220..e2424d63b4 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -344,8 +344,9 @@ when you use Vim. There are only two steps for adding a global plugin: GETTING A GLOBAL PLUGIN Where can you find plugins? +- Some are always loaded, you can see them in the directory $VIMRUNTIME/plugin. - Some come with Vim. You can find them in the directory $VIMRUNTIME/macros - and its sub-directories. + and its sub-directories and under $VIM/vimfiles/pack/dist/opt/. - Download from the net. There is a large collection on http://www.vim.org. - They are sometimes posted in a Vim |maillist|. - You could write one yourself, see |write-plugin|. diff --git a/runtime/doc/vim-ja.UTF-8.1 b/runtime/doc/vim-ja.UTF-8.1 index 5b7798b544..363922bcaf 100644 --- a/runtime/doc/vim-ja.UTF-8.1 +++ b/runtime/doc/vim-ja.UTF-8.1 @@ -36,8 +36,7 @@ vim \- Vi IMproved, プログラマのテキストエディタ 特に、プログラムの編集に力を発揮します。 .PP Vi に多くの改良が加えられています: -多段アンドゥ、マルチウィンドウ、マルチバッファ、構文強調表示、 -コマンドライン編集、ファイル名補完、ヘルプ、ビジュアル選択、などなど。 +多段アンドゥ、マルチウィンドウ、マルチバッファ、構文強調表示、コマンドライン編集、ファイル名補完、ヘルプ、ビジュアル選択、などなど。 .B Vim と Vi の違いについての要約は ":help vi_diff.txt" を参照してください。 .PP @@ -66,24 +65,23 @@ file .. filelist の前に "\-\-" を指定してください。 .TP \- -ファイルは標準入力から読み込まれます。コマンドは標準エラー (ttyからの入 -力になっているはず) から読み込まれます。 +ファイルは標準入力から読み込まれます。コマンドは標準エラー +(ttyからの入力になっているはず) から読み込まれます。 .TP \-t {tag} 開くファイルとカーソルの初期位置は "tag" に依存します。goto label の一種です。 -tags ファイルから {tag} が検索され、関連したファイルがカレントファイルになり -ます。そして、関連したコマンドが実行されます。 -これは主に C 言語のファイルを開くときに使われます。その場合 {tag} に関数など -を指定して使います。 -関数を含んでいるファイルが開かれ、その関数の先頭にカーソルが移動する、 -という動作になります。 +tags ファイルから {tag} が検索され、関連したファイルがカレントファイルになります。 +そして、関連したコマンドが実行されます。 +これは主に C 言語のファイルを開くときに使われます。 +その場合 {tag} に関数などを指定して使います。 +関数を含んでいるファイルが開かれ、その関数の先頭にカーソルが移動する、という動作になります。 詳しくは ":help tag\-commands" を参照してください。 .TP \-q [errorfile] クイックフィックスモードで起動します。 [errorfile] に指定したファイルが読み込まれ、最初のエラーが表示されます。 -[errorfile] を省略した場合は、オプション 'errorfile' が使われます (初期設定 -は、Amiga では "AztecC.Err"、その他のシステムでは "errors.err" です)。 +[errorfile] を省略した場合は、オプション 'errorfile' が使われます +(初期設定は、Amiga では "AztecC.Err"、その他のシステムでは "errors.err" です)。 ":cn" コマンドで次のエラーにジャンプできます。 詳しくは ":help quickfix" を参照してください。 .PP @@ -144,16 +142,15 @@ Note: "+" と "\-c" は合わせて 10 個まで指定できます。 一番目のファイルが読み込まれた後に {file} が実行されます。 これは \-c "source {file}" と同じ動作です。 {file} の先頭が '\-' の場合は使えません。 -{file} が省略された場合は、"Session.vim" が使われます (ただし \-S が最後の引 -数だった場合のみ)。 +{file} が省略された場合は、"Session.vim" が使われます +(ただし \-S が最後の引数だった場合のみ)。 .TP \-\-cmd {command} "\-c" と同じですが、vimrc を処理する前にコマンドが実行されます。 これらのコマンドは "\-c" コマンドとは別に、10 個まで指定できます。 .TP \-A -アラビア語がサポートされていて、アラビア語キーマップがある場合は、 -アラビア語モードで起動します ('arabic' がオンになります)。 +アラビア語がサポートされていて、アラビア語キーマップがある場合は、アラビア語モードで起動します ('arabic' がオンになります)。 右横書きのファイルを編集できます。 サポートされていない場合はエラーメッセージを表示して終了します。 .TP @@ -180,8 +177,8 @@ Amiga でのみ使います。 "\-d con:20/30/600/150". .TP \-D -デバッグ。スクリプトの最初のコマンドが実行されるところからデバッグモードを開 -始します。 +デバッグ。 +スクリプトの最初のコマンドが実行されるところからデバッグモードを開始します。 .TP \-e Ex モードで起動します。 @@ -203,8 +200,7 @@ Amiga では、":sh" と "!" コマンドは機能しなくなります。 フォアグラウンド。GUI バージョンで、プロセスをフォークしなくなります。 .TP \-F -ペルシア語がサポートされていて、ペルシア語キーマップがある場合は、 -ペルシア語モードで起動します ('fkmap' と 'rightleft' がオンになります)。 +ペルシア語がサポートされていて、ペルシア語キーマップがある場合は、ペルシア語モードで起動します ('fkmap' と 'rightleft' がオンになります)。 右横書きのファイルを編集できます。 サポートされていない場合はエラーメッセージを表示して終了します。 .TP @@ -216,14 +212,13 @@ GUI がサポートされている場合は、GUI で起動します。 コマンドライン引数やオプションのヘルプを表示して終了します。 .TP \-H -ヘブライ語がサポートされていて、ヘブライ語キーマップがある場合は、 -ヘブライ語モードで起動します ('hkmap' と 'rightleft' がオンになります)。 +ヘブライ語がサポートされていて、ヘブライ語キーマップがある場合は、ヘブライ語モードで起動します ('hkmap' と 'rightleft' がオンになります)。 右横書きのファイルを編集できます。 サポートされていない場合はエラーメッセージを表示して終了します。 .TP \-i {viminfo} -viminfo ファイルを使う設定になっている場合は、初期設定の "~/.viminfo" の代わ -りに、指定されたファイルを設定します。 +viminfo ファイルを使う設定になっている場合は、初期設定の "~/.viminfo" +の代わりに、指定されたファイルを設定します。 "NONE" を指定すると、.viminfo ファイルを使わないように設定できます。 .TP \-L @@ -239,8 +234,8 @@ lisp モード。 バッファを変更することはできますが、ファイルを保存することはできません。 .TP \-M -変更を不可能にします。オプションの 'modifiable' と 'write' がオフになり、 -ファイルの変更と保存ができなくなります。 +変更を不可能にします。 +オプションの 'modifiable' と 'write' がオフになり、ファイルの変更と保存ができなくなります。 Note: それらのオプションを設定すれば変更できるようになります。 .TP \-N @@ -252,8 +247,7 @@ Note: それらのオプションを設定すれば変更できるようにな \-n スワップファイルを使用しません。 クラッシュしてもリカバリできなくなります。 -フロッピーディスクのような非常に低速なメディアのファイルを読み書きするときに -便利です。 +フロッピーディスクのような非常に低速なメディアのファイルを読み書きするときに便利です。 ":set uc=0" と設定しても同じです。 戻すには ":set uc=200" と設定してください。 .TP @@ -276,10 +270,8 @@ N を省略した場合は、引数のファイルを個別のタブページで \-R 読み込み専用モード。 オプション 'readonly' がオンになります。 -バッファを変更することはできますが、間違ってファイルを上書きしてしまうのを防 -ぐことができます。 -ファイルを保存したい場合は、":w!" のように、Ex コマンドに感嘆符を付けてくだ -さい。 +バッファを変更することはできますが、間違ってファイルを上書きしてしまうのを防ぐことができます。 +ファイルを保存したい場合は、":w!" のように、Ex コマンドに感嘆符を付けてください。 \-R オプションは \-n オプションの効果も含んでいます (上記参照)。 オプション 'readonly' は ":set noro" でオフにできます。 詳しくは ":help 'readonly'" を参照してください。 @@ -301,13 +293,13 @@ N を省略した場合は、引数のファイルを個別のタブページで {scriptin} をスクリプトファイルとして読み込まれます。 ファイル中の文字列は、手で入力したときと同じように処理されます。 これは ":source! {scriptin}" と同じ動作です。 -エディタが終了する前にファイルの終わりまで読み込んだ場合、 -それ以降はキーボードから入力を読み込みます。 +エディタが終了する前にファイルの終わりまで読み込んだ場合、それ以降はキーボードから入力を読み込みます。 .TP \-T {terminal} 端末の名前を指定します。 端末が自動的に認識されない場合に使ってください。 -Vim が組み込みでサポートしている名前か、 +.B Vim +が組み込みでサポートしている名前か、 termcap または terminfo ファイルで定義されている名前を指定してください。 .TP \-u {vimrc} @@ -324,8 +316,9 @@ termcap または terminfo ファイルで定義されている名前を指定 詳しくは ":help gui\-init" を参照してください。 .TP \-V[N] -冗長モード。スクリプトファイルを実行したり viminfo ファイルを読み書きするた -びにメッセージを表示します。N に指定した数値が 'verbose' に設定されます。 +冗長モード。 +スクリプトファイルを実行したり viminfo ファイルを読み書きするたびにメッセージを表示します。 +N に指定した数値が 'verbose' に設定されます。 省略した場合は 10 になります。 .TP \-v @@ -335,8 +328,7 @@ Vi モードで起動します。 .TP \-w {scriptout} 入力した文字を {scriptout} に記録します。 -"vim \-s" や "source!" で実行するためのスクリプトファイルを作成するのに便利 -です。 +"vim \-s" や "source!" で実行するためのスクリプトファイルを作成するのに便利です。 {scriptout} ファイルがすでに存在した場合は追加保存されます。 .TP \-W {scriptout} @@ -371,46 +363,40 @@ GTK GUI のみ: Window ID を標準出力に出力します。 ヘルプを表示して終了します。"\-h" と同じです。 .TP \-\-literal -引数のファイル名をリテラル文字列として扱います。ワイルドカードを展開しませ -ん。Unix のように、シェルがワイルドカードを展開する場合は機能しません。 +引数のファイル名をリテラル文字列として扱います。ワイルドカードを展開しません。 +Unix のように、シェルがワイルドカードを展開する場合は機能しません。 .TP \-\-noplugin プラグインをロードしません。\-u NONE はこの動作を含んでいます。 .TP \-\-remote Vim サーバーと通信し、引数に指定されたファイルを Vim サーバーで開きます。 -サーバーが存在しない場合は、エラーメッセージを表示され、起動中の Vim でファ -イルが開かれます。 +サーバーが存在しない場合は、エラーメッセージを表示され、起動中の Vim でファイルが開かれます。 .TP \-\-remote\-expr {expr} -Vim サーバーと通信し、{expr} に与えられた式を Vim サーバーで実行し、結果を標 -準出力に出力します。 +Vim サーバーと通信し、{expr} に与えられた式を Vim サーバーで実行し、結果を標準出力に出力します。 .TP \-\-remote\-send {keys} Vim サーバーと通信し、{keys} に与えられたキーを Vim サーバーに送信します。 .TP \-\-remote\-silent -\-\-remote と同じですが、サーバーが存在しなくてもエラーメッセージを表示しま -せん。 +\-\-remote と同じですが、サーバーが存在しなくてもエラーメッセージを表示しません。 .TP \-\-remote\-wait \-\-remote と同じですが、ファイルが開かれるのを確認できるまで待機します。 .TP \-\-remote\-wait\-silent -\-\-remote\-wait と同じですが、サーバーが存在しなくてもエラーメッセージを表 -示しません。 +\-\-remote\-wait と同じですが、サーバーが存在しなくてもエラーメッセージを表示しません。 .TP \-\-serverlist Vim サーバーの一覧を表示します。 .TP \-\-servername {name} -サーバーの名前を {name} に設定します。\-\-remote 引数を指定しなかった場合 -は、起動中の Vim の名前として使われるので、後からその名前を使ってサーバー通 -信できます。 +サーバーの名前を {name} に設定します。 +\-\-remote 引数を指定しなかった場合は、起動中の Vim の名前として使われるので、後からその名前を使ってサーバー通信できます。 .TP \-\-socketid {id} -GTK GUI のみ: GtkPlug メカニズムを使って gvim を別のウィンドウの中で実行しま -す。 +GTK GUI のみ: GtkPlug メカニズムを使って gvim を別のウィンドウの中で実行します。 .TP \-\-version バージョン情報を表示して終了します。 @@ -459,8 +445,8 @@ GTK GUI のみ: GtkPlug メカニズムを使って gvim を別のウィンド ユーザーの gvim 初期化ファイル。 .TP /usr/local/lib/vim/optwin.vim -":options" コマンドで使われるファイル。オプションを表示したり設定したりでき -ます。 +":options" コマンドで使われるファイル。 +オプションを表示したり設定したりできます。 .TP /usr/local/lib/vim/menu.vim システムのメニュー初期化ファイル。gvim で使います。 @@ -494,8 +480,7 @@ G.R. (Fred) Walter によって開発されました。 .SH バグ 既知のバグは ":help todo" に記載されています。 .PP -Vi の動作を忠実に再現した結果、多くの人がバグだと思うような機能もいくつかあ -ります。 -"この動作は Vi と違う" からバグだと思った場合は、vi_diff.txtを確認してみてく -ださい (ファイルを開くか、Vim から ":help vi_diff.txt" と入力)。 +Vi の動作を忠実に再現した結果、多くの人がバグだと思うような機能もいくつかあります。 +"この動作は Vi と違う" からバグだと思った場合は、 vi_diff.txt を確認してみてください +(ファイルを開くか、 Vim から ":help vi_diff.txt" と入力)。 オプションの 'compatible' と 'cpoptions' も確認してください。 diff --git a/runtime/doc/vimdiff-ja.UTF-8.1 b/runtime/doc/vimdiff-ja.UTF-8.1 index 56fadfef6e..03fb900186 100644 --- a/runtime/doc/vimdiff-ja.UTF-8.1 +++ b/runtime/doc/vimdiff-ja.UTF-8.1 @@ -13,26 +13,21 @@ vimdiff \- 二つか三つか四つのファイルを Vim で開いて、その .B Vim で開きます。 ファイルは個別のウィンドウで開かれ、差分が強調表示されます。 -同じファイルの別のバージョン間で、変更を確認したり、変更を移動したりするのが -簡単になります。 +同じファイルの別のバージョン間で、変更を確認したり、変更を移動したりするのが簡単になります。 .PP Vim についての詳細は vim(1) を参照してください。 .PP .B gvimdiff という名前で起動された場合は GUI で起動します。 .PP -差分を強調表示するために、 -それぞれのウィンドウの 'diff' オプションがオンに設定されます。 +差分を強調表示するために、それぞれのウィンドウの 'diff' オプションがオンに設定されます。 .br -テキストを見やすくするために、オプションの 'wrap' と 'scrollbind' もオンに設 -定されます。 +テキストを見やすくするために、オプションの 'wrap' と 'scrollbind' もオンに設定されます。 .br - 'foldmethod' オプションは "diff" に設定され、変更されていない行は折り畳まれ -ます。 + 'foldmethod' オプションは "diff" に設定され、変更されていない行は折り畳まれます。 折り畳みの確認と開閉が簡単にできるように、'foldcolumn' は 2 に設定されます。 .SH オプション -行を並べて表示するために、"\-O" 引数を使ったときのように、ウィンドウは垂直分 -割されます。 +行を並べて表示するために、"\-O" 引数を使ったときのように、ウィンドウは垂直分割されます。 ウィンドウを水平分割したい場合は "\-o" 引数を使ってください。 .PP その他の引数については vim(1) を参照してください。 diff --git a/runtime/doc/vimtutor-ja.UTF-8.1 b/runtime/doc/vimtutor-ja.UTF-8.1 index 29b9b48f2c..2ba8f43a48 100644 --- a/runtime/doc/vimtutor-ja.UTF-8.1 +++ b/runtime/doc/vimtutor-ja.UTF-8.1 @@ -7,14 +7,13 @@ vimtutor \- Vim チュートリアル .SH 説明 .B Vim のチュートリアルを起動します。 -演習ファイルのコピーを使って実施するので、オリジナルの演習ファイルを壊してし -まう心配はありません。 +演習ファイルのコピーを使って実施するので、オリジナルの演習ファイルを壊してしまう心配はありません。 .PP .B Vim を初めて学ぶ人向けのチュートリアルです。 .PP -引数に \-g を指定すると GUI 版の vim が利用可能であれば vim ではなく gvim を -使って vimtutor が開始します。gvim が見つからないときは Vim が使用されます。 +引数に \-g を指定すると GUI 版の vim が利用可能であれば vim ではなく gvim +を使って vimtutor が開始します。gvim が見つからないときは Vim が使用されます。 .PP [language] 引数は "ja" や "es" などの二文字の言語名です。 [language] 引数を省略した場合はロケールの言語が使われます。 @@ -34,8 +33,8 @@ vimtutor \- Vim チュートリアル .SH 著者 .B Vimtutor は、Colorado State University の Charles Smith のアイデアを基に、 -Colorado School of Mines の Michael C. Pierce と Robert K. Ware の両名 -によって Vi 向けに作成されたものを基にしています。 +Colorado School of Mines の Michael C. Pierce と Robert K. Ware +の両名によって Vi 向けに作成されたものを基にしています。 E-mail: bware@mines.colorado.edu. .br .B Vim diff --git a/runtime/doc/xxd-ja.UTF-8.1 b/runtime/doc/xxd-ja.UTF-8.1 index 47688f87aa..b0640cf820 100644 --- a/runtime/doc/xxd-ja.UTF-8.1 +++ b/runtime/doc/xxd-ja.UTF-8.1 @@ -22,8 +22,7 @@ .BR uuencode (1) や .BR uudecode (1) -のように、バイナリデータを、メールに貼り付け可能な ASCII 形式に変換できた -り、標準出力に出力することもできます。 +のように、バイナリデータを、メールに貼り付け可能な ASCII 形式に変換できたり、標準出力に出力することもできます。 さらに、バイナリファイルにパッチを当てるという使い方もできます。 .SH オプション .I infile @@ -37,8 +36,8 @@ .RB \` \- ' を指定した) 場合は、標準出力に出力されます。 .PP -引数の解釈処理は適当なので注意してください。パラメータを取らない引数は -最初の一文字だけチェックされます。 +引数の解釈処理は適当なので注意してください。 +パラメータを取らない引数は最初の一文字だけチェックされます。 引数の文字とパラメータの間のスペースは省略可能です。 パラメータは 10 進数、16 進数、8 進数で指定できます。 .BR \-c8 @@ -63,12 +62,12 @@ .TP .IR \-e リトルエンディアンの 16 進ダンプに切り替える。 -このオプションは、バイトのグループをリトルエンディアンのバイト順のワードとして -扱います。標準のグルーピングは 4 バイトですが、 +このオプションは、バイトのグループをリトルエンディアンのバイト順のワードとして扱います。 +標準のグルーピングは 4 バイトですが、 .RI "" \-g を使うことで変更可能です。 -このオプションは 16 進ダンプのみに適用され、ASCII (あるいは EBCDIC) 表示は -変更されません。 +このオプションは 16 進ダンプのみに適用され、ASCII (あるいは EBCDIC) +表示は変更されません。 このモードでは \-r、\-p、\-i は機能しません。 .TP .IR "\-c cols " | " \-cols cols" @@ -87,23 +86,22 @@ .IR "\-g bytes " | " \-groupsize bytes" 出力を .RI < bytes > -バイト (2 文字の 16 進数、または 8 文字の 2 進数) ごとにスペースで区切りま -す。 +バイト (2 文字の 16 進数、または 8 文字の 2 進数) ごとにスペースで区切ります。 区切らずに出力するには .I \-g 0 を指定してください。 .RI < Bytes > の標準設定は \fI2\fP で、リトルエンディアンモードの場合は \fI4\fP 、 2 進ダンプの場合は \fI1\fP です。 -ポストスクリプト形式やインクルード形式で出力するときは、このオプションは使わ -れません。 +ポストスクリプト形式やインクルード形式で出力するときは、このオプションは使われません。 .TP .IR \-h " | " \-help コマンドの説明を出力して終了する。変換は実行されません。 .TP .IR \-i " | " \-include -C インクルードファイル形式で出力します。入力ファイルの名前が付けられた静的配 -列の定義が出力されます。標準入力の場合は定義の中身だけ出力されます。 +C インクルードファイル形式で出力します。 +入力ファイルの名前が付けられた静的配列の定義が出力されます。 +標準入力の場合は定義の中身だけ出力されます。 .TP .IR "\-l len " | " \-len len" .RI < len > @@ -135,9 +133,9 @@ infile の .RI < seek > バイト目 (絶対位置、または相対位置) から開始する。 \fI+ \fRは、現在の標準入力の位置から相対的な位置を示します -(標準入力から読み込むときのみ意味があります)。\fI\- \fRは、入力の終わりから -の文字数を示します (\fI+\fR と同時に指定した場合は、現在の標準入力の位置から -手前の位置を示します)。 +(標準入力から読み込むときのみ意味があります)。 +\fI\- \fRは、入力の終わりからの文字数を示します +(\fI+\fR と同時に指定した場合は、現在の標準入力の位置から手前の位置を示します)。 \-s 引数を指定しなかった場合は、現在のファイル位置から開始されます。 .TP .I \-u @@ -149,21 +147,20 @@ infile の .PP .I xxd \-r では行番号の評価に関しての暗黙のルールがいくつかあります。 -出力ファイルがシーク可能なら、各行の行番号が順番通りに並んでなくても構いませ -ん。位置が飛んでいても重なっていても大丈夫です。その場合、次の位置に移動する -ために lseek(2) が使われます。 -出力ファイルがシーク不可なら、「隙間」だけが処理可能です。隙間は null バイト -で埋められます。 +出力ファイルがシーク可能なら、各行の行番号が順番通りに並んでなくても構いません。 +位置が飛んでいても重なっていても大丈夫です。 +その場合、次の位置に移動するために lseek(2) が使われます。 +出力ファイルがシーク不可なら、「隙間」だけが処理可能です。 +隙間は null バイトで埋められます。 .PP .I xxd \-r は不正な入力をエラーにしません。ゴミは静かに読み飛ばされます。 .PP 16 進ダンプを編集するときは注意が必要です。 .I xxd \-r -は必要な桁 (\-c 引数参照) だけ 16 進データを読み込んで、行の残りを無視しま -す。つまり、ascii (または ebcdic) を示している列への変更は無視されます。 -xxd \-r \-p でプレーン形式 (ポストスクリプト形式) の 16 進ダンプを元に戻す場 -合は、列の数は影響しません。 +は必要な桁 (\-c 引数参照) だけ 16 進データを読み込んで、行の残りを無視します。 +つまり、ascii (または ebcdic) を示している列への変更は無視されます。 +xxd \-r \-p でプレーン形式 (ポストスクリプト形式) の 16 進ダンプを元に戻す場合は、列の数は影響しません。 2 桁の 16 進数と認識できるものはすべて変換されます。 .PP \fI% xxd \-i file\fR @@ -177,19 +174,16 @@ xxd \-r \-p でプレーン形式 (ポストスクリプト形式) の 16 進ダ .I xxd \-s +seek と .IR "xxd \-s seek" , -の違いは、lseek(2) を使って入力を "巻き戻す" かどうかです。'+' が意味を持つ -のは、入力が標準入力で、xxd が起動されたときに標準入力のファイル位置がファイ -ルの先頭ではなかった場合です。 +の違いは、lseek(2) を使って入力を "巻き戻す" かどうかです。'+' が意味を持つのは、入力が標準入力で、xxd +が起動されたときに標準入力のファイル位置がファイルの先頭ではなかった場合です。 以下の例が分かりやすいかもしれません (もっと混乱するかも!)... .PP -`cat' が既に標準入力を終わりまで読んでいるので、読む前に標準入力を巻き戻す必 -要がある。 +`cat' が既に標準入力を終わりまで読んでいるので、読む前に標準入力を巻き戻す必要がある。 .br \fI% sh \-c "cat > plain_copy; xxd \-s 0 > hex_copy" < file\fR .PP ファイル位置 0x480 (=1024+128) 前方から 16 進ダンプする。 -`+' は 「現在地からの相対位置」を意味するので、dd が 1k 処理した後から、さら -に `128' 進めます。 +`+' は 「現在地からの相対位置」を意味するので、dd が 1k 処理した後から、さらに `128' 進めます。 .br \fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet" < file\fR .PP @@ -198,8 +192,7 @@ xxd \-r \-p でプレーン形式 (ポストスクリプト形式) の 16 進ダ \fI% sh \-c "dd of=plain_snippet bs=1k count=1; xxd \-s +\-768 > hex_snippet" < file\fR .PP このような使い方はあまりしませんし、`+' を使うこともほとんどないでしょう。 -\-s を使うときはいつでも、strace(1) や truss(1) を使って、xxd の働きをチェッ -クすることをお勧めします。 +\-s を使うときはいつでも、strace(1) や truss(1) を使って、xxd の働きをチェックすることをお勧めします。 .SH 例 .PP .br @@ -233,8 +226,7 @@ xxd \-r \-p でプレーン形式 (ポストスクリプト形式) の 16 進ダ .br .br -この man ページの先頭から 120 バイトを一行に 12 オクテットずつ 16 進ダンプす -る。 +この man ページの先頭から 120 バイトを一行に 12 オクテットずつ 16 進ダンプする。 .br \fI% xxd \-l 120 \-c 12 xxd.1\fR .br @@ -301,8 +293,7 @@ xxd.1 の日付を修正する。 000fffc: 0000 0000 40 ....A .PP 一文字の 'A' からなる 1 バイトのファイルを作成する。 - '\-r \-s' の後に指定した数値がファイル中の行番号に加算され、結果、余計なバ -イトが飛ばされる。 + '\-r \-s' の後に指定した数値がファイル中の行番号に加算され、結果、余計なバイトが飛ばされる。 .br \fI% echo "010000: 41" | xxd \-r \-s \-0x10000 > file\fR .PP @@ -319,8 +310,8 @@ xxd.1 の日付を修正する。 \fI:'a,'z!xxd \-r\fR .PP .B vim(1) -の中から xxd をフィルタとして実行し、 -16 進ダンプされた行を元に戻す。戻したい行にカーソルを移動して: +の中から xxd をフィルタとして実行し、16 進ダンプされた行を元に戻す。 +戻したい行にカーソルを移動して: .br \fI!!xxd \-r\fR .PP diff --git a/runtime/lang/README.txt b/runtime/lang/README.txt index 3b10b4f3af..e5823f9636 100644 --- a/runtime/lang/README.txt +++ b/runtime/lang/README.txt @@ -1,7 +1,4 @@ -Language files for Vim - -Translated menus ----------------- +Language files for Vim: Translated menus The contents of each menu file is a sequence of lines with "menutrans" commands. Read one of the existing files to get an idea of how this works. @@ -54,11 +51,3 @@ doing the conversion. Let the UTF-8 menu file source the latin1 menu file, and put "scriptencoding latin1" in that one. Other conversions may not always be available (e.g., between iso-8859-# and MS-Windows codepages), thus the converted menu file must be available. - - -Translated messages -------------------- - -This requires doing "make install" in the "src" directory. It will compile -the portable files "src/po/*.po" into binary ".mo" files and place them in the -right directory. diff --git a/runtime/lang/menu_ja_jp.euc-jp.vim b/runtime/lang/menu_ja_jp.euc-jp.vim index 6e81f8f7da..bf42c8fccf 100644 --- a/runtime/lang/menu_ja_jp.euc-jp.vim +++ b/runtime/lang/menu_ja_jp.euc-jp.vim @@ -5,7 +5,7 @@ " Last Change: 28-Jan-2016. " " Copyright (C) 2001-2016 MURAOKA Taro , -" vim-jp (http://vim-jp.org/) +" vim-jp " " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. @@ -174,6 +174,10 @@ menutrans Set\ language\ to\ "en_nz" menutrans Set\ language\ to\ "en_us" \ "en_us"\ ꤹ menutrans &Find\ More\ Languages ¾θ򸡺(&F) +let g:menutrans_spell_change_ARG_to = '"%s"\ ѹ' +let g:menutrans_spell_add_ARG_to_word_list = '"%s"\ ñꥹȤɲ' +let g:menutrans_spell_ignore_ARG = '"%s"\ ̵' + " Tools.Fold Menu menutrans &Folding ޾(&F) " open close folds @@ -210,8 +214,7 @@ menutrans &Delete menutrans &Alternate ΢(&A) menutrans &Next ΥХåե(&N) menutrans &Previous ΥХåե(&P) -menutrans [No\ File] [̵] -let g:menutrans_no_file = "[̵]" +let g:menutrans_no_file = "[̵̾]" " Window menu menutrans &Window ɥ(&W) diff --git a/runtime/lang/menu_ja_jp.utf-8.vim b/runtime/lang/menu_ja_jp.utf-8.vim index 9dbc47cb97..e05750f5b2 100644 --- a/runtime/lang/menu_ja_jp.utf-8.vim +++ b/runtime/lang/menu_ja_jp.utf-8.vim @@ -5,7 +5,7 @@ " Last Change: 28-Jan-2016. " " Copyright (C) 2001-2016 MURAOKA Taro , -" vim-jp (http://vim-jp.org/) +" vim-jp " " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. @@ -174,6 +174,10 @@ menutrans Set\ language\ to\ "en_nz" 言語を\ "en_nz"\ に設定する menutrans Set\ language\ to\ "en_us" 言語を\ "en_us"\ に設定する menutrans &Find\ More\ Languages 他の言語を検索する(&F) +let g:menutrans_spell_change_ARG_to = '"%s"\ を変更' +let g:menutrans_spell_add_ARG_to_word_list = '"%s"\ を単語リストに追加' +let g:menutrans_spell_ignore_ARG = '"%s"\ を無視' + " Tools.Fold Menu menutrans &Folding 折畳み(&F) " open close folds @@ -210,8 +214,7 @@ menutrans &Delete 削除(&D) menutrans &Alternate 裏へ切替(&A) menutrans &Next 次のバッファ(&N) menutrans &Previous 前のバッファ(&P) -menutrans [No\ File] [無題] -let g:menutrans_no_file = "[無題]" +let g:menutrans_no_file = "[無名]" " Window menu menutrans &Window ウィンドウ(&W) diff --git a/runtime/lang/menu_japanese_japan.932.vim b/runtime/lang/menu_japanese_japan.932.vim index a39d7da3c8..003568bf39 100644 --- a/runtime/lang/menu_japanese_japan.932.vim +++ b/runtime/lang/menu_japanese_japan.932.vim @@ -5,7 +5,7 @@ " Last Change: 28-Jan-2016. " " Copyright (C) 2001-2016 MURAOKA Taro , -" vim-jp (http://vim-jp.org/) +" vim-jp " " THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. @@ -174,6 +174,10 @@ menutrans Set\ language\ to\ "en_nz" menutrans Set\ language\ to\ "en_us" \ "en_us"\ ɐݒ肷 menutrans &Find\ More\ Languages ̌(&F) +let g:menutrans_spell_change_ARG_to = '"%s"\ ύX' +let g:menutrans_spell_add_ARG_to_word_list = '"%s"\ PꃊXgɒlj' +let g:menutrans_spell_ignore_ARG = '"%s"\ 𖳎' + " Tools.Fold Menu menutrans &Folding ܏(&F) " open close folds @@ -210,8 +214,7 @@ menutrans &Delete menutrans &Alternate ֐ؑ(&A) menutrans &Next ̃obt@(&N) menutrans &Previous Õobt@(&P) -menutrans [No\ File] [] -let g:menutrans_no_file = "[]" +let g:menutrans_no_file = "[]" " Window menu menutrans &Window EBhE(&W) diff --git a/runtime/mswin.vim b/runtime/mswin.vim index da869a9fc7..5ec21491fe 100644 --- a/runtime/mswin.vim +++ b/runtime/mswin.vim @@ -57,10 +57,11 @@ vmap " Use CTRL-Q to do what CTRL-V used to do noremap -" Use CTRL-S for saving, also in Insert mode +" Use CTRL-S for saving, also in Insert mode ( doesn't work well when +" using completions). noremap :update vnoremap :update -inoremap :update +inoremap :updategi " For CTRL-V to work autoselect must be off. " On Unix we have two selections, autoselect can be used. diff --git a/runtime/plugin/README.txt b/runtime/plugin/README.txt index 68f285e1cd..11bf1e97b2 100644 --- a/runtime/plugin/README.txt +++ b/runtime/plugin/README.txt @@ -6,6 +6,7 @@ Look in the file for hints on how it can be disabled without deleting it. getscriptPlugin.vim get latest version of Vim scripts gzip.vim edit compressed files logiPat.vim logical operators on patterns +manpager.vim using Vim as manpager matchparen.vim highlight paren matching the one under the cursor netrwPlugin.vim edit files over a network and browse (remote) directories rrhelper.vim used for --remote-wait editing diff --git a/runtime/syntax/cs.vim b/runtime/syntax/cs.vim index 111bc85dfe..116afe0b72 100644 --- a/runtime/syntax/cs.vim +++ b/runtime/syntax/cs.vim @@ -1,12 +1,12 @@ " Vim syntax file -" Language: C# -" Maintainer: Nick Jensen -" Former Maintainer: Anduin Withers -" Former Maintainer: Johannes Zellner -" Last Change: 2018-05-02 -" Filenames: *.cs -" License: Vim (see :h license) -" Repository: https://github.com/nickspoons/vim-cs +" Language: C# +" Maintainer: Nick Jensen +" Former Maintainers: Anduin Withers +" Johannes Zellner +" Last Change: 2018-06-29 +" Filenames: *.cs +" License: Vim (see :h license) +" Repository: https://github.com/nickspoons/vim-cs " " REFERENCES: " [1] ECMA TC39: C# Language Specification (WD13Oct01.doc) @@ -19,146 +19,190 @@ let s:cs_cpo_save = &cpo set cpo&vim -syn keyword csType bool byte char decimal double float int long object sbyte short string T uint ulong ushort var void dynamic -syn keyword csStorage delegate enum interface namespace struct -syn keyword csRepeat break continue do for foreach goto return while -syn keyword csConditional else if switch -syn keyword csLabel case default -" there's no :: operator in C# -syn match csOperatorError display +::+ +syn keyword csType bool byte char decimal double float int long object sbyte short string T uint ulong ushort var void dynamic +syn keyword csStorage delegate enum interface namespace struct +syn keyword csRepeat break continue do for foreach goto return while +syn keyword csConditional else if switch +syn keyword csLabel case default +syn match csOperatorError display +::+ +syn match csGlobal display +global::+ " user labels (see [1] 8.6 Statements) -syn match csLabel display +^\s*\I\i*\s*:\([^:]\)\@=+ -syn keyword csModifier abstract const extern internal override private protected public readonly sealed static virtual volatile -syn keyword csConstant false null true -syn keyword csException try catch finally throw when -syn keyword csLinq ascending by descending equals from group in into join let on orderby select where -syn keyword csAsync async await +syn match csLabel display +^\s*\I\i*\s*:\([^:]\)\@=+ +syn keyword csModifier abstract const extern internal override private protected public readonly sealed static virtual volatile +syn keyword csConstant false null true +syn keyword csException try catch finally throw when +syn keyword csLinq ascending by descending equals from group in into join let on orderby select where +syn keyword csAsync async await -syn keyword csUnspecifiedStatement as base checked event fixed get in is lock nameof operator out params ref set sizeof stackalloc this typeof unchecked unsafe using -syn keyword csUnsupportedStatement add remove value -syn keyword csUnspecifiedKeyword explicit implicit +syn keyword csUnspecifiedStatement as base checked event fixed in is lock nameof operator out params ref sizeof stackalloc this typeof unchecked unsafe using +syn keyword csUnsupportedStatement add remove value +syn keyword csUnspecifiedKeyword explicit implicit " Contextual Keywords -syn match csContextualStatement /\[^:]\+:/me=s+5 +syn match csContextualStatement /\[^:]\+:/me=s+5 + +" Punctuation +syn match csBraces "[{}\[\]]" display +syn match csParens "[()]" display +syn match csOpSymbols "[+\-><=]\{1,2}" display +syn match csOpSymbols "[!><+\-*/]=" display +syn match csOpSymbols "[!*/^]" display +syn match csOpSymbols "=>" display +syn match csEndColon ";" display +syn match csLogicSymbols "&&" display +syn match csLogicSymbols "||" display +syn match csLogicSymbols "?" display +syn match csLogicSymbols ":" display " Comments " " PROVIDES: @csCommentHook -" -" TODO: include strings ? -" -syn keyword csTodo contained TODO FIXME XXX NOTE HACK -syn region csComment start="/\*" end="\*/" contains=@csCommentHook,csTodo,@Spell -syn match csComment "//.*$" contains=@csCommentHook,csTodo,@Spell +syn keyword csTodo contained TODO FIXME XXX NOTE HACK TBD +syn region csComment start="/\*" end="\*/" contains=@csCommentHook,csTodo,@Spell +syn match csComment "//.*$" contains=@csCommentHook,csTodo,@Spell " xml markup inside '///' comments -syn cluster xmlRegionHook add=csXmlCommentLeader -syn cluster xmlCdataHook add=csXmlCommentLeader -syn cluster xmlStartTagHook add=csXmlCommentLeader -syn keyword csXmlTag contained Libraries Packages Types Excluded ExcludedTypeName ExcludedLibraryName -syn keyword csXmlTag contained ExcludedBucketName TypeExcluded Type TypeKind TypeSignature AssemblyInfo -syn keyword csXmlTag contained AssemblyName AssemblyPublicKey AssemblyVersion AssemblyCulture Base -syn keyword csXmlTag contained BaseTypeName Interfaces Interface InterfaceName Attributes Attribute -syn keyword csXmlTag contained AttributeName Members Member MemberSignature MemberType MemberValue -syn keyword csXmlTag contained ReturnValue ReturnType Parameters Parameter MemberOfPackage -syn keyword csXmlTag contained ThreadingSafetyStatement Docs devdoc example overload remarks returns summary -syn keyword csXmlTag contained threadsafe value internalonly nodoc exception param permission platnote -syn keyword csXmlTag contained seealso b c i pre sub sup block code note paramref see subscript superscript -syn keyword csXmlTag contained list listheader item term description altcompliant altmember +syn cluster xmlRegionHook add=csXmlCommentLeader +syn cluster xmlCdataHook add=csXmlCommentLeader +syn cluster xmlStartTagHook add=csXmlCommentLeader +syn keyword csXmlTag contained Libraries Packages Types Excluded ExcludedTypeName ExcludedLibraryName +syn keyword csXmlTag contained ExcludedBucketName TypeExcluded Type TypeKind TypeSignature AssemblyInfo +syn keyword csXmlTag contained AssemblyName AssemblyPublicKey AssemblyVersion AssemblyCulture Base +syn keyword csXmlTag contained BaseTypeName Interfaces Interface InterfaceName Attributes Attribute +syn keyword csXmlTag contained AttributeName Members Member MemberSignature MemberType MemberValue +syn keyword csXmlTag contained ReturnValue ReturnType Parameters Parameter MemberOfPackage +syn keyword csXmlTag contained ThreadingSafetyStatement Docs devdoc example overload remarks returns summary +syn keyword csXmlTag contained threadsafe value internalonly nodoc exception param permission platnote +syn keyword csXmlTag contained seealso b c i pre sub sup block code note paramref see subscript superscript +syn keyword csXmlTag contained list listheader item term description altcompliant altmember syn cluster xmlTagHook add=csXmlTag -syn match csXmlCommentLeader +\/\/\/+ contained -syn match csXmlComment +\/\/\/.*$+ contains=csXmlCommentLeader,@csXml,@Spell -syntax include @csXml syntax/xml.vim -hi def link xmlRegion Comment +syn match csXmlCommentLeader +\/\/\/+ contained +syn match csXmlComment +\/\/\/.*$+ contains=csXmlCommentLeader,@csXml,@Spell +syn include @csXml syntax/xml.vim +hi def link xmlRegion Comment " [1] 9.5 Pre-processing directives -syn region csPreCondit - \ start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\)" - \ skip="\\$" end="$" contains=csComment keepend -syn region csRegion matchgroup=csPreCondit start="^\s*#\s*region.*$" - \ end="^\s*#\s*endregion" transparent fold contains=TOP -syn region csSummary start="^\s*/// " -syn match csNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" -syn match csNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" -syn match csNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" +syn match csSpecialChar +\\["\\'0abfnrtvx]+ contained display +syn match csUnicodeNumber +\\u\x\{4}+ contained contains=csUnicodeSpecifier display +syn match csUnicodeNumber +\\U\x\{8}+ contained contains=csUnicodeSpecifier display +syn match csUnicodeSpecifier +\\[uU]+ contained display + +syn region csString matchgroup=csQuote start=+"+ end=+"+ end=+$+ extend contains=csSpecialChar,csSpecialError,csUnicodeNumber,@Spell +syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError display +syn match csCharacter "'\\''" contains=csSpecialChar display +syn match csCharacter "'[^\\]'" display +syn match csNumber "\<0[0-7]*[lL]\=\>" display +syn match csNumber "\<0[xX]\x\+[lL]\=\>" display +syn match csNumber "\<\d\+[lL]\=\>" display +syn match csNumber "\<\d\+\.\d*\%\([eE][-+]\=\d\+\)\=[fFdD]\=" display +syn match csNumber "\.\d\+\%\([eE][-+]\=\d\+\)\=[fFdD]\=" display +syn match csNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" display +syn match csNumber "\<\d\+\%\([eE][-+]\=\d\+\)\=[fFdD]\>" display + +syn region csInterpolatedString matchgroup=csQuote start=+\$"+ end=+"+ end=+$+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,@Spell + +syn region csInterpolation matchgroup=csInterpolationDelimiter start=+{+ end=+}+ keepend contained contains=@csAll,csBracketed,csInterpolationAlign,csInterpolationFormat +syn match csEscapedInterpolation "{{" transparent contains=NONE display +syn match csEscapedInterpolation "}}" transparent contains=NONE display +syn region csInterpolationAlign matchgroup=csInterpolationAlignDel start=+,+ end=+}+ end=+:+me=e-1 contained contains=csNumber,csConstant,csCharacter,csParens,csOpSymbols,csString,csBracketed display +syn match csInterpolationFormat +:[^}]\+}+ contained contains=csInterpolationFormatDel display +syn match csInterpolationAlignDel +,+ contained display +syn match csInterpolationFormatDel +:+ contained display + +syn region csVerbatimString matchgroup=csQuote start=+@"+ end=+"+ skip=+""+ extend contains=csVerbatimQuote,@Spell +syn match csVerbatimQuote +""+ contained +syn match csQuoteError +@$"+he=s+2,me=s+2 + +syn region csInterVerbString matchgroup=csQuote start=+\$@"+ end=+"+ skip=+""+ extend contains=csInterpolation,csEscapedInterpolation,csSpecialChar,csSpecialError,csUnicodeNumber,csVerbatimQuote,@Spell + +syn region csBracketed matchgroup=csParens start=+(+ end=+)+ contained transparent contains=@csAll,csBracketed + +syn cluster csAll contains=csCharacter,csClassType,csComment,csContextualStatement,csEndColon,csInterpolatedString,csIsType,csLabel,csLogicSymbols,csNewType,csConstant,csNumber,csOpSymbols,csOperatorError,csParens,csPreCondit,csRegion,csString,csSummary,csUnicodeNumber,csUnicodeSpecifier,csVerbatimString " The default highlighting. -hi def link csType Type -hi def link csNewType Type -hi def link csClassType Type -hi def link csIsType Type -hi def link csStorage StorageClass -hi def link csClass StorageClass -hi def link csRepeat Repeat -hi def link csConditional Conditional -hi def link csLabel Label -hi def link csModifier StorageClass -hi def link csConstant Constant -hi def link csException Exception -hi def link csUnspecifiedStatement Statement -hi def link csUnsupportedStatement Statement -hi def link csUnspecifiedKeyword Keyword -hi def link csNew Statement -hi def link csLinq Statement -hi def link csIsAs Keyword -hi def link csAsync Keyword -hi def link csContextualStatement Statement -hi def link csOperatorError Error -hi def link csInterfaceDeclaration Include +hi def link csType Type +hi def link csNewType Type +hi def link csClassType Type +hi def link csIsType Type +hi def link csStorage StorageClass +hi def link csClass StorageClass +hi def link csRepeat Repeat +hi def link csConditional Conditional +hi def link csLabel Label +hi def link csModifier StorageClass +hi def link csConstant Constant +hi def link csException Exception +hi def link csUnspecifiedStatement Statement +hi def link csUnsupportedStatement Statement +hi def link csUnspecifiedKeyword Keyword +hi def link csNew Statement +hi def link csLinq Statement +hi def link csIsAs Keyword +hi def link csAsync Keyword +hi def link csContextualStatement Statement +hi def link csOperatorError Error +hi def link csInterfaceDeclaration Include -hi def link csTodo Todo -hi def link csComment Comment +hi def link csTodo Todo +hi def link csComment Comment -hi def link csSpecialError Error -hi def link csSpecialCharError Error -hi def link csString String -hi def link csVerbatimString String -hi def link csVerbatimSpec SpecialChar -hi def link csPreCondit PreCondit -hi def link csCharacter Character -hi def link csSpecialChar SpecialChar -hi def link csNumber Number -hi def link csUnicodeNumber SpecialChar -hi def link csUnicodeSpecifier SpecialChar +hi def link csEndColon Statement +hi def link csOpSymbols Operator +hi def link csLogicSymbols Boolean +hi def link csBraces Function +hi def link csParens Operator + +hi def link csSpecialError Error +hi def link csSpecialCharError Error +hi def link csString String +hi def link csQuote String +hi def link csQuoteError Error +hi def link csInterpolatedString String +hi def link csVerbatimString String +hi def link csInterVerbString String +hi def link csVerbatimQuote SpecialChar +hi def link csPreCondit PreCondit +hi def link csCharacter Character +hi def link csSpecialChar SpecialChar +hi def link csNumber Number +hi def link csUnicodeNumber SpecialChar +hi def link csUnicodeSpecifier SpecialChar +hi def link csInterpolationDelimiter Delimiter +hi def link csInterpolationAlignDel csInterpolationDelimiter +hi def link csInterpolationFormat csInterpolationDelimiter +hi def link csInterpolationFormatDel csInterpolationDelimiter " xml markup -hi def link csXmlCommentLeader Comment -hi def link csXmlComment Comment -hi def link csXmlTag Statement +hi def link csXmlCommentLeader Comment +hi def link csXmlComment Comment +hi def link csXmlTag Statement let b:current_syntax = "cs" let &cpo = s:cs_cpo_save unlet s:cs_cpo_save -" vim: ts=8 +" vim: vts=16,28 diff --git a/runtime/syntax/pf.vim b/runtime/syntax/pf.vim index 81add10e7e..b928dc4fbb 100644 --- a/runtime/syntax/pf.vim +++ b/runtime/syntax/pf.vim @@ -2,12 +2,13 @@ " Language: OpenBSD packet filter configuration (pf.conf) " Original Author: Camiel Dobbelaar " Maintainer: Lauri Tirkkonen -" Last Change: 2016 Jul 06 +" Last Change: 2018 Jul 16 if exists("b:current_syntax") finish endif +let b:current_syntax = "pf" setlocal foldmethod=syntax syn iskeyword @,48-57,_,-,+ syn sync fromstart @@ -17,7 +18,7 @@ syn keyword pfCmd anchor antispoof block include match pass queue syn keyword pfCmd queue set table syn match pfCmd /^\s*load\sanchor\>/ syn keyword pfTodo TODO XXX contained -syn keyword pfWildAddr all any +syn keyword pfWildAddr any no-route urpf-failed self syn match pfComment /#.*$/ contains=pfTodo syn match pfCont /\\$/ syn match pfErrClose /}/ @@ -36,57 +37,6 @@ syn region pfList start=/{/ end=/}/ transparent contains=ALLBUT,pfErrClose,@pfN syn region pfString start=/"/ skip=/\\"/ end=/"/ contains=pfIPv4,pfIPv6,pfNetmask,pfTable,pfVar syn region pfString start=/'/ skip=/\\'/ end=/'/ contains=pfIPv4,pfIPv6,pfNetmask,pfTable,pfVar -syn keyword pfService 802-11-iapp Microsoft-SQL-Monitor -syn keyword pfService Microsoft-SQL-Server NeXTStep NextStep -syn keyword pfService afpovertcp afs3-bos afs3-callback afs3-errors -syn keyword pfService afs3-fileserver afs3-kaserver afs3-prserver -syn keyword pfService afs3-rmtsys afs3-update afs3-vlserver -syn keyword pfService afs3-volser amt-redir-tcp amt-redir-tls -syn keyword pfService amt-soap-http amt-soap-https asf-rmcp at-echo -syn keyword pfService at-nbp at-rtmp at-zis auth authentication -syn keyword pfService bfd-control bfd-echo bftp bgp bgpd biff bootpc -syn keyword pfService bootps canna cddb cddbp chargen chat cmd -syn keyword pfService cmip-agent cmip-man comsat conference -syn keyword pfService conserver courier csnet-ns cso-ns cvspserver -syn keyword pfService daap datametrics daytime dhcpd-sync -syn keyword pfService dhcpv6-client dhcpv6-server discard domain -syn keyword pfService echo efs eklogin ekshell ekshell2 epmap eppc -syn keyword pfService exec finger ftp ftp-data git gopher hostname -syn keyword pfService hostnames hprop http https hunt hylafax iapp -syn keyword pfService icb ident imap imap2 imap3 imaps ingreslock -syn keyword pfService ipp iprop ipsec-msft ipsec-nat-t ipx irc -syn keyword pfService isakmp iscsi isisd iso-tsap kauth kdc kerberos -syn keyword pfService kerberos-adm kerberos-iv kerberos-sec -syn keyword pfService kerberos_master kf kip klogin kpasswd kpop -syn keyword pfService krb524 krb_prop krbupdate krcmd kreg kshell kx -syn keyword pfService l2tp ldap ldaps ldp link login mail mdns -syn keyword pfService mdnsresponder microsoft-ds ms-sql-m ms-sql-s -syn keyword pfService msa msp mtp mysql name nameserver netbios-dgm -syn keyword pfService netbios-ns netbios-ssn netnews netplan netrjs -syn keyword pfService netstat netwall newdate nextstep nfs nfsd -syn keyword pfService nicname nnsp nntp ntalk ntp null openwebnet -syn keyword pfService ospf6d ospfapi ospfd photuris pop2 pop3 pop3pw -syn keyword pfService pop3s poppassd portmap postgresql postoffice -syn keyword pfService pptp presence printer prospero prospero-np -syn keyword pfService puppet pwdgen qotd quote radacct radius -syn keyword pfService radius-acct rdp readnews remotefs resource rfb -syn keyword pfService rfe rfs rfs_server ripd ripng rje rkinit rlp -syn keyword pfService routed router rpc rpcbind rsync rtelnet rtsp -syn keyword pfService sa-msg-port sane-port sftp shell sieve silc -syn keyword pfService sink sip smtp smtps smux snmp snmp-trap -syn keyword pfService snmptrap snpp socks source spamd spamd-cfg -syn keyword pfService spamd-sync spooler spop3 ssdp ssh submission -syn keyword pfService sunrpc supdup supfiledbg supfilesrv support -syn keyword pfService svn svrloc swat syslog syslog-tls systat -syn keyword pfService tacacs tacas+ talk tap tcpmux telnet tempo -syn keyword pfService tftp time timed timeserver timserver tsap -syn keyword pfService ttylink ttytst ub-dns-control ulistserv untp -syn keyword pfService usenet users uucp uucp-path uucpd vnc vxlan -syn keyword pfService wais webster who whod whois www x400 x400-snd -syn keyword pfService xcept xdmcp xmpp-bosh xmpp-client xmpp-server -syn keyword pfService z3950 zabbix-agent zabbix-trapper zebra -syn keyword pfService zebrasrv - hi def link pfCmd Statement hi def link pfComment Comment hi def link pfCont Statement @@ -103,4 +53,281 @@ hi def link pfVar Identifier hi def link pfVarAssign Identifier hi def link pfWildAddr Type -let b:current_syntax = "pf" +" from OpenBSD src/etc/services r1.95 +syn keyword pfService 802-11-iapp +syn keyword pfService Microsoft-SQL-Monitor +syn keyword pfService Microsoft-SQL-Server +syn keyword pfService NeXTStep +syn keyword pfService NextStep +syn keyword pfService afpovertcp +syn keyword pfService afs3-bos +syn keyword pfService afs3-callback +syn keyword pfService afs3-errors +syn keyword pfService afs3-fileserver +syn keyword pfService afs3-kaserver +syn keyword pfService afs3-prserver +syn keyword pfService afs3-rmtsys +syn keyword pfService afs3-update +syn keyword pfService afs3-vlserver +syn keyword pfService afs3-volser +syn keyword pfService amt-redir-tcp +syn keyword pfService amt-redir-tls +syn keyword pfService amt-soap-http +syn keyword pfService amt-soap-https +syn keyword pfService asf-rmcp +syn keyword pfService at-echo +syn keyword pfService at-nbp +syn keyword pfService at-rtmp +syn keyword pfService at-zis +syn keyword pfService auth +syn keyword pfService authentication +syn keyword pfService bfd-control +syn keyword pfService bfd-echo +syn keyword pfService bftp +syn keyword pfService bgp +syn keyword pfService bgpd +syn keyword pfService biff +syn keyword pfService bootpc +syn keyword pfService bootps +syn keyword pfService canna +syn keyword pfService cddb +syn keyword pfService cddbp +syn keyword pfService chargen +syn keyword pfService chat +syn keyword pfService cmd +syn keyword pfService cmip-agent +syn keyword pfService cmip-man +syn keyword pfService comsat +syn keyword pfService conference +syn keyword pfService conserver +syn keyword pfService courier +syn keyword pfService csnet-ns +syn keyword pfService cso-ns +syn keyword pfService cvspserver +syn keyword pfService daap +syn keyword pfService datametrics +syn keyword pfService daytime +syn keyword pfService dhcpd-sync +syn keyword pfService dhcpv6-client +syn keyword pfService dhcpv6-server +syn keyword pfService discard +syn keyword pfService domain +syn keyword pfService echo +syn keyword pfService efs +syn keyword pfService eklogin +syn keyword pfService ekshell +syn keyword pfService ekshell2 +syn keyword pfService epmap +syn keyword pfService eppc +syn keyword pfService exec +syn keyword pfService finger +syn keyword pfService ftp +syn keyword pfService ftp-data +syn keyword pfService git +syn keyword pfService gopher +syn keyword pfService gre-in-udp +syn keyword pfService gre-udp-dtls +syn keyword pfService hostname +syn keyword pfService hostnames +syn keyword pfService hprop +syn keyword pfService http +syn keyword pfService https +syn keyword pfService hunt +syn keyword pfService hylafax +syn keyword pfService iapp +syn keyword pfService icb +syn keyword pfService ident +syn keyword pfService imap +syn keyword pfService imap2 +syn keyword pfService imap3 +syn keyword pfService imaps +syn keyword pfService ingreslock +syn keyword pfService ipp +syn keyword pfService iprop +syn keyword pfService ipsec-msft +syn keyword pfService ipsec-nat-t +syn keyword pfService ipx +syn keyword pfService irc +syn keyword pfService isakmp +syn keyword pfService iscsi +syn keyword pfService isisd +syn keyword pfService iso-tsap +syn keyword pfService kauth +syn keyword pfService kdc +syn keyword pfService kerberos +syn keyword pfService kerberos-adm +syn keyword pfService kerberos-iv +syn keyword pfService kerberos-sec +syn keyword pfService kerberos_master +syn keyword pfService kf +syn keyword pfService kip +syn keyword pfService klogin +syn keyword pfService kpasswd +syn keyword pfService kpop +syn keyword pfService krb524 +syn keyword pfService krb_prop +syn keyword pfService krbupdate +syn keyword pfService krcmd +syn keyword pfService kreg +syn keyword pfService kshell +syn keyword pfService kx +syn keyword pfService l2tp +syn keyword pfService ldap +syn keyword pfService ldaps +syn keyword pfService ldp +syn keyword pfService link +syn keyword pfService login +syn keyword pfService mail +syn keyword pfService mdns +syn keyword pfService mdnsresponder +syn keyword pfService microsoft-ds +syn keyword pfService ms-sql-m +syn keyword pfService ms-sql-s +syn keyword pfService msa +syn keyword pfService msp +syn keyword pfService mtp +syn keyword pfService mysql +syn keyword pfService name +syn keyword pfService nameserver +syn keyword pfService netbios-dgm +syn keyword pfService netbios-ns +syn keyword pfService netbios-ssn +syn keyword pfService netnews +syn keyword pfService netplan +syn keyword pfService netrjs +syn keyword pfService netstat +syn keyword pfService netwall +syn keyword pfService newdate +syn keyword pfService nextstep +syn keyword pfService nfs +syn keyword pfService nfsd +syn keyword pfService nicname +syn keyword pfService nnsp +syn keyword pfService nntp +syn keyword pfService ntalk +syn keyword pfService ntp +syn keyword pfService null +syn keyword pfService openwebnet +syn keyword pfService ospf6d +syn keyword pfService ospfapi +syn keyword pfService ospfd +syn keyword pfService photuris +syn keyword pfService pop2 +syn keyword pfService pop3 +syn keyword pfService pop3pw +syn keyword pfService pop3s +syn keyword pfService poppassd +syn keyword pfService portmap +syn keyword pfService postgresql +syn keyword pfService postoffice +syn keyword pfService pptp +syn keyword pfService presence +syn keyword pfService printer +syn keyword pfService prospero +syn keyword pfService prospero-np +syn keyword pfService puppet +syn keyword pfService pwdgen +syn keyword pfService qotd +syn keyword pfService quote +syn keyword pfService radacct +syn keyword pfService radius +syn keyword pfService radius-acct +syn keyword pfService rdp +syn keyword pfService readnews +syn keyword pfService remotefs +syn keyword pfService resource +syn keyword pfService rfb +syn keyword pfService rfe +syn keyword pfService rfs +syn keyword pfService rfs_server +syn keyword pfService ripd +syn keyword pfService ripng +syn keyword pfService rje +syn keyword pfService rkinit +syn keyword pfService rlp +syn keyword pfService routed +syn keyword pfService router +syn keyword pfService rpc +syn keyword pfService rpcbind +syn keyword pfService rsync +syn keyword pfService rtelnet +syn keyword pfService rtsp +syn keyword pfService sa-msg-port +syn keyword pfService sane-port +syn keyword pfService sftp +syn keyword pfService shell +syn keyword pfService sieve +syn keyword pfService silc +syn keyword pfService sink +syn keyword pfService sip +syn keyword pfService smtp +syn keyword pfService smtps +syn keyword pfService smux +syn keyword pfService snmp +syn keyword pfService snmp-trap +syn keyword pfService snmptrap +syn keyword pfService snpp +syn keyword pfService socks +syn keyword pfService source +syn keyword pfService spamd +syn keyword pfService spamd-cfg +syn keyword pfService spamd-sync +syn keyword pfService spooler +syn keyword pfService spop3 +syn keyword pfService ssdp +syn keyword pfService ssh +syn keyword pfService submission +syn keyword pfService sunrpc +syn keyword pfService supdup +syn keyword pfService supfiledbg +syn keyword pfService supfilesrv +syn keyword pfService support +syn keyword pfService svn +syn keyword pfService svrloc +syn keyword pfService swat +syn keyword pfService syslog +syn keyword pfService syslog-tls +syn keyword pfService systat +syn keyword pfService tacacs +syn keyword pfService tacas+ +syn keyword pfService talk +syn keyword pfService tap +syn keyword pfService tcpmux +syn keyword pfService telnet +syn keyword pfService tempo +syn keyword pfService tftp +syn keyword pfService time +syn keyword pfService timed +syn keyword pfService timeserver +syn keyword pfService timserver +syn keyword pfService tsap +syn keyword pfService ttylink +syn keyword pfService ttytst +syn keyword pfService ub-dns-control +syn keyword pfService ulistserv +syn keyword pfService untp +syn keyword pfService usenet +syn keyword pfService users +syn keyword pfService uucp +syn keyword pfService uucp-path +syn keyword pfService uucpd +syn keyword pfService vnc +syn keyword pfService vxlan +syn keyword pfService wais +syn keyword pfService webster +syn keyword pfService who +syn keyword pfService whod +syn keyword pfService whois +syn keyword pfService www +syn keyword pfService x400 +syn keyword pfService x400-snd +syn keyword pfService xcept +syn keyword pfService xdmcp +syn keyword pfService xmpp-bosh +syn keyword pfService xmpp-client +syn keyword pfService xmpp-server +syn keyword pfService z3950 +syn keyword pfService zabbix-agent +syn keyword pfService zabbix-trapper +syn keyword pfService zebra +syn keyword pfService zebrasrv diff --git a/runtime/syntax/sudoers.vim b/runtime/syntax/sudoers.vim index df1eb99b42..31f5f2b7ed 100644 --- a/runtime/syntax/sudoers.vim +++ b/runtime/syntax/sudoers.vim @@ -1,7 +1,8 @@ " Vim syntax file " Language: sudoers(5) configuration files " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2011-02-24 +" Latest Revision: 2018-07-19 +" Recent Changes: Support for #include and #includedir. if exists("b:current_syntax") finish @@ -24,6 +25,7 @@ syn cluster sudoersCmndSpecList contains=sudoersUserRunasBegin,sudoersPASS syn keyword sudoersTodo contained TODO FIXME XXX NOTE syn region sudoersComment display oneline start='#' end='$' contains=sudoersTodo +syn region sudoersInclude display oneline start='#\(include\|includedir\)' end='$' syn keyword sudoersAlias User_Alias Runas_Alias nextgroup=sudoersUserAlias skipwhite skipnl syn keyword sudoersAlias Host_Alias nextgroup=sudoersHostAlias skipwhite skipnl @@ -335,6 +337,7 @@ hi def link sudoersIntegerValue Number hi def link sudoersStringValue String hi def link sudoersListValue String hi def link sudoersPASSWD Special +hi def link sudoersInclude Statement let b:current_syntax = "sudoers" diff --git a/runtime/tutor/Makefile b/runtime/tutor/Makefile index 35fe821675..a8834a10cf 100644 --- a/runtime/tutor/Makefile +++ b/runtime/tutor/Makefile @@ -66,10 +66,10 @@ tutor.hr.cp1250: tutor.hr.utf-8 iconv -f UTF-8 -t cp1250 tutor.hr.utf-8 > tutor.hr.cp1250 tutor.ja.sjis: tutor.ja.utf-8 - nkf -WXs tutor.ja.utf-8 > tutor.ja.sjis + iconv -f UTF-8 -t cp932 tutor.ja.utf-8 > tutor.ja.sjis tutor.ja.euc: tutor.ja.utf-8 - nkf -WXe tutor.ja.utf-8 > tutor.ja.euc + iconv -f UTF-8 -t EUC-JP tutor.ja.utf-8 > tutor.ja.euc tutor.ko.euc: tutor.ko.utf-8 iconv -f UTF-8 -t EUC-KR tutor.ko.utf-8 > tutor.ko.euc diff --git a/runtime/tutor/README.txt b/runtime/tutor/README.txt index 77097c1990..4338ee9caf 100644 --- a/runtime/tutor/README.txt +++ b/runtime/tutor/README.txt @@ -19,4 +19,19 @@ Bob Ware, Colorado School of Mines, Golden, Co 80401, USA (303) 273-3987 bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet -[This file was modified for Vim by Bram Moolenaar] + +Translation +----------- + +The tutor.xx and tutor.xx.utf-8 files are translated files (where xx is the +langage code). The encoding of tutor.xx might be latin1 or other traditional +encoding. If you don't need a translation with such traditional encoding, +you just need to prepare the tutor.xx.utf-8 file. +If you need another encoding, you can also prepare a file named tutor.xx.enc +(replace enc with the actual encoding name). You might also need to adjust the +tutor.vim file. +The "make" command can be used for creating tutor.xx from tutor.xx.utf-8. +See the Makefile for detail. (For some languages, tutor.xx.utf-8 is created +from tutor.xx for historical reasons.) + +[This file was modified for Vim by Bram Moolenaar et al.] diff --git a/runtime/tutor/tutor.ja.euc b/runtime/tutor/tutor.ja.euc index 8cb63f2d14..0054b320a5 100644 --- a/runtime/tutor/tutor.ja.euc +++ b/runtime/tutor/tutor.ja.euc @@ -147,18 +147,18 @@ NOTE: ޤ 2. ץץȤǤΥޥɤ򥿥פޤ: vim tutor - 'vim' Vim ǥư륳ޥɡ'tutor' Խե + 'vim' Vim ǥư륳ޥɡ'tutor' Խե ̾ǤѹƤ褤եȤޤ礦 3. Υådzؤ褦ˡƥȤޤ - 4. ѹե¸ޤ: :wq + 4. ѹե¸ޤ: :wq 5. ƥå 1 vimtutor λ vimtutor ٵưʲ ؿʤߤޤ礦 6. ʾΥƥåפɤ򤷤Ǥ¹Ԥޤ礦 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 1 @@ -558,11 +558,12 @@ NOTE: 1. ʲ ---> ȼ줿Ԥ˥ưޤ礦 - 2. :s/thee/the ȥפޤ礦ΥޥɤϤιԤǺǽ˸ - ĤäΤˤԤʤ뤳Ȥ˵Ĥޤ礦 + 2. :s/thee/the ȥפޤ礦ΥޥɤϤιԤǺǽ˸ + äΤˤԤ뤳Ȥ˵Ĥޤ礦 - 3. Ǥ :s/thee/the/g ȥפޤ礦Τִ뤳Ȥ̣ޤ - ѹϤιԤǸĤäƤβսФƹԤʤޤ + 3. Ǥ :s/thee/the/g ȥפޤ礦ɲä g ե饰ϹΤִ + 뤳Ȥ̣ޤѹϤιԤǸĤäƤβսФƹԤ + ޤ ---> thee best time to see thee flowers is in thee spring. @@ -638,8 +639,8 @@ NOTE: NOTE: Vim λե̾ TEST ȶ˵ưȡ¸ 塼ȥꥢʣǤ夬ϤǤ - 5. ˡΤ褦˥פƥեäޤ礦(MS-DOS): :!del TEST - ⤷(Unix): :!rm TEST + 5. ˡΤ褦˥פƥեäޤ礦(Windows): :!del TEST + ⤷(Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -696,7 +697,7 @@ NOTE: 1. :!command ˤä ޥɤ¹Ԥޤ 褯Ȥ: - (MS-DOS) (Unix) + (Windows) (Unix) :!dir :!ls - ǥ쥯ȥΰ򸫤롣 :!del FILENAME :!rm FILENAME - ե롣 @@ -718,7 +719,7 @@ NOTE: ** o 򥿥פȡβιԤ⡼ɤޤ ** - 1. ʲ ---> ȼ줿Ԥ˥ưޤ礦 + 1. ʲ ---> ȼ줿ǽιԤ˥ưޤ礦 2. o (ʸ) 򥿥פơβιԤ򳫤⡼ɤޤ @@ -741,7 +742,7 @@ NOTE: ** μΰ֤ƥȤɲäˤ a ȥפޤ ** - 1. ---> Ǽ줿Ԥذưޤ礦 + 1. ---> Ǽ줿ǽιԤذưޤ礦 2. e 򲡤 li νüޤǥưޤ @@ -751,7 +752,7 @@ NOTE: ޤ 5. e ȤäƼԴñذưƥå 3 4 򷫤֤ޤ - + ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. @@ -788,9 +789,9 @@ NOTE: ** ƥȤΥԡˤϥڥ졼 y 򡢥ڡȤˤ p Ȥޤ ** 1. ---> ȼ줿Ԥذư "a)" θ֤Ƥޤ - + 2. v ǥӥ奢⡼ɤ򳫻Ϥ"first" μޤǥưޤ - + 3. y 򥿥פƶĴɽ줿ƥȤ yank (ԡ)ޤ 4. ιԤιޤǥưޤ: j$ @@ -810,7 +811,7 @@ NOTE: ** ִκݤʸ/ʸ̵뤹ˤϡץꤷޤ ** - 1. ͤϤ 'ignore' 򸡺ޤ礦: /ignore + 1. ͤϤ 'ignore' 򸡺ޤ礦: /ignore n 򲡤Ʋ٤򷫤֤ޤ 2. ͤϤ 'ic' (Ignore Case ά) ץꤷޤ: :set ic @@ -820,13 +821,13 @@ NOTE: 4. 'hlsearch' 'incsearch' ץꤷޤ礦: :set hls is - 5. ޥɤϤơ뤫Ƥߤޤ礦: /ignore + 5. ޥɤϤơ뤫Ƥߤޤ礦: /ignore 6. ʸʸζ̵̤ˤˤϼͤϤޤ: :set noic -NOTE: ޥåζĴɽˤϼͤϤޤ: :nohlsearch +NOTE: ޥåζĴɽˤϼͤϤޤ: :nohlsearch NOTE: 1Ĥθޥɤʸʸζ̤᤿ʤСե졼 \c - Ѥޤ: /ignore\c + Ѥޤ: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 6 @@ -843,12 +844,12 @@ NOTE: 1 5. ʸ R 򥿥פִ⡼ɤꡢ򲡤ȴ롣 6. ":set xxx" ȥפȥץ "xxx" ꤵ롣 - 'ic' 'ignorecase' ʸʸζ̤ʤ + 'ic' 'ignorecase' ʸʸζ̤ʤ 'is' 'incsearch' ե졼ʬޥåƤʬɽ 'hls' 'hlsearch' ޥå뤹٤Ĵɽ ĹûɤΥץ̾ǤѤǤޤ - 7. "no" Ϳץ̵ˤޤ: :set noic + 7. ץ̵ˤˤ "no" Ϳޤ: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ å 7.1: 饤إץޥ @@ -884,7 +885,7 @@ NOTE: 1 1. "vimrc" եԽ򳫻Ϥ롣ϥƥ˰¸ޤ :edit ~/.vimrc UNIX - :edit $VIM/_vimrc MS-Windows + :edit $VIM/_vimrc Windows 2. ǥץ "vimrc" ɤ߹ߤޤ :read $VIMRUNTIME/vimrc_example.vim @@ -910,7 +911,7 @@ NOTE: 1 4. CTRL-D 򲡤 Vim "e" Ϥޤ륳ޥɤΰɽޤ - 5. 򲡤 Vim ":edit" Ȥޥ̾䴰ޤ + 5. d ȥפ Vim ":edit" Ȥޥ̾䴰ޤ 6. ˶ȡ¸Υե̾λϤޤäޤ: :edit FIL @@ -923,7 +924,7 @@ NOTE: å 7 - 1. إץɥ򳫤ˤ :help Ȥ뤫 򲡤 + 1. إץɥ򳫤ˤ :help Ȥ뤫 򲡤 2. ޥ(cmd)Υإפ򸡺ˤ :help cmd ȥפ롣 diff --git a/runtime/tutor/tutor.ja.sjis b/runtime/tutor/tutor.ja.sjis index 1e70cbc081..c7228191b1 100644 --- a/runtime/tutor/tutor.ja.sjis +++ b/runtime/tutor/tutor.ja.sjis @@ -147,18 +147,18 @@ NOTE: ܂B 2. VFvvgł̃R}h^Cv܂: vim tutor - 'vim' Vim GfB^NR}hA'tutor' ͕ҏWt@C + 'vim' Vim GfB^NR}hA'tutor' ͕ҏWt@C OłBύXĂ悢t@Cg܂傤B 3. ÕbXŊw񂾂悤ɁAeLXg}A폜܂B - 4. ύXt@Cɕۑ܂: :wq + 4. ύXt@Cɕۑ܂: :wq 5. Xebv 1 vimtutor Iꍇ vimtutor ēxNAȉ v֐i݂܂傤B 6. ȏ̃Xebvǂŗłs܂傤B - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 1 v @@ -558,11 +558,12 @@ NOTE: 1. ȉ ---> ƎꂽsɃJ[\ړ܂傤B - 2. :s/thee/the ƃ^Cv܂傤B̃R}h͂̍sōŏɌ - ‚̂ɂsȂ邱ƂɋC‚܂傤B + 2. :s/thee/the ƃ^Cv܂傤B̃R}h͂̍sōŏɌ + ̂ɂs邱ƂɋC‚܂傤B - 3. ł :s/thee/the/g ƃ^Cv܂傤BsŜu邱ƂӖ܂B - ̕ύX͂̍sŌ‚SẲӏɑ΂čsȂ܂B + 3. ł :s/thee/the/g ƃ^Cv܂傤Blj g tO͍sŜu + 邱ƂӖ܂B̕ύX͂̍sŌ‚SẲӏɑ΂čs + ܂B ---> thee best time to see thee flowers is in thee spring. @@ -638,8 +639,8 @@ NOTE: NOTE: Vim IAt@C TEST ƋɋNƁAۑ `[gA̕łオ͂łB - 5. ɁÂ悤Ƀ^Cvăt@C܂傤(MS-DOS): :!del TEST - (Unix): :!rm TEST + 5. ɁÂ悤Ƀ^Cvăt@C܂傤(Windows): :!del TEST + (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -696,7 +697,7 @@ NOTE: 1. :!command ɂ OR}hs܂B 悭g: - (MS-DOS) (Unix) + (Windows) (Unix) :!dir :!ls - fBNg̈ꗗB :!del FILENAME :!rm FILENAME - t@C폜B @@ -718,7 +719,7 @@ NOTE: ** o ^CvƁAJ[\̉̍sJA}[hɓ܂ ** - 1. ȉ ---> ƎꂽsɃJ[\ړ܂傤B + 1. ȉ ---> Ǝꂽŏ̍sɃJ[\ړ܂傤B 2. o () ^CvāAJ[\̉̍sJA}[hɓ܂B @@ -741,7 +742,7 @@ NOTE: ** J[\̎̈ʒueLXgljɂ a ƃ^Cv܂ ** - 1. J[\ ---> Ŏꂽsֈړ܂傤B + 1. J[\ ---> Ŏꂽŏ̍sֈړ܂傤B 2. e li ̏I[܂ŃJ[\ړ܂B @@ -751,7 +752,7 @@ NOTE: ܂B 5. e gĎ̕sSȒPֈړAXebv 3 4 JԂ܂B - + ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. @@ -788,9 +789,9 @@ NOTE: ** eLXg̃Rs[ɂ̓Iy[^ y Ay[Xgɂ p g܂ ** 1. ---> ƎꂽsֈړAJ[\ "a)" ̌ɒuĂ܂B - + 2. v ŃrWA[hJnA"first" ̎O܂ŃJ[\ړ܂B - + 3. y ^Cvċ\ꂽeLXg yank (Rs[)܂B 4. ̍s̍s܂ŃJ[\ړ܂: j$ @@ -810,7 +811,7 @@ NOTE: ** u̍ۂɑ啶/𖳎ɂ́AIvVݒ肵܂ ** - 1. ̗lɓ͂ 'ignore' ܂傤: /ignore + 1. ̗lɓ͂ 'ignore' ܂傤: /ignore n ĉxJԂ܂B 2. ̗lɓ͂ 'ic' (Ignore Case ̗) IvVݒ肵܂: :set ic @@ -820,13 +821,13 @@ NOTE: 4. 'hlsearch' 'incsearch' IvVݒ肵܂傤: :set hls is - 5. R}hē͂āAN邩Ă݂܂傤: /ignore + 5. R}hē͂āAN邩Ă݂܂傤: /ignore 6. 啶̋ʂ𖳌ɂɂ͎̗lɓ͂܂: :set noic -NOTE: }b`̋\߂ɂ͎̗lɓ͂܂: :nohlsearch +NOTE: }b`̋\߂ɂ͎̗lɓ͂܂: :nohlsearch NOTE: 1‚̌R}h啶̋ʂ߂Ȃ΁At[Y \c - gp܂: /ignore\c + gp܂: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 6 v @@ -843,12 +844,12 @@ NOTE: 1 5. 啶 R ^Cvƒu[hɓAƔB 6. ":set xxx" ƃ^CvƃIvV "xxx" ݒ肳B - 'ic' 'ignorecase' ɑ啶̋ʂȂ + 'ic' 'ignorecase' ɑ啶̋ʂȂ 'is' 'incsearch' t[Yɕ}b`Ă镔\ 'hls' 'hlsearch' }b`邷ׂ\ AZAǂ̃IvVłgpł܂B - 7. "no" t^AIvV𖳌ɂ܂: :set noic + 7. IvV𖳌ɂɂ "no" t^܂: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bX 7.1: ICwvR}h @@ -884,7 +885,7 @@ NOTE: 1 1. "vimrc" t@C̕ҏWJnB̓VXeɈˑ܂B :edit ~/.vimrc UNIX - :edit $VIM/_vimrc MS-Windows + :edit $VIM/_vimrc Windows 2. ŃTv "vimrc" ǂݍ݂܂B :read $VIMRUNTIME/vimrc_example.vim @@ -910,7 +911,7 @@ NOTE: 1 4. CTRL-D Vim "e" n܂R}ḧꗗ\܂B - 5. Vim ":edit" ƂR}h⊮܂B + 5. d ƃ^Cv Vim ":edit" ƂR}h⊮܂B 6. ɋ󔒂ƁÃt@C̎n܂܂: :edit FIL @@ -923,7 +924,7 @@ NOTE: bX 7 v - 1. wvEBhEJɂ :help Ƃ邩 B + 1. wvEBhEJɂ :help Ƃ邩 B 2. R}h(cmd)̃wvɂ :help cmd ƃ^CvB diff --git a/runtime/tutor/tutor.ja.utf-8 b/runtime/tutor/tutor.ja.utf-8 index fdca0eb36e..a1bb905890 100644 --- a/runtime/tutor/tutor.ja.utf-8 +++ b/runtime/tutor/tutor.ja.utf-8 @@ -147,18 +147,18 @@ NOTE: 全てのレッスンを通じて、覚えようとするのではなく ません。 2. シェルプロンプトでこのコマンドをタイプします: vim tutor - 'vim'が Vim エディタを起動するコマンド、'tutor' は編集したいファイルの + 'vim' が Vim エディタを起動するコマンド、'tutor' は編集したいファイルの 名前です。変更してもよいファイルを使いましょう。 3. 前のレッスンで学んだように、テキストを挿入、削除します。 - 4. 変更をファイルに保存します: :wq + 4. 変更をファイルに保存します: :wq 5. ステップ 1 で vimtutor を終了した場合は vimtutor を再度起動し、以下の 要約へ進みましょう。 6. 以上のステップを読んで理解した上でこれを実行しましょう。 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 1 要約 @@ -558,11 +558,12 @@ NOTE: この機能は括弧が一致していないプログラムをデバッ 1. 以下の ---> と示された行にカーソルを移動しましょう。 - 2. :s/thee/the とタイプしましょう。このコマンドはその行で最初に見 - つかったものにだけ行なわれることに気をつけましょう。 + 2. :s/thee/the とタイプしましょう。このコマンドはその行で最初に見つ + かったものにだけ行われることに気をつけましょう。 - 3. では :s/thee/the/g とタイプしましょう。行全体を置換することを意味します。 - この変更はその行で見つかった全ての箇所に対して行なわれます。 + 3. では :s/thee/the/g とタイプしましょう。追加した g フラグは行全体を置換す + ることを意味します。この変更はその行で見つかった全ての箇所に対して行われ + ます。 ---> thee best time to see thee flowers is in thee spring. @@ -638,8 +639,8 @@ NOTE: 全ての : コマンドは を押して終了しなければな NOTE: ここで Vim を終了し、ファイル名 TEST と共に起動すると、保存した時の チュートリアルの複製ができ上がるはずです。 - 5. さらに、次のようにタイプしてファイルを消しましょう(MS-DOS): :!del TEST - もしくは(Unix): :!rm TEST + 5. さらに、次のようにタイプしてファイルを消しましょう(Windows): :!del TEST + もしくは(Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -696,7 +697,7 @@ NOTE: 外部コマンドの出力を読み込むことも出来ます。例え 1. :!command によって 外部コマンドを実行します。 よく使う例: - (MS-DOS) (Unix) + (Windows) (Unix) :!dir :!ls - ディレクトリ内の一覧を見る。 :!del FILENAME :!rm FILENAME - ファイルを削除する。 @@ -718,7 +719,7 @@ NOTE: 外部コマンドの出力を読み込むことも出来ます。例え ** o をタイプすると、カーソルの下の行が開き、挿入モードに入ります ** - 1. 以下の ---> と示された行にカーソルを移動しましょう。 + 1. 以下の ---> と示された最初の行にカーソルを移動しましょう。 2. o (小文字) をタイプして、カーソルの下の行を開き、挿入モードに入ります。 @@ -741,7 +742,7 @@ NOTE: 外部コマンドの出力を読み込むことも出来ます。例え ** カーソルの次の位置からテキストを追加するには a とタイプします ** - 1. カーソルを ---> で示された行へ移動しましょう。 + 1. カーソルを ---> で示された最初の行へ移動しましょう。 2. e を押して li の終端部までカーソルを移動します。 @@ -751,7 +752,7 @@ NOTE: 外部コマンドの出力を読み込むことも出来ます。例え します。 5. e を使って次の不完全な単語へ移動し、ステップ 3 と 4 を繰り返します。 - + ---> This li will allow you to pract appendi text to a line. ---> This line will allow you to practice appending text to a line. @@ -788,9 +789,9 @@ NOTE: 置換モードは挿入モードに似ていますが、全てのタイ ** テキストのコピーにはオペレータ y を、ペーストには p を使います ** 1. ---> と示された行へ移動し、カーソルを "a)" の後に置いておきます。 - + 2. v でビジュアルモードを開始し、"first" の手前までカーソルを移動します。 - + 3. y をタイプして強調表示されたテキストを yank (コピー)します。 4. 次の行の行末までカーソルを移動します: j$ @@ -810,7 +811,7 @@ NOTE: 置換モードは挿入モードに似ていますが、全てのタイ ** 検索や置換の際に大文字/小文字を無視するには、オプションを設定します ** - 1. 次の様に入力して 'ignore' を検索しましょう: /ignore + 1. 次の様に入力して 'ignore' を検索しましょう: /ignore n を押して何度か検索を繰り返します。 2. 次の様に入力して 'ic' (Ignore Case の略) オプションを設定します: :set ic @@ -820,13 +821,13 @@ NOTE: 置換モードは挿入モードに似ていますが、全てのタイ 4. 'hlsearch' と 'incsearch' オプションを設定しましょう: :set hls is - 5. 検索コマンドを再入力して、何が起こるか見てみましょう: /ignore + 5. 検索コマンドを再入力して、何が起こるか見てみましょう: /ignore 6. 大文字小文字の区別を無効にするには次の様に入力します: :set noic -NOTE: マッチの強調表示をやめるには次の様に入力します: :nohlsearch +NOTE: マッチの強調表示をやめるには次の様に入力します: :nohlsearch NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたいならば、フレーズに \c - を使用します: /ignore\c + を使用します: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 6 要約 @@ -843,12 +844,12 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい 5. 大文字の R をタイプすると置換モードに入り、を押すと抜ける。 6. ":set xxx" とタイプするとオプション "xxx" が設定される。 - 'ic' 'ignorecase' 検索時に大文字小文字の区別しない + 'ic' 'ignorecase' 検索時に大文字小文字の区別しない 'is' 'incsearch' 検索フレーズに部分マッチしている部分を表示する 'hls' 'hlsearch' マッチするすべを強調表示する 長い方、短い方、どちらのオプション名でも使用できます。 - 7. "no" を付与し、オプションを無効にします: :set noic + 7. オプションを無効にするには "no" を付与します: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ レッスン 7.1: オンラインヘルプコマンド @@ -884,7 +885,7 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい 1. "vimrc" ファイルの編集を開始する。これはシステムに依存します。 :edit ~/.vimrc UNIX 向け - :edit $VIM/_vimrc MS-Windows 向け + :edit $VIM/_vimrc Windows 向け 2. ここでサンプルの "vimrc" を読み込みます。 :read $VIMRUNTIME/vimrc_example.vim @@ -910,7 +911,7 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい 4. CTRL-D を押すと Vim は "e" から始まるコマンドの一覧を表示します。 - 5. を押すと Vim は ":edit" というコマンド名を補完します。 + 5. d とタイプすると Vim は ":edit" というコマンド名を補完します。 6. さらに空白と、既存のファイル名の始まりを加えます: :edit FIL @@ -923,7 +924,7 @@ NOTE: 補完は多くのコマンドで動作します。そして CTRL-D と もしくは を押す。 + 1. ヘルプウィンドウを開くには :help とするか もしくは を押す。 2. コマンド(cmd)のヘルプを検索するには :help cmd とタイプする。 diff --git a/runtime/tutor/tutor.lv b/runtime/tutor/tutor.lv.utf-8 similarity index 100% rename from runtime/tutor/tutor.lv rename to runtime/tutor/tutor.lv.utf-8 diff --git a/runtime/tutor/tutor.vim b/runtime/tutor/tutor.vim index f8a54965ea..f450e773da 100644 --- a/runtime/tutor/tutor.vim +++ b/runtime/tutor/tutor.vim @@ -59,7 +59,7 @@ if s:ext =~? '\.en' let s:ext = "" endif -" The japanese tutor is available in two encodings, guess which one to use +" The Japanese tutor is available in three encodings, guess which one to use " The "sjis" one is actually "cp932", it doesn't matter for this text. if s:ext =~? '\.ja' if &enc =~ "euc" @@ -69,7 +69,7 @@ if s:ext =~? '\.ja' endif endif -" The korean tutor is available in two encodings, guess which one to use +" The Korean tutor is available in two encodings, guess which one to use if s:ext =~? '\.ko' if &enc != "utf-8" let s:ext = ".ko.euc" @@ -169,15 +169,6 @@ if s:ext =~? '\.hr' endif endif -" Esperanto is only available in utf-8 -if s:ext =~? '\.eo' - let s:ext = ".eo.utf-8" -endif -" Vietnamese is only available in utf-8 -if s:ext =~? '\.vi' - let s:ext = ".vi.utf-8" -endif - " If 'encoding' is utf-8 s:ext must end in utf-8. if &enc == 'utf-8' && s:ext !~ '\.utf-8' let s:ext .= '.utf-8' @@ -190,6 +181,9 @@ let s:tutorxx = $VIMRUNTIME . s:tutorfile . s:ext " 3. Finding the file: if filereadable(s:tutorxx) let $TUTOR = s:tutorxx +elseif s:ext !~ '\.utf-8' && filereadable(s:tutorxx . ".utf-8") + " Fallback to utf-8 if available. + let $TUTOR = s:tutorxx . ".utf-8" else let $TUTOR = $VIMRUNTIME . s:tutorfile echo "The file " . s:tutorxx . " does not exist.\n" From 79a494d5e2f97c10e74f92ea529552623c314422 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 22 Jul 2018 04:30:21 +0200 Subject: [PATCH 25/31] patch 8.1.0201: newer Python uses "importlib" instead of "imp" Problem: Newer Python uses "importlib" instead of "imp". Solution: Use "importlib" for newer Python versions. (closes #3163) --- src/if_py_both.h | 75 +++++++++++++++++++++++++++++++++++++++++++ src/testdir/test87.in | 21 +++++++----- src/version.c | 2 ++ 3 files changed, 90 insertions(+), 8 deletions(-) diff --git a/src/if_py_both.h b/src/if_py_both.h index 417f86cbb9..58db254dcc 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -88,8 +88,12 @@ static PyObject *py_getcwd; static PyObject *vim_module; static PyObject *vim_special_path_object; +#if PY_VERSION_HEX >= 0x030700f0 +static PyObject *py_find_spec; +#else static PyObject *py_find_module; static PyObject *py_load_module; +#endif static PyObject *VimError; @@ -539,6 +543,7 @@ PythonIO_Init_io(void) return 0; } +#if PY_VERSION_HEX < 0x030700f0 typedef struct { PyObject_HEAD @@ -567,6 +572,7 @@ static struct PyMethodDef LoaderMethods[] = { {"load_module", (PyCFunction)LoaderLoadModule, METH_VARARGS, ""}, { NULL, NULL, 0, NULL} }; +#endif /* Check to see whether a Vim error has been reported, or a keyboard * interrupt has been detected. @@ -1163,6 +1169,37 @@ Vim_GetPaths(PyObject *self UNUSED) return ret; } +#if PY_VERSION_HEX >= 0x030700f0 + static PyObject * +FinderFindSpec(PyObject *self, PyObject *args) +{ + char *fullname; + PyObject *paths; + PyObject *target = Py_None; + PyObject *spec; + + if (!PyArg_ParseTuple(args, "s|O", &fullname, &target)) + return NULL; + + if (!(paths = Vim_GetPaths(self))) + return NULL; + + spec = PyObject_CallFunction(py_find_spec, "sNN", fullname, paths, target); + + Py_DECREF(paths); + + if (!spec) + { + if (PyErr_Occurred()) + return NULL; + + Py_INCREF(Py_None); + return Py_None; + } + + return spec; +} +#else static PyObject * call_load_module(char *name, int len, PyObject *find_module_result) { @@ -1305,6 +1342,7 @@ FinderFindModule(PyObject *self, PyObject *args) return (PyObject *) loader; } +#endif static PyObject * VimPathHook(PyObject *self UNUSED, PyObject *args) @@ -1336,7 +1374,11 @@ static struct PyMethodDef VimMethods[] = { {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, {"fchdir", (PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, {"foreach_rtp", VimForeachRTP, METH_O, "Call given callable for each path in &rtp"}, +#if PY_VERSION_HEX >= 0x030700f0 + {"find_spec", FinderFindSpec, METH_VARARGS, "Internal use only, returns spec object for any input it receives"}, +#else {"find_module", FinderFindModule, METH_VARARGS, "Internal use only, returns loader object for any input it receives"}, +#endif {"path_hook", VimPathHook, METH_VARARGS, "Hook function to install in sys.path_hooks"}, {"_get_paths", (PyCFunction)Vim_GetPaths, METH_NOARGS, "Get &rtp-based additions to sys.path"}, { NULL, NULL, 0, NULL} @@ -6545,6 +6587,7 @@ init_structs(void) OptionsType.tp_traverse = (traverseproc)OptionsTraverse; OptionsType.tp_clear = (inquiry)OptionsClear; +#if PY_VERSION_HEX < 0x030700f0 vim_memset(&LoaderType, 0, sizeof(LoaderType)); LoaderType.tp_name = "vim.Loader"; LoaderType.tp_basicsize = sizeof(LoaderObject); @@ -6552,6 +6595,7 @@ init_structs(void) LoaderType.tp_doc = "vim message object"; LoaderType.tp_methods = LoaderMethods; LoaderType.tp_dealloc = (destructor)LoaderDestructor; +#endif #if PY_MAJOR_VERSION >= 3 vim_memset(&vimmodule, 0, sizeof(vimmodule)); @@ -6583,7 +6627,9 @@ init_types(void) PYTYPE_READY(FunctionType); PYTYPE_READY(OptionsType); PYTYPE_READY(OutputType); +#if PY_VERSION_HEX < 0x030700f0 PYTYPE_READY(LoaderType); +#endif return 0; } @@ -6707,7 +6753,9 @@ static struct object_constant { {"List", (PyObject *)&ListType}, {"Function", (PyObject *)&FunctionType}, {"Options", (PyObject *)&OptionsType}, +#if PY_VERSION_HEX < 0x030700f0 {"_Loader", (PyObject *)&LoaderType}, +#endif }; #define ADD_OBJECT(m, name, obj) \ @@ -6729,6 +6777,10 @@ populate_module(PyObject *m) PyObject *other_module; PyObject *attr; PyObject *imp; +#if PY_VERSION_HEX >= 0x030700f0 + PyObject *dict; + PyObject *cls; +#endif for (i = 0; i < (int)(sizeof(numeric_constants) / sizeof(struct numeric_constant)); @@ -6801,6 +6853,28 @@ populate_module(PyObject *m) ADD_OBJECT(m, "VIM_SPECIAL_PATH", vim_special_path_object); +#if PY_VERSION_HEX >= 0x030700f0 + if (!(imp = PyImport_ImportModule("importlib.machinery"))) + return -1; + + dict = PyModule_GetDict(imp); + + if (!(cls = PyDict_GetItemString(dict, "PathFinder"))) + { + Py_DECREF(imp); + return -1; + } + + if (!(py_find_spec = PyObject_GetAttrString(cls, "find_spec"))) + { + Py_DECREF(imp); + return -1; + } + + Py_DECREF(imp); + + ADD_OBJECT(m, "_find_spec", py_find_spec); +#else if (!(imp = PyImport_ImportModule("imp"))) return -1; @@ -6821,6 +6895,7 @@ populate_module(PyObject *m) ADD_OBJECT(m, "_find_module", py_find_module); ADD_OBJECT(m, "_load_module", py_load_module); +#endif return 0; } diff --git a/src/testdir/test87.in b/src/testdir/test87.in index ac0410901d..31de37b997 100644 --- a/src/testdir/test87.in +++ b/src/testdir/test87.in @@ -219,6 +219,7 @@ import sys import re py33_type_error_pattern = re.compile('^__call__\(\) takes (\d+) positional argument but (\d+) were given$') +py37_exception_repr = re.compile(r'([^\(\),])(\)+)$') def ee(expr, g=globals(), l=locals()): cb = vim.current.buffer @@ -227,17 +228,17 @@ def ee(expr, g=globals(), l=locals()): exec(expr, g, l) except Exception as e: if sys.version_info >= (3, 3) and e.__class__ is AttributeError and str(e).find('has no attribute')>=0 and not str(e).startswith("'vim."): - cb.append(expr + ':' + repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1])))) + msg = repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1]))) elif sys.version_info >= (3, 3) and e.__class__ is ImportError and str(e).find('No module named \'') >= 0: - cb.append(expr + ':' + repr((e.__class__, ImportError(str(e).replace("'", ''))))) + msg = repr((e.__class__, ImportError(str(e).replace("'", '')))) elif sys.version_info >= (3, 6) and e.__class__ is ModuleNotFoundError: # Python 3.6 gives ModuleNotFoundError, change it to an ImportError - cb.append(expr + ':' + repr((ImportError, ImportError(str(e).replace("'", ''))))) + msg = repr((ImportError, ImportError(str(e).replace("'", '')))) elif sys.version_info >= (3, 3) and e.__class__ is TypeError: m = py33_type_error_pattern.search(str(e)) if m: msg = '__call__() takes exactly {0} positional argument ({1} given)'.format(m.group(1), m.group(2)) - cb.append(expr + ':' + repr((e.__class__, TypeError(msg)))) + msg = repr((e.__class__, TypeError(msg))) else: msg = repr((e.__class__, e)) # Messages changed with Python 3.6, change new to old. @@ -249,9 +250,8 @@ def ee(expr, g=globals(), l=locals()): oldmsg2 = '''"Can't convert 'int' object to str implicitly"''' if msg.find(newmsg2) > -1: msg = msg.replace(newmsg2, oldmsg2) - cb.append(expr + ':' + msg) elif sys.version_info >= (3, 5) and e.__class__ is ValueError and str(e) == 'embedded null byte': - cb.append(expr + ':' + repr((TypeError, TypeError('expected bytes with no null')))) + msg = repr((TypeError, TypeError('expected bytes with no null'))) else: msg = repr((e.__class__, e)) # Some Python versions say can't, others cannot. @@ -262,11 +262,16 @@ def ee(expr, g=globals(), l=locals()): msg = msg.replace('"cannot ', '\'cannot ') if msg.find(' attributes"') > -1: msg = msg.replace(' attributes"', ' attributes\'') - cb.append(expr + ':' + msg) + if sys.version_info >= (3, 7): + msg = py37_exception_repr.sub(r'\1,\2', msg) + cb.append(expr + ':' + msg) else: cb.append(expr + ':NOT FAILED') except Exception as e: - cb.append(expr + '::' + repr((e.__class__, e))) + msg = repr((e.__class__, e)) + if sys.version_info >= (3, 7): + msg = py37_exception_repr.sub(r'\1,\2', msg) + cb.append(expr + '::' + msg) EOF :fun New(...) : return ['NewStart']+a:000+['NewEnd'] diff --git a/src/version.c b/src/version.c index 2d5a1310f4..44c620cc4a 100644 --- a/src/version.c +++ b/src/version.c @@ -789,6 +789,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 201, /**/ 200, /**/ From 6183ccbd679751ff5b138f23a34ead3d7bbc5c1b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 22 Jul 2018 05:08:11 +0200 Subject: [PATCH 26/31] patch 8.1.0202: :version always shows +packages Problem: :version always shows +packages. (Takuya Fujiwara) Solution: Add #ifdef (closes #3198) Also for has(). --- src/evalfunc.c | 2 ++ src/version.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/evalfunc.c b/src/evalfunc.c index bb3257119f..7d0f33aaa0 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -6302,7 +6302,9 @@ f_has(typval_T *argvars, typval_T *rettv) #ifdef FEAT_OLE "ole", #endif +#ifdef FEAT_EVAL "packages", +#endif #ifdef FEAT_PATH_EXTRA "path_extra", #endif diff --git a/src/version.c b/src/version.c index 44c620cc4a..a0f7483093 100644 --- a/src/version.c +++ b/src/version.c @@ -493,7 +493,11 @@ static char *(features[]) = "-ole", # endif #endif +#ifdef FEAT_EVAL "+packages", +#else + "-packages", +#endif #ifdef FEAT_PATH_EXTRA "+path_extra", #else @@ -789,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 202, /**/ 201, /**/ From 578333b2ecdfef3109cb07a82c3aa08ad3dc5664 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 22 Jul 2018 07:31:09 +0200 Subject: [PATCH 27/31] patch 8.1.0203: building with Perl 5.28 fails on Windows Problem: Building with Perl 5.28 fails on Windows. Solution: Define Perl_mg_get. (closes #3196) --- src/if_perl.xs | 22 +++++++++++++++------- src/version.c | 2 ++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/if_perl.xs b/src/if_perl.xs index 9f50a87c32..55a24c6ac7 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -199,6 +199,9 @@ typedef int perl_key; # define Perl_gv_stashpv dll_Perl_gv_stashpv # define Perl_markstack_grow dll_Perl_markstack_grow # define Perl_mg_find dll_Perl_mg_find +# if (PERL_REVISION == 5) && (PERL_VERSION >= 28) +# define Perl_mg_get dll_Perl_mg_get +# endif # define Perl_newXS dll_Perl_newXS # define Perl_newSV dll_Perl_newSV # define Perl_newSViv dll_Perl_newSViv @@ -342,6 +345,9 @@ static I32* (*Perl_markstack_grow)(pTHX); static void (*Perl_markstack_grow)(pTHX); # endif static MAGIC* (*Perl_mg_find)(pTHX_ SV*, int); +# if (PERL_REVISION == 5) && (PERL_VERSION >= 28) +static int (*Perl_mg_get)(pTHX_ SV*); +# endif static CV* (*Perl_newXS)(pTHX_ char*, XSUBADDR_t, char*); static SV* (*Perl_newSV)(pTHX_ STRLEN); static SV* (*Perl_newSViv)(pTHX_ IV); @@ -494,6 +500,9 @@ static struct { {"Perl_gv_stashpv", (PERL_PROC*)&Perl_gv_stashpv}, {"Perl_markstack_grow", (PERL_PROC*)&Perl_markstack_grow}, {"Perl_mg_find", (PERL_PROC*)&Perl_mg_find}, +# if (PERL_REVISION == 5) && (PERL_VERSION >= 28) + {"Perl_mg_get", (PERL_PROC*)&Perl_mg_get}, +# endif {"Perl_newXS", (PERL_PROC*)&Perl_newXS}, {"Perl_newSV", (PERL_PROC*)&Perl_newSV}, {"Perl_newSViv", (PERL_PROC*)&Perl_newSViv}, @@ -862,8 +871,8 @@ perl_win_free(win_T *wp) { if (wp->w_perl_private && perl_interp != NULL) { - SV *sv = (SV*)wp->w_perl_private; - D_Save_Sv(sv); + SV *sv = (SV*)wp->w_perl_private; + D_Save_Sv(sv); sv_setiv(sv, 0); SvREFCNT_dec(sv); } @@ -875,8 +884,8 @@ perl_buf_free(buf_T *bp) { if (bp->b_perl_private && perl_interp != NULL) { - SV *sv = (SV *)bp->b_perl_private; - D_Save_Sv(sv); + SV *sv = (SV *)bp->b_perl_private; + D_Save_Sv(sv); sv_setiv(sv, 0); SvREFCNT_dec(sv); } @@ -911,9 +920,8 @@ I32 cur_val(IV iv, SV *sv) if (SvRV(sv) == SvRV(rv)) SvREFCNT_dec(SvRV(rv)); - else /* XXX: Not sure if the `else` condition are right - * Test_SvREFCNT() pass in all case. - */ + else // XXX: Not sure if the `else` condition are right + // Test_SvREFCNT() pass in all case. sv_setsv(sv, rv); return 0; diff --git a/src/version.c b/src/version.c index a0f7483093..66fabd95c7 100644 --- a/src/version.c +++ b/src/version.c @@ -793,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 203, /**/ 202, /**/ From 947b39e761b8a95cc1bd37ad0c2c30552238809a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 22 Jul 2018 19:36:37 +0200 Subject: [PATCH 28/31] patch 8.1.0204: inputlist() is not tested Problem: inputlist() is not tested. Solution: Add a test. (Dominique Pelle, closes #3240) --- src/testdir/test_functions.vim | 11 +++++++++++ src/version.c | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 5cfaaa0643..14181fb0a4 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -810,6 +810,17 @@ func Test_col() bw! endfunc +func Test_inputlist() + call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\1\", 'tx') + call assert_equal(1, c) + call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\2\", 'tx') + call assert_equal(2, c) + call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\3\", 'tx') + call assert_equal(3, c) + + call assert_fails('call inputlist("")', 'E686:') +endfunc + func Test_balloon_show() if has('balloon_eval') " This won't do anything but must not crash either. diff --git a/src/version.c b/src/version.c index 66fabd95c7..735ac0e9a0 100644 --- a/src/version.c +++ b/src/version.c @@ -793,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 204, /**/ 203, /**/ From 9cf4b5005f12ce1d6692266140bdda05d0312d79 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 23 Jul 2018 04:12:03 +0200 Subject: [PATCH 29/31] patch 8.1.0205: invalid memory access with invalid modeline Problem: Invalid memory access with invalid modeline. Solution: Pass pointer limit. Add a test. (closes #3241) --- src/Make_all.mak | 1 + src/option.c | 21 ++++++++++++--------- src/testdir/test_alot.vim | 1 + src/testdir/test_modeline.vim | 8 ++++++++ src/version.c | 2 ++ 5 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 src/testdir/test_modeline.vim diff --git a/src/Make_all.mak b/src/Make_all.mak index ef305033ef..9831f7b044 100644 --- a/src/Make_all.mak +++ b/src/Make_all.mak @@ -118,6 +118,7 @@ NEW_TESTS = \ test_messages \ test_mksession \ test_mksession_utf8 \ + test_modeline \ test_nested_function \ test_netbeans \ test_normal \ diff --git a/src/option.c b/src/option.c index 6d861837c4..f86b1b19c3 100644 --- a/src/option.c +++ b/src/option.c @@ -3316,7 +3316,7 @@ static char_u *set_bool_option(int opt_idx, char_u *varp, int value, int opt_fla static char_u *set_num_option(int opt_idx, char_u *varp, long value, char_u *errbuf, size_t errbuflen, int opt_flags); static void check_redraw(long_u flags); static int findoption(char_u *); -static int find_key_option(char_u *); +static int find_key_option(char_u *arg_arg, int has_lt); static void showoptions(int all, int opt_flags); static int optval_default(struct vimoption *, char_u *varp); static void showoneopt(struct vimoption *, int opt_flags); @@ -4492,7 +4492,7 @@ do_set( opt_idx = findoption(arg + 1); arg[len++] = '>'; /* restore '>' */ if (opt_idx == -1) - key = find_key_option(arg + 1); + key = find_key_option(arg + 1, TRUE); } else { @@ -4510,7 +4510,7 @@ do_set( opt_idx = findoption(arg); arg[len] = nextchar; /* restore nextchar */ if (opt_idx == -1) - key = find_key_option(arg); + key = find_key_option(arg, FALSE); } /* remember character after option name */ @@ -5362,7 +5362,7 @@ illegal_char(char_u *errbuf, int c) string_to_key(char_u *arg, int multi_byte) { if (*arg == '<') - return find_key_option(arg + 1); + return find_key_option(arg + 1, TRUE); if (*arg == '^') return Ctrl_chr(arg[1]); if (multi_byte) @@ -9541,7 +9541,7 @@ get_option_value( int key; if (STRLEN(name) == 4 && name[0] == 't' && name[1] == '_' - && (key = find_key_option(name)) != 0) + && (key = find_key_option(name, FALSE)) != 0) { char_u key_name[2]; char_u *p; @@ -9831,7 +9831,7 @@ set_option_value( int key; if (STRLEN(name) == 4 && name[0] == 't' && name[1] == '_' - && (key = find_key_option(name)) != 0) + && (key = find_key_option(name, FALSE)) != 0) { char_u key_name[2]; @@ -9952,12 +9952,15 @@ get_encoding_default(void) /* * Translate a string like "t_xx", "" or "" to a key number. + * When "has_lt" is true there is a '<' before "*arg_arg". + * Returns 0 when the key is not recognized. */ static int -find_key_option(char_u *arg) +find_key_option(char_u *arg_arg, int has_lt) { - int key; + int key = 0; int modifiers; + char_u *arg = arg_arg; /* * Don't use get_special_key_code() for t_xx, we don't want it to call @@ -9965,7 +9968,7 @@ find_key_option(char_u *arg) */ if (arg[0] == 't' && arg[1] == '_' && arg[2] && arg[3]) key = TERMCAP2KEY(arg[2], arg[3]); - else + else if (has_lt) { --arg; /* put arg at the '<' */ modifiers = 0; diff --git a/src/testdir/test_alot.vim b/src/testdir/test_alot.vim index ac3ca74f53..1465a7abfc 100644 --- a/src/testdir/test_alot.vim +++ b/src/testdir/test_alot.vim @@ -37,6 +37,7 @@ source test_mapping.vim source test_match.vim source test_menu.vim source test_messages.vim +source test_modeline.vim source test_partial.vim source test_popup.vim source test_put.vim diff --git a/src/testdir/test_modeline.vim b/src/testdir/test_modeline.vim new file mode 100644 index 0000000000..6e49577e0e --- /dev/null +++ b/src/testdir/test_modeline.vim @@ -0,0 +1,8 @@ +" Tests for parsing the modeline. + +func Test_invalid() + " This was reading before allocated memory. + call writefile(['vi:0', 'nothing'], 'Xmodeline') + call assert_fails('split Xmodeline', 'E518:') + bwipe! +endfunc diff --git a/src/version.c b/src/version.c index 735ac0e9a0..23fea92c69 100644 --- a/src/version.c +++ b/src/version.c @@ -793,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 205, /**/ 204, /**/ From cd96eef3a869557bd3d2d4497861d87cb525db06 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 23 Jul 2018 04:49:23 +0200 Subject: [PATCH 30/31] patch 8.1.0206: duplicate test function name Problem: Duplicate test function name. Solution: Rename both functions. --- src/testdir/test_glob2regpat.vim | 4 ++-- src/testdir/test_modeline.vim | 2 +- src/version.c | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/testdir/test_glob2regpat.vim b/src/testdir/test_glob2regpat.vim index fdf17946b6..e6e41f13e7 100644 --- a/src/testdir/test_glob2regpat.vim +++ b/src/testdir/test_glob2regpat.vim @@ -1,12 +1,12 @@ " Test glob2regpat() -func Test_invalid() +func Test_glob2regpat_invalid() call assert_fails('call glob2regpat(1.33)', 'E806:') call assert_fails('call glob2regpat("}")', 'E219:') call assert_fails('call glob2regpat("{")', 'E220:') endfunc -func Test_valid() +func Test_glob2regpat_valid() call assert_equal('^foo\.', glob2regpat('foo.*')) call assert_equal('^foo.$', glob2regpat('foo?')) call assert_equal('\.vim$', glob2regpat('*.vim')) diff --git a/src/testdir/test_modeline.vim b/src/testdir/test_modeline.vim index 6e49577e0e..e278c16132 100644 --- a/src/testdir/test_modeline.vim +++ b/src/testdir/test_modeline.vim @@ -1,6 +1,6 @@ " Tests for parsing the modeline. -func Test_invalid() +func Test_modeline_invalid() " This was reading before allocated memory. call writefile(['vi:0', 'nothing'], 'Xmodeline') call assert_fails('split Xmodeline', 'E518:') diff --git a/src/version.c b/src/version.c index 23fea92c69..36e2fcbc49 100644 --- a/src/version.c +++ b/src/version.c @@ -793,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 206, /**/ 205, /**/ From 68f1b1b37fa7aba985d9f8727fd9f0f3eb0c19a9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 23 Jul 2018 05:10:14 +0200 Subject: [PATCH 31/31] patch 8.1.0207: need many menu translation files to cover regions Problem: Need many menu translation files to cover regions. Solution: When there is no region match, try without. (Christian Brabandt) --- runtime/menu.vim | 7 +++++++ src/version.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/runtime/menu.vim b/runtime/menu.vim index b9bd3d89ca..b4c59dd92b 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -56,6 +56,13 @@ if exists("v:lang") || &langmenu != "" let s:lang = substitute(s:lang, '\.[^.]*', "", "") exe "runtime! lang/menu_" . s:lang . "[^a-z]*vim" + if !exists("did_menu_trans") && s:lang =~ '_' + " If the language includes a region try matching without that region. + " (e.g. find menu_de.vim if s:lang == de_DE). + let langonly = substitute(s:lang, '_.*', "", "") + exe "runtime! lang/menu_" . langonly . "[^a-z]*vim" + endif + if !exists("did_menu_trans") && strlen($LANG) > 1 && s:lang !~ '^en_us' " On windows locale names are complicated, try using $LANG, it might " have been set by set_init_1(). But don't do this for "en" or "en_us". diff --git a/src/version.c b/src/version.c index 36e2fcbc49..39ea6e2abd 100644 --- a/src/version.c +++ b/src/version.c @@ -793,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 207, /**/ 206, /**/