From 83ec2a7f5fb481b30a5d556b6aad49a62585bccd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 27 Jul 2018 22:08:59 +0200 Subject: [PATCH 01/17] patch 8.1.0214: +autochdir feature not reported by has() or :version Problem: +autochdir feature not reported by has() or :version. Solution: Add the feature in the list. --- src/evalfunc.c | 3 +++ src/version.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/evalfunc.c b/src/evalfunc.c index a9f6c5b8a6..23cdeb49ee 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -6045,6 +6045,9 @@ f_has(typval_T *argvars, typval_T *rettv) "arabic", #endif "autocmd", +#ifdef FEAT_AUTOCHDIR + "autochdir", +#endif #ifdef FEAT_AUTOSERVERNAME "autoservername", #endif diff --git a/src/version.c b/src/version.c index 830de26fcf..087bc63a11 100644 --- a/src/version.c +++ b/src/version.c @@ -101,6 +101,11 @@ static char *(features[]) = "-arabic", #endif "+autocmd", +#ifdef FEAT_AUTOCHDIR + "+autochdir", +#else + "-autochdir", +#endif #ifdef FEAT_AUTOSERVERNAME "+autoservername", #else @@ -793,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 214, /**/ 213, /**/ From d2a054910bf8f0888fac81e46a64a22dd4a763b5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 27 Jul 2018 22:35:15 +0200 Subject: [PATCH 02/17] patch 8.1.0215: no error if configure --with-x cannot configure X Problem: No error if configure --with-x cannot configure X. Solution: Check that when --with-x is used X can be configured. --- src/auto/configure | 6 ++++++ src/configure.ac | 8 ++++++++ src/version.c | 2 ++ 3 files changed, 16 insertions(+) diff --git a/src/auto/configure b/src/auto/configure index 1628b940e3..de1fd6059c 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -4466,6 +4466,8 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fail_if_missing" >&5 $as_echo "$fail_if_missing" >&6; } +with_x_arg="$with_x" + if test -z "$CFLAGS"; then CFLAGS="-O" test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" @@ -9003,6 +9005,10 @@ $as_echo "$ac_cv_small_wchar_t" >&6; } fi fi +if test "x$with_x" = xno -a "x$with_x_arg" = xyes; then + as_fn_error $? "could not configure X" "$LINENO" 5 +fi + test "x$with_x" = xno -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-gui argument" >&5 diff --git a/src/configure.ac b/src/configure.ac index 107c170ecb..0d8ea32d34 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -72,6 +72,9 @@ AC_ARG_ENABLE(fail_if_missing, [fail_if_missing="no"]) AC_MSG_RESULT($fail_if_missing) +dnl Keep original value to check later. +with_x_arg="$with_x" + dnl Set default value for CFLAGS if none is defined or it's empty if test -z "$CFLAGS"; then CFLAGS="-O" @@ -2283,6 +2286,11 @@ else fi fi +dnl Check if --with-x was given but it doesn't work. +if test "x$with_x" = xno -a "x$with_x_arg" = xyes; then + AC_MSG_ERROR([could not configure X]) +fi + test "x$with_x" = xno -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no AC_MSG_CHECKING(--enable-gui argument) diff --git a/src/version.c b/src/version.c index 087bc63a11..172748b472 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 215, /**/ 214, /**/ From 8e85db0376604274bccf12bf5859d92b4192aca1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 27 Jul 2018 23:16:51 +0200 Subject: [PATCH 03/17] patch 8.1.0216: part of file not indented properly Problem: Part of file not indented properly. Solution: Adjust the indent. (Ken Takata) --- src/getchar.c | 16 ++++++++-------- src/version.c | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/getchar.c b/src/getchar.c index cc43ef24a6..496e33fa86 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -1710,18 +1710,18 @@ vgetc(void) * its ASCII equivalent */ switch (c) { - case K_KPLUS: c = '+'; break; - case K_KMINUS: c = '-'; break; - case K_KDIVIDE: c = '/'; break; + case K_KPLUS: c = '+'; break; + case K_KMINUS: c = '-'; break; + case K_KDIVIDE: c = '/'; break; case K_KMULTIPLY: c = '*'; break; - case K_KENTER: c = CAR; break; + case K_KENTER: c = CAR; break; case K_KPOINT: #ifdef WIN32 - /* Can be either '.' or a ',', * - * depending on the type of keypad. */ - c = MapVirtualKey(VK_DECIMAL, 2); break; + // Can be either '.' or a ',', + // depending on the type of keypad. + c = MapVirtualKey(VK_DECIMAL, 2); break; #else - c = '.'; break; + c = '.'; break; #endif case K_K0: c = '0'; break; case K_K1: c = '1'; break; diff --git a/src/version.c b/src/version.c index 172748b472..0d0a2b2866 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 216, /**/ 215, /**/ From fd249460fe600dba479bca03058e679bae6b5d52 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jul 2018 16:14:30 +0200 Subject: [PATCH 04/17] patch 8.1.0217: compiler warning for variable set but not used Problem: Compiler warning for variable set but not used. Solution: Move tilde_file inside #ifdef. (Hirohito Higashi, closes #3255) --- src/ex_docmd.c | 6 +++++- src/version.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 0094cdba7d..4c653ff5e6 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -10654,9 +10654,9 @@ eval_vars( int resultlen; buf_T *buf; int valid = VALID_HEAD + VALID_PATH; /* assume valid result */ - int tilde_file = FALSE; int spec_idx; #ifdef FEAT_MODIFY_FNAME + int tilde_file = FALSE; int skip_mod = FALSE; #endif char_u strbuf[30]; @@ -10723,7 +10723,9 @@ eval_vars( else { result = curbuf->b_fname; +#ifdef FEAT_MODIFY_FNAME tilde_file = STRCMP(result, "~") == 0; +#endif } break; @@ -10790,7 +10792,9 @@ eval_vars( else { result = buf->b_fname; +#ifdef FEAT_MODIFY_FNAME tilde_file = STRCMP(result, "~") == 0; +#endif } } break; diff --git a/src/version.c b/src/version.c index 0d0a2b2866..dd9e1d4825 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 217, /**/ 216, /**/ From 95e51470f10e1ddcc4b2ce53e4f7ff7aa2e58417 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jul 2018 16:55:56 +0200 Subject: [PATCH 05/17] patch 8.1.0218: cannot add matches to another window Problem: Cannot add matches to another window. (Qiming Zhao) Solution: Add the "window" argument to matchadd() and matchaddpos(). (closes #3260) --- runtime/doc/eval.txt | 4 ++- src/evalfunc.c | 67 +++++++++++++++++++++++--------------- src/testdir/test_match.vim | 22 +++++++++++++ src/version.c | 2 ++ 4 files changed, 68 insertions(+), 27 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e665c3573f..fb9093e1c5 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -6016,7 +6016,7 @@ match({expr}, {pat} [, {start} [, {count}]]) *match()* the pattern. 'smartcase' is NOT used. The matching is always done like 'magic' is set and 'cpoptions' is empty. - *matchadd()* *E798* *E799* *E801* + *matchadd()* *E798* *E799* *E801* *E957* matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) Defines a pattern to be highlighted in the current window (a "match"). It will be highlighted with {group}. Returns an @@ -6055,6 +6055,8 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]]) conceal Special character to show instead of the match (only for |hl-Conceal| highlighted matches, see |:syn-cchar|) + window Instead of the current window use the + window with this number or window ID. The number of matches is not limited, as it is the case with the |:match| commands. diff --git a/src/evalfunc.c b/src/evalfunc.c index 23cdeb49ee..12eac8d548 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -7988,6 +7988,36 @@ f_match(typval_T *argvars, typval_T *rettv) find_some_match(argvars, rettv, MATCH_MATCH); } +#ifdef FEAT_SEARCH_EXTRA + static int +matchadd_dict_arg(typval_T *tv, char_u **conceal_char, win_T **win) +{ + dictitem_T *di; + + if (tv->v_type != VAR_DICT) + { + EMSG(_(e_dictreq)); + return FAIL; + } + + if (dict_find(tv->vval.v_dict, (char_u *)"conceal", -1) != NULL) + *conceal_char = get_dict_string(tv->vval.v_dict, + (char_u *)"conceal", FALSE); + + if ((di = dict_find(tv->vval.v_dict, (char_u *)"window", -1)) != NULL) + { + *win = find_win_by_nr(&di->di_tv, NULL); + if (*win == NULL) + { + EMSG(_("E957: Invalid window number")); + return FAIL; + } + } + + return OK; +} +#endif + /* * "matchadd()" function */ @@ -8002,6 +8032,7 @@ f_matchadd(typval_T *argvars UNUSED, typval_T *rettv UNUSED) int id = -1; int error = FALSE; char_u *conceal_char = NULL; + win_T *win = curwin; rettv->vval.v_number = -1; @@ -8013,18 +8044,9 @@ f_matchadd(typval_T *argvars UNUSED, typval_T *rettv UNUSED) if (argvars[3].v_type != VAR_UNKNOWN) { id = (int)get_tv_number_chk(&argvars[3], &error); - if (argvars[4].v_type != VAR_UNKNOWN) - { - if (argvars[4].v_type != VAR_DICT) - { - EMSG(_(e_dictreq)); - return; - } - if (dict_find(argvars[4].vval.v_dict, - (char_u *)"conceal", -1) != NULL) - conceal_char = get_dict_string(argvars[4].vval.v_dict, - (char_u *)"conceal", FALSE); - } + if (argvars[4].v_type != VAR_UNKNOWN + && matchadd_dict_arg(&argvars[4], &conceal_char, &win) == FAIL) + return; } } if (error == TRUE) @@ -8035,7 +8057,7 @@ f_matchadd(typval_T *argvars UNUSED, typval_T *rettv UNUSED) return; } - rettv->vval.v_number = match_add(curwin, grp, pat, prio, id, NULL, + rettv->vval.v_number = match_add(win, grp, pat, prio, id, NULL, conceal_char); #endif } @@ -8054,6 +8076,7 @@ f_matchaddpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED) int error = FALSE; list_T *l; char_u *conceal_char = NULL; + win_T *win = curwin; rettv->vval.v_number = -1; @@ -8076,18 +8099,10 @@ f_matchaddpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED) if (argvars[3].v_type != VAR_UNKNOWN) { id = (int)get_tv_number_chk(&argvars[3], &error); - if (argvars[4].v_type != VAR_UNKNOWN) - { - if (argvars[4].v_type != VAR_DICT) - { - EMSG(_(e_dictreq)); - return; - } - if (dict_find(argvars[4].vval.v_dict, - (char_u *)"conceal", -1) != NULL) - conceal_char = get_dict_string(argvars[4].vval.v_dict, - (char_u *)"conceal", FALSE); - } + + if (argvars[4].v_type != VAR_UNKNOWN + && matchadd_dict_arg(&argvars[4], &conceal_char, &win) == FAIL) + return; } } if (error == TRUE) @@ -8100,7 +8115,7 @@ f_matchaddpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED) return; } - rettv->vval.v_number = match_add(curwin, group, NULL, prio, id, l, + rettv->vval.v_number = match_add(win, group, NULL, prio, id, l, conceal_char); #endif } diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 28dd97c923..70f049099f 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -192,6 +192,28 @@ func Test_matchaddpos() set hlsearch& endfunc +func Test_matchaddpos_otherwin() + syntax on + new + call setline(1, ['12345', 'NP']) + let winid = win_getid() + + wincmd w + call matchadd('Search', '4', 10, -1, {'window': winid}) + call matchaddpos('Error', [[1,2], [2,2]], 10, -1, {'window': winid}) + redraw! + call assert_notequal(screenattr(1,2), 0) + call assert_notequal(screenattr(1,4), 0) + call assert_notequal(screenattr(2,2), 0) + call assert_equal(screenattr(1,2), screenattr(2,2)) + call assert_notequal(screenattr(1,2), screenattr(1,4)) + + wincmd w + bwipe! + call clearmatches() + syntax off +endfunc + func Test_matchaddpos_using_negative_priority() set hlsearch diff --git a/src/version.c b/src/version.c index dd9e1d4825..cf7fa29ce6 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 218, /**/ 217, /**/ From 2c8c681bfcd5138a0ec8ce018216dc2dc69a11a0 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jul 2018 17:07:52 +0200 Subject: [PATCH 06/17] patch 8.1.0219: expanding ## fails to escape backtick Problem: Expanding ## fails to escape backtick. Solution: Escape a backtick in a file name. (closes #3257) --- src/ex_docmd.c | 2 +- src/testdir/test_edit.vim | 8 ++++++++ src/version.c | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 4c653ff5e6..54fb6aba1c 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -10954,7 +10954,7 @@ arg_all(void) #ifndef BACKSLASH_IN_FILENAME || *p == '\\' #endif - ) + || *p == '`') { /* insert a backslash */ if (retval != NULL) diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim index ab2fe7c824..651f1f8fa4 100644 --- a/src/testdir/test_edit.vim +++ b/src/testdir/test_edit.vim @@ -1375,6 +1375,14 @@ func Test_edit_complete_very_long_name() set swapfile& endfunc +func Test_edit_backtick() + next a\`b c + call assert_equal('a`b', expand('%')) + next + call assert_equal('c', expand('%')) + call assert_equal('a\`b c', expand('##')) +endfunc + func Test_edit_quit() edit foo.txt split diff --git a/src/version.c b/src/version.c index cf7fa29ce6..4ea5c75bf9 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 219, /**/ 218, /**/ From d84b26a03b13cd816d80ff32b61e8de740d499ce Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jul 2018 17:18:09 +0200 Subject: [PATCH 07/17] patch 8.1.0220: Ruby converts v:true and v:false to a number Problem: Ruby converts v:true and v:false to a number. Solution: Use Qtrue and Qfalse instead. (Masataka Pocke Kuwabara, closes #3259) --- src/if_ruby.c | 6 ++++-- src/testdir/test_ruby.vim | 8 ++++++++ src/version.c | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/if_ruby.c b/src/if_ruby.c index 4b9af318d2..2e1f8d75ae 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -1085,8 +1085,10 @@ static VALUE vim_to_ruby(typval_T *tv) } else if (tv->v_type == VAR_SPECIAL) { - if (tv->vval.v_number <= VVAL_TRUE) - result = INT2NUM(tv->vval.v_number); + if (tv->vval.v_number == VVAL_TRUE) + result = Qtrue; + else if (tv->vval.v_number == VVAL_FALSE) + result = Qfalse; } /* else return Qnil; */ return result; diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim index ae27b39cd3..36442fcbca 100644 --- a/src/testdir/test_ruby.vim +++ b/src/testdir/test_ruby.vim @@ -33,6 +33,14 @@ func Test_ruby_evaluate_dict() call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, "\n")) endfunc +func Test_ruby_evaluate_special_var() + let l = [v:true, v:false, v:null, v:none] + redir => l:out + ruby d = Vim.evaluate("l"); print d + redir END + call assert_equal(['[true, false, nil, nil]'], split(l:out, "\n")) +endfunc + func Test_rubydo() " Check deleting lines does not trigger ml_get error. new diff --git a/src/version.c b/src/version.c index 4ea5c75bf9..d69a8c73d6 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 220, /**/ 219, /**/ From edd6aacb010ad2402fc98f19e7f6b7c29ba2656f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jul 2018 17:29:19 +0200 Subject: [PATCH 08/17] patch 8.1.0221: not enough testing for the Ruby interface Problem: Not enough testing for the Ruby interface. Solution: Add more tests. (Dominique Pelle, closes #3252) --- runtime/doc/if_ruby.txt | 3 +- src/testdir/test_ruby.vim | 350 ++++++++++++++++++++++++++++++++++---- src/version.c | 2 + 3 files changed, 322 insertions(+), 33 deletions(-) diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt index 1b4fd40f3c..572a6ec15e 100644 --- a/runtime/doc/if_ruby.txt +++ b/runtime/doc/if_ruby.txt @@ -145,7 +145,7 @@ self[{n}] Returns the buffer object for the number {n}. The first number Methods: -name Returns the name of the buffer. +name Returns the full name of the buffer. number Returns the number of the buffer. count Returns the number of lines. length Returns the number of lines. @@ -181,6 +181,7 @@ height = {n} Sets the window height to {n}. width Returns the width of the window. width = {n} Sets the window width to {n}. cursor Returns a [row, col] array for the cursor position. + First line number is 1 and first column number is 0. cursor = [{row}, {col}] Sets the cursor position to {row} and {col}. diff --git a/src/testdir/test_ruby.vim b/src/testdir/test_ruby.vim index 36442fcbca..8d7943e176 100644 --- a/src/testdir/test_ruby.vim +++ b/src/testdir/test_ruby.vim @@ -4,6 +4,13 @@ if !has('ruby') finish end +" Helper function as there is no builtin rubyeval() function similar +" to perleval, luaevel() or pyeval(). +func RubyEval(ruby_expr) + let s = split(execute('ruby print ' . a:ruby_expr), "\n") + return (len(s) == 0) ? '' : s[-1] +endfunc + func Test_ruby_change_buffer() call setline(line('$'), ['1 line 1']) ruby Vim.command("normal /^1\n") @@ -11,36 +18,6 @@ func Test_ruby_change_buffer() call assert_equal('1 changed line 1', getline('$')) endfunc -func Test_ruby_evaluate_list() - call setline(line('$'), ['2 line 2']) - ruby Vim.command("normal /^2\n") - let l = ["abc", "def"] - ruby << EOF - curline = $curbuf.line_number - l = Vim.evaluate("l"); - $curbuf.append(curline, l.join("\n")) -EOF - normal j - .rubydo $_ = $_.gsub(/\n/, '/') - call assert_equal('abc/def', getline('$')) -endfunc - -func Test_ruby_evaluate_dict() - let d = {'a': 'foo', 'b': 123} - redir => l:out - ruby d = Vim.evaluate("d"); print d - redir END - call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, "\n")) -endfunc - -func Test_ruby_evaluate_special_var() - let l = [v:true, v:false, v:null, v:none] - redir => l:out - ruby d = Vim.evaluate("l"); print d - redir END - call assert_equal(['[true, false, nil, nil]'], split(l:out, "\n")) -endfunc - func Test_rubydo() " Check deleting lines does not trigger ml_get error. new @@ -54,8 +31,7 @@ func Test_rubydo() call setline(1, ['one', 'two', 'three']) rubydo Vim.command("new") call assert_equal(wincount + 1, winnr('$')) - bwipe! - bwipe! + %bwipe! endfunc func Test_rubyfile() @@ -73,8 +49,318 @@ func Test_set_cursor() normal gg rubydo $curwin.cursor = [1, 5] call assert_equal([1, 6], [line('.'), col('.')]) + call assert_equal('[1, 5]', RubyEval('$curwin.cursor')) " Check that movement after setting cursor position keeps current column. normal j call assert_equal([2, 6], [line('.'), col('.')]) + call assert_equal('[2, 5]', RubyEval('$curwin.cursor')) + + call assert_fails('ruby $curwin.cursor = [1]', + \ 'ArgumentError: array length must be 2') + bwipe! +endfunc + +" Test buffer.count and buffer.length (number of lines in buffer) +func Test_buffer_count() + new + call setline(1, ['one', 'two', 'three']) + call assert_equal('3', RubyEval('$curbuf.count')) + call assert_equal('3', RubyEval('$curbuf.length')) + bwipe! +endfunc + +" Test buffer.name (buffer name) +func Test_buffer_name() + new Xfoo + call assert_equal(expand('%:p'), RubyEval('$curbuf.name')) + bwipe + call assert_equal('', RubyEval('$curbuf.name')) +endfunc + +" Test buffer.number (number of the buffer). +func Test_buffer_number() + new + call assert_equal(string(bufnr('%')), RubyEval('$curbuf.number')) + new + call assert_equal(string(bufnr('%')), RubyEval('$curbuf.number')) + + %bwipe +endfunc + +" Test buffer.delete({n}) (delete line {n}) +func Test_buffer_delete() + new + call setline(1, ['one', 'two', 'three']) + ruby $curbuf.delete(2) + call assert_equal(['one', 'three'], getline(1, '$')) + + call assert_fails('ruby $curbuf.delete(0)', 'IndexError: line number 0 out of range') + call assert_fails('ruby $curbuf.delete(3)', 'IndexError: line number 3 out of range') + + bwipe! +endfunc + +" Test buffer.append({str}, str) (append line {str} after line {n}) +func Test_buffer_append() + new + ruby $curbuf.append(0, 'one') + ruby $curbuf.append(1, 'three') + ruby $curbuf.append(1, 'two') + ruby $curbuf.append(4, 'four') + + call assert_equal(['one', 'two', 'three', '', 'four'], getline(1, '$')) + + call assert_fails('ruby $curbuf.append(-1, "x")', + \ 'IndexError: line number -1 out of range') + call assert_fails('ruby $curbuf.append(6, "x")', + \ 'IndexError: line number 6 out of range') + + bwipe! +endfunc + +" Test buffer.line (get or set the current line) +func Test_buffer_line() + new + call setline(1, ['one', 'two', 'three']) + 2 + call assert_equal('two', RubyEval('$curbuf.line')) + + ruby $curbuf.line = 'TWO' + call assert_equal(['one', 'TWO', 'three'], getline(1, '$')) + + bwipe! +endfunc + +" Test buffer.line_number (get current line number) +func Test_buffer_line_number() + new + call setline(1, ['one', 'two', 'three']) + 2 + call assert_equal('2', RubyEval('$curbuf.line_number')) + + bwipe! +endfunc + +func Test_buffer_get() + new + call setline(1, ['one', 'two']) + call assert_equal('one', RubyEval('$curbuf[1]')) + call assert_equal('two', RubyEval('$curbuf[2]')) + + call assert_fails('ruby $curbuf[0]', + \ 'IndexError: line number 0 out of range') + call assert_fails('ruby $curbuf[3]', + \ 'IndexError: line number 3 out of range') + + bwipe! +endfunc + +func Test_buffer_set() + new + call setline(1, ['one', 'two']) + ruby $curbuf[2] = 'TWO' + ruby $curbuf[1] = 'ONE' + + call assert_fails('ruby $curbuf[0] = "ZERO"', + \ 'IndexError: line number 0 out of range') + call assert_fails('ruby $curbuf[3] = "THREE"', + \ 'IndexError: line number 3 out of range') + bwipe! +endfunc + +" Test window.width (get or set window height). +func Test_window_height() + new + + " Test setting window height + ruby $curwin.height = 2 + call assert_equal(2, winheight(0)) + + " Test getting window height + call assert_equal('2', RubyEval('$curwin.height')) + + bwipe +endfunc + +" Test window.width (get or set window width). +func Test_window_width() + vnew + + " Test setting window width + ruby $curwin.width = 2 + call assert_equal(2, winwidth(0)) + + " Test getting window width + call assert_equal('2', RubyEval('$curwin.width')) + + bwipe +endfunc + +" Test window.buffer (get buffer object of a window object). +func Test_window_buffer() + new Xfoo1 + new Xfoo2 + ruby $b2 = $curwin.buffer + ruby $w2 = $curwin + wincmd j + ruby $b1 = $curwin.buffer + ruby $w1 = $curwin + + call assert_equal(RubyEval('$b1'), RubyEval('$w1.buffer')) + call assert_equal(RubyEval('$b2'), RubyEval('$w2.buffer')) + call assert_equal(string(bufnr('Xfoo1')), RubyEval('$w1.buffer.number')) + call assert_equal(string(bufnr('Xfoo2')), RubyEval('$w2.buffer.number')) + + ruby $b1, $w1, $b2, $w2 = nil + %bwipe +endfunc + +" Test Vim::Window.current (get current window object) +func Test_Vim_window_current() + let cw = RubyEval('$curwin') + call assert_equal(cw, RubyEval('Vim::Window.current')) + call assert_match('^#$', cw) +endfunc + +" Test Vim::Window.count (number of windows) +func Test_Vim_window_count() + new Xfoo1 + new Xfoo2 + split + call assert_equal('4', RubyEval('Vim::Window.count')) + %bwipe + call assert_equal('1', RubyEval('Vim::Window.count')) +endfunc + +" Test Vim::Window[n] (get window object of window n) +func Test_Vim_window_get() + new Xfoo1 + new Xfoo2 + call assert_match('Xfoo2$', RubyEval('Vim::Window[0].buffer.name')) + wincmd j + call assert_match('Xfoo1$', RubyEval('Vim::Window[1].buffer.name')) + wincmd j + call assert_equal('', RubyEval('Vim::Window[2].buffer.name')) + %bwipe +endfunc + +" Test Vim::Buffer.current (return the buffer object of current buffer) +func Test_Vim_buffer_current() + let cb = RubyEval('$curbuf') + call assert_equal(cb, RubyEval('Vim::Buffer.current')) + call assert_match('^#$', cb) +endfunc + +" Test Vim::Buffer:.count (return the number of buffers) +func Test_Vim_buffer_count() + new Xfoo1 + new Xfoo2 + call assert_equal('3', RubyEval('Vim::Buffer.count')) + %bwipe + call assert_equal('1', RubyEval('Vim::Buffer.count')) +endfunc + +" Test Vim::buffer[n] (return the buffer object of buffer number n) +func Test_Vim_buffer_get() + new Xfoo1 + new Xfoo2 + + " Index of Vim::Buffer[n] goes from 0 to the number of buffers. + call assert_equal('', RubyEval('Vim::Buffer[0].name')) + call assert_match('Xfoo1$', RubyEval('Vim::Buffer[1].name')) + call assert_match('Xfoo2$', RubyEval('Vim::Buffer[2].name')) + call assert_fails('ruby print Vim::Buffer[3].name', + \ "NoMethodError: undefined method `name' for nil:NilClass") + %bwipe +endfunc + +" Test Vim::command({cmd}) (execute a Ex command)) +" Test Vim::command({cmd}) +func Test_Vim_command() + new + call setline(1, ['one', 'two', 'three', 'four']) + ruby Vim::command('2,3d') + call assert_equal(['one', 'four'], getline(1, '$')) + bwipe! +endfunc + +" Test Vim::set_option (set a vim option) +func Test_Vim_set_option() + call assert_equal(0, &number) + ruby Vim::set_option('number') + call assert_equal(1, &number) + ruby Vim::set_option('nonumber') + call assert_equal(0, &number) +endfunc + +func Test_Vim_evaluate() + call assert_equal('123', RubyEval('Vim::evaluate("123")')) + " Vim::evaluate("123").class gives Integer or Fixnum depending + " on versions of Ruby. + call assert_match('^Integer\|Fixnum$', RubyEval('Vim::evaluate("123").class')) + + call assert_equal('1.23', RubyEval('Vim::evaluate("1.23")')) + call assert_equal('Float', RubyEval('Vim::evaluate("1.23").class')) + + call assert_equal('foo', RubyEval('Vim::evaluate("\"foo\"")')) + call assert_equal('String', RubyEval('Vim::evaluate("\"foo\"").class')) + + call assert_equal('[1, 2]', RubyEval('Vim::evaluate("[1, 2]")')) + call assert_equal('Array', RubyEval('Vim::evaluate("[1, 2]").class')) + + call assert_equal('{"1"=>2}', RubyEval('Vim::evaluate("{1:2}")')) + call assert_equal('Hash', RubyEval('Vim::evaluate("{1:2}").class')) + + call assert_equal('', RubyEval('Vim::evaluate("v:null")')) + call assert_equal('NilClass', RubyEval('Vim::evaluate("v:null").class')) + + call assert_equal('', RubyEval('Vim::evaluate("v:none")')) + call assert_equal('NilClass', RubyEval('Vim::evaluate("v:none").class')) + + call assert_equal('true', RubyEval('Vim::evaluate("v:true")')) + call assert_equal('TrueClass', RubyEval('Vim::evaluate("v:true").class')) + call assert_equal('false', RubyEval('Vim::evaluate("v:false")')) + call assert_equal('FalseClass',RubyEval('Vim::evaluate("v:false").class')) +endfunc + +func Test_Vim_evaluate_list() + call setline(line('$'), ['2 line 2']) + ruby Vim.command("normal /^2\n") + let l = ["abc", "def"] + ruby << EOF + curline = $curbuf.line_number + l = Vim.evaluate("l"); + $curbuf.append(curline, l.join("\n")) +EOF + normal j + .rubydo $_ = $_.gsub(/\n/, '/') + call assert_equal('abc/def', getline('$')) +endfunc + +func Test_Vim_evaluate_dict() + let d = {'a': 'foo', 'b': 123} + redir => l:out + ruby d = Vim.evaluate("d"); print d + redir END + call assert_equal(['{"a"=>"foo", "b"=>123}'], split(l:out, "\n")) +endfunc + +" Test Vim::message({msg}) (display message {msg}) +func Test_Vim_message() + ruby Vim::message('A message') + let messages = split(execute('message'), "\n") + call assert_equal('A message', messages[-1]) +endfunc + +func Test_print() + ruby print "Hello World!" + let messages = split(execute('message'), "\n") + call assert_equal('Hello World!', messages[-1]) +endfunc + +func Test_p() + ruby p 'Just a test' + let messages = split(execute('message'), "\n") + call assert_equal('"Just a test"', messages[-1]) endfunc diff --git a/src/version.c b/src/version.c index d69a8c73d6..23952a0b22 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 221, /**/ 220, /**/ From 73b4abae5d47fe7e8b5829aaa0abe5b1eac8a408 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jul 2018 18:16:48 +0200 Subject: [PATCH 09/17] patch 8.1.0222: errors are reported for "make install" Problem: Errors are reported for "make install". Solution: Skip missing language files. (Christian Brabandt, closes #3254) --- src/installman.sh | 68 ++++++++++++++++++++++++++--------------------- src/version.c | 2 ++ 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/src/installman.sh b/src/installman.sh index a2f09ad35e..23fc32568b 100755 --- a/src/installman.sh +++ b/src/installman.sh @@ -48,41 +48,49 @@ fi if test $what = "install"; then # vim.1 - echo installing $destdir/$exename.1 - LC_ALL=C sed -e s+/usr/local/lib/vim+$vimloc+ \ - -e s+$vimloc/doc+$helpsubloc+ \ - -e s+$vimloc/print+$printsubloc+ \ - -e s+$vimloc/syntax+$synsubloc+ \ - -e s+$vimloc/tutor+$tutorsubloc+ \ - -e s+$vimloc/vimrc+$vimrcloc/vimrc+ \ - -e s+$vimloc/gvimrc+$vimrcloc/gvimrc+ \ - -e s+$vimloc/menu.vim+$scriptloc/menu.vim+ \ - -e s+$vimloc/bugreport.vim+$scriptloc/bugreport.vim+ \ - -e s+$vimloc/filetype.vim+$scriptloc/filetype.vim+ \ - -e s+$vimloc/scripts.vim+$scriptloc/scripts.vim+ \ - -e s+$vimloc/optwin.vim+$scriptloc/optwin.vim+ \ - -e 's+$vimloc/\*.ps+$scriptloc/\*.ps+' \ - $helpsource/vim$langadd.1 > $destdir/$exename.1 - chmod $manmod $destdir/$exename.1 + if test -r $helpsource/vim$langadd.1; then + echo installing $destdir/$exename.1 + LC_ALL=C sed -e s+/usr/local/lib/vim+$vimloc+ \ + -e s+$vimloc/doc+$helpsubloc+ \ + -e s+$vimloc/print+$printsubloc+ \ + -e s+$vimloc/syntax+$synsubloc+ \ + -e s+$vimloc/tutor+$tutorsubloc+ \ + -e s+$vimloc/vimrc+$vimrcloc/vimrc+ \ + -e s+$vimloc/gvimrc+$vimrcloc/gvimrc+ \ + -e s+$vimloc/menu.vim+$scriptloc/menu.vim+ \ + -e s+$vimloc/bugreport.vim+$scriptloc/bugreport.vim+ \ + -e s+$vimloc/filetype.vim+$scriptloc/filetype.vim+ \ + -e s+$vimloc/scripts.vim+$scriptloc/scripts.vim+ \ + -e s+$vimloc/optwin.vim+$scriptloc/optwin.vim+ \ + -e 's+$vimloc/\*.ps+$scriptloc/\*.ps+' \ + $helpsource/vim$langadd.1 > $destdir/$exename.1 + chmod $manmod $destdir/$exename.1 + fi # vimtutor.1 - echo installing $destdir/$exename""tutor.1 - LC_ALL=C sed -e s+/usr/local/lib/vim+$vimloc+ \ - -e s+$vimloc/tutor+$tutorsubloc+ \ - $helpsource/vimtutor$langadd.1 > $destdir/$exename""tutor.1 - chmod $manmod $destdir/$exename""tutor.1 + if test -r $helpsource/vimtutor$langadd.1; then + echo installing $destdir/$exename""tutor.1 + LC_ALL=C sed -e s+/usr/local/lib/vim+$vimloc+ \ + -e s+$vimloc/tutor+$tutorsubloc+ \ + $helpsource/vimtutor$langadd.1 > $destdir/$exename""tutor.1 + chmod $manmod $destdir/$exename""tutor.1 + fi # vimdiff.1 - echo installing $destdir/$vimdiffname.1 - cp $helpsource/vimdiff$langadd.1 $destdir/$vimdiffname.1 - chmod $manmod $destdir/$vimdiffname.1 + if test -r $helpsource/vimdiff$langadd.1; then + echo installing $destdir/$vimdiffname.1 + cp $helpsource/vimdiff$langadd.1 $destdir/$vimdiffname.1 + chmod $manmod $destdir/$vimdiffname.1 + fi # evim.1 - echo installing $destdir/$evimname.1 - LC_ALL=C sed -e s+/usr/local/lib/vim+$vimloc+ \ - -e s+$vimloc/evim.vim+$scriptloc/evim.vim+ \ - $helpsource/evim$langadd.1 > $destdir/$evimname.1 - chmod $manmod $destdir/$evimname.1 + if test -r $helpsource/evim$langadd.1; then + echo installing $destdir/$evimname.1 + LC_ALL=C sed -e s+/usr/local/lib/vim+$vimloc+ \ + -e s+$vimloc/evim.vim+$scriptloc/evim.vim+ \ + $helpsource/evim$langadd.1 > $destdir/$evimname.1 + chmod $manmod $destdir/$evimname.1 + fi fi if test $what = "uninstall"; then @@ -105,7 +113,7 @@ if test $what = "uninstall"; then fi fi -if test $what = "xxd"; then +if test $what = "xxd" -a -r "$helpsource/xxd${langadd}.1"; then echo installing $destdir/xxd.1 cp $helpsource/xxd$langadd.1 $destdir/xxd.1 chmod $manmod $destdir/xxd.1 diff --git a/src/version.c b/src/version.c index 23952a0b22..968ff96ad4 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 222, /**/ 221, /**/ From 6ab9e429da18f4d784222a9f7dfafb7c0218b7eb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jul 2018 19:20:13 +0200 Subject: [PATCH 10/17] patch 8.1.0223: completing shell command finds sub-directories in $PATH Problem: Completing shell command finds sub-directories in $PATH. Solution: Remove EW_DIR when completing an item in $PATH. (Jason Franklin) --- src/ex_getln.c | 29 +++++++++++++++++------------ src/testdir/test_cmdline.vim | 25 ++++++++++++++++++++++++- src/version.c | 2 ++ 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/ex_getln.c b/src/ex_getln.c index 063900a388..e659c1a8c2 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -5193,16 +5193,6 @@ expand_shellcmd( hash_init(&found_ht); for (s = path; ; s = e) { - if (*s == NUL) - { - if (did_curdir) - break; - /* Find directories in the current directory, path is empty. */ - did_curdir = TRUE; - } - else if (*s == '.') - did_curdir = TRUE; - #if defined(MSWIN) e = vim_strchr(s, ';'); #else @@ -5211,6 +5201,23 @@ expand_shellcmd( if (e == NULL) e = s + STRLEN(s); + if (*s == NUL) + { + if (did_curdir) + break; + // Find directories in the current directory, path is empty. + did_curdir = TRUE; + flags |= EW_DIR; + } + else if (STRNCMP(s, ".", (int)(e - s)) == 0) + { + did_curdir = TRUE; + flags |= EW_DIR; + } + else + // Do not match directories inside a $PATH item. + flags &= ~EW_DIR; + l = e - s; if (l > MAXPATHL - 5) break; @@ -5266,8 +5273,6 @@ expand_shellcmd( # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) -static void * call_user_expand_func(void *(*user_expand_func)(char_u *, int, typval_T *, int), expand_T *xp, int *num_file, char_u ***file); - /* * Call "user_expand_func()" to invoke a user defined Vim script function and * return the result (either a string or a List). diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 26d33d8384..f42d228e29 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -231,7 +231,7 @@ func Test_getcompletion() call assert_equal([], l) let l = getcompletion('.', 'shellcmd') - call assert_equal(['./', '../'], l[0:1]) + call assert_equal(['./', '../'], filter(l, 'v:val =~ "\\./"')) call assert_equal(-1, match(l[2:], '^\.\.\?/$')) let root = has('win32') ? 'C:\\' : '/' let l = getcompletion(root, 'shellcmd') @@ -290,6 +290,29 @@ func Test_getcompletion() call assert_fails('call getcompletion("", "burp")', 'E475:') endfunc +func Test_shellcmd_completion() + let save_path = $PATH + + call mkdir('Xpathdir/Xpathsubdir', 'p') + call writefile([''], 'Xpathdir/Xfile.exe') + call setfperm('Xpathdir/Xfile.exe', 'rwx------') + + " Set PATH to example directory without trailing slash. + let $PATH = getcwd() . '/Xpathdir' + + " Test for the ":!" case. Previously, this would include subdirs of + " dirs in the PATH, even though they won't be executed. We check that only + " subdirs of the PWD and executables from the PATH are included in the + " suggestions. + let actual = getcompletion('X', 'shellcmd') + let expected = map(filter(glob('*', 0, 1), 'isdirectory(v:val) && v:val[0] == "X"'), 'v:val . "/"') + call insert(expected, 'Xfile.exe') + call assert_equal(expected, actual) + + call delete('Xpathdir', 'rf') + let $PATH = save_path +endfunc + func Test_expand_star_star() call mkdir('a/b', 'p') call writefile(['asdfasdf'], 'a/b/fileXname') diff --git a/src/version.c b/src/version.c index 968ff96ad4..e646a2b432 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 223, /**/ 222, /**/ From fdd7155fab3447b38280035c66178330f8f041e7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 28 Jul 2018 23:12:05 +0200 Subject: [PATCH 11/17] patch 8.1.0224: hang in bracketed paste mode when t_PE not encountered Problem: Hang in bracketed paste mode when t_PE not encountered. Solution: Break out of the loop when got_int is set. (suggested by Christian Brabandt, closes #3146) --- src/edit.c | 23 ++++++++++++++++------- src/version.c | 2 ++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/edit.c b/src/edit.c index 657bd2c864..e121506239 100644 --- a/src/edit.c +++ b/src/edit.c @@ -9685,22 +9685,31 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) int ret_char = -1; int save_allow_keys = allow_keys; int save_paste = p_paste; - int save_ai = curbuf->b_p_ai; /* If the end code is too long we can't detect it, read everything. */ if (STRLEN(end) >= NUMBUFLEN) end = NULL; ++no_mapping; allow_keys = 0; - p_paste = TRUE; - curbuf->b_p_ai = FALSE; + if (!p_paste) + // Also have the side effects of setting 'paste' to make it work much + // faster. + set_option_value((char_u *)"paste", TRUE, NULL, 0); for (;;) { - /* When the end is not defined read everything. */ + // When the end is not defined read everything there is. if (end == NULL && vpeekc() == NUL) break; - c = plain_vgetc(); + do + { + c = vgetc(); + } while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR); + if (c == NUL || got_int) + // When CTRL-C was encountered the typeahead will be flushed and we + // won't get the end sequence. + break; + #ifdef FEAT_MBYTE if (has_mbyte) idx += (*mb_char2bytes)(c, buf + idx); @@ -9763,8 +9772,8 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap) --no_mapping; allow_keys = save_allow_keys; - p_paste = save_paste; - curbuf->b_p_ai = save_ai; + if (!save_paste) + set_option_value((char_u *)"paste", FALSE, NULL, 0); return ret_char; } diff --git a/src/version.c b/src/version.c index e646a2b432..ab58a5c179 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 224, /**/ 223, /**/ From 91f84f6e11cd879d43d651c0903d85bff95f0716 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 29 Jul 2018 15:07:52 +0200 Subject: [PATCH 12/17] Update runtime files. --- runtime/autoload/RstFold.vim | 48 ++++++++ runtime/autoload/xmlformat.vim | 3 +- runtime/doc/arabic.txt | 2 +- runtime/doc/autocmd.txt | 2 +- runtime/doc/change.txt | 2 +- runtime/doc/channel.txt | 2 +- runtime/doc/cmdline.txt | 2 +- runtime/doc/debug.txt | 2 +- runtime/doc/debugger.txt | 2 +- runtime/doc/develop.txt | 2 +- runtime/doc/diff.txt | 2 +- runtime/doc/digraph.txt | 2 +- runtime/doc/editing.txt | 2 +- runtime/doc/eval.txt | 3 +- runtime/doc/farsi.txt | 2 +- runtime/doc/filetype.txt | 2 +- runtime/doc/fold.txt | 2 +- runtime/doc/ft_sql.txt | 2 +- runtime/doc/gui.txt | 2 +- runtime/doc/gui_w32.txt | 2 +- runtime/doc/gui_x11.txt | 2 +- runtime/doc/hangulin.txt | 2 +- runtime/doc/hebrew.txt | 2 +- runtime/doc/help.txt | 2 +- runtime/doc/helphelp.txt | 2 +- runtime/doc/howto.txt | 2 +- runtime/doc/if_cscop.txt | 2 +- runtime/doc/if_mzsch.txt | 2 +- runtime/doc/if_ole.txt | 2 +- runtime/doc/if_perl.txt | 2 +- runtime/doc/if_pyth.txt | 2 +- runtime/doc/if_ruby.txt | 2 +- runtime/doc/if_sniff.txt | 2 +- runtime/doc/if_tcl.txt | 2 +- runtime/doc/indent.txt | 2 +- runtime/doc/index.txt | 2 +- runtime/doc/insert.txt | 2 +- runtime/doc/intro.txt | 2 +- runtime/doc/map.txt | 2 +- runtime/doc/mbyte.txt | 2 +- runtime/doc/message.txt | 2 +- runtime/doc/mlang.txt | 2 +- runtime/doc/motion.txt | 2 +- runtime/doc/netbeans.txt | 2 +- runtime/doc/options.txt | 2 +- runtime/doc/os_390.txt | 2 +- runtime/doc/os_amiga.txt | 2 +- runtime/doc/os_beos.txt | 2 +- runtime/doc/os_dos.txt | 2 +- runtime/doc/os_mac.txt | 2 +- runtime/doc/os_mint.txt | 2 +- runtime/doc/os_msdos.txt | 2 +- runtime/doc/os_os2.txt | 2 +- runtime/doc/os_qnx.txt | 2 +- runtime/doc/os_risc.txt | 2 +- runtime/doc/os_unix.txt | 2 +- runtime/doc/os_vms.txt | 2 +- runtime/doc/os_win32.txt | 2 +- runtime/doc/pattern.txt | 2 +- runtime/doc/pi_getscript.txt | 2 +- runtime/doc/pi_gzip.txt | 2 +- runtime/doc/pi_logipat.txt | 2 +- runtime/doc/pi_netrw.txt | 2 +- runtime/doc/pi_paren.txt | 2 +- runtime/doc/pi_spec.txt | 2 +- runtime/doc/pi_tar.txt | 2 +- runtime/doc/pi_vimball.txt | 2 +- runtime/doc/pi_zip.txt | 2 +- runtime/doc/print.txt | 2 +- runtime/doc/quickfix.txt | 2 +- runtime/doc/quickref.txt | 2 +- runtime/doc/quotes.txt | 2 +- runtime/doc/recover.txt | 2 +- runtime/doc/remote.txt | 2 +- runtime/doc/repeat.txt | 2 +- runtime/doc/rileft.txt | 2 +- runtime/doc/russian.txt | 2 +- runtime/doc/scroll.txt | 2 +- runtime/doc/sign.txt | 2 +- runtime/doc/spell.txt | 2 +- runtime/doc/sponsor.txt | 2 +- runtime/doc/starting.txt | 2 +- runtime/doc/syntax.txt | 16 +-- runtime/doc/tabpage.txt | 2 +- runtime/doc/tags | 1 + runtime/doc/tagsrch.txt | 2 +- runtime/doc/term.txt | 2 +- runtime/doc/terminal.txt | 2 +- runtime/doc/tips.txt | 2 +- runtime/doc/todo.txt | 74 ++++++++---- runtime/filetype.vim | 2 +- runtime/ftplugin/man.vim | 34 +++++- runtime/ftplugin/rst.vim | 32 +++++- runtime/indent/sh.vim | 3 +- runtime/indent/xml.vim | 9 +- .../dist/opt/termdebug/plugin/termdebug.vim | 2 +- runtime/syntax/java.vim | 27 +++-- runtime/syntax/javascript.vim | 12 +- runtime/syntax/readline.vim | 17 ++- runtime/syntax/rst.vim | 108 +++++++++++++++--- src/po/ja.euc-jp.po | 98 ++++++++-------- src/po/ja.po | 100 ++++++++-------- src/po/ja.sjis.po | 100 ++++++++-------- 103 files changed, 531 insertions(+), 326 deletions(-) create mode 100644 runtime/autoload/RstFold.vim diff --git a/runtime/autoload/RstFold.vim b/runtime/autoload/RstFold.vim new file mode 100644 index 0000000000..5becb04685 --- /dev/null +++ b/runtime/autoload/RstFold.vim @@ -0,0 +1,48 @@ +" Author: Antony Lee +" Description: Helper functions for reStructuredText syntax folding +" Last Modified: 2018-01-07 + +function s:CacheRstFold() + let closure = {'header_types': {}, 'max_level': 0, 'levels': {}} + function closure.Process(match) dict + let curline = getcurpos()[1] + if has_key(self.levels, curline - 1) + " For over+under-lined headers, the regex will match both at the + " overline and at the title itself; in that case, skip the second match. + return + endif + let lines = split(a:match, '\n') + let key = repeat(lines[-1][0], len(lines)) + if !has_key(self.header_types, key) + let self.max_level += 1 + let self.header_types[key] = self.max_level + endif + let self.levels[curline] = self.header_types[key] + endfunction + let save_cursor = getcurpos() + silent keeppatterns %s/\v^%(%(([=`:.'"~^_*+#-])\1+\n)?.{1,2}\n([=`:.'"~^_*+#-])\2+)|%(%(([=`:.''"~^_*+#-])\3{2,}\n)?.{3,}\n([=`:.''"~^_*+#-])\4{2,})$/\=closure.Process(submatch(0))/gn + call setpos('.', save_cursor) + let b:RstFoldCache = closure.levels +endfunction + +function RstFold#GetRstFold() + if !has_key(b:, 'RstFoldCache') + call s:CacheRstFold() + endif + if has_key(b:RstFoldCache, v:lnum) + return '>' . b:RstFoldCache[v:lnum] + else + return '=' + endif +endfunction + +function RstFold#GetRstFoldText() + if !has_key(b:, 'RstFoldCache') + call s:CacheRstFold() + endif + let indent = repeat(' ', b:RstFoldCache[v:foldstart] - 1) + let thisline = getline(v:foldstart) + " For over+under-lined headers, skip the overline. + let text = thisline =~ '^\([=`:.''"~^_*+#-]\)\1\+$' ? getline(v:foldstart + 1) : thisline + return indent . text +endfunction diff --git a/runtime/autoload/xmlformat.vim b/runtime/autoload/xmlformat.vim index 83ba49a073..f227b5ee25 100644 --- a/runtime/autoload/xmlformat.vim +++ b/runtime/autoload/xmlformat.vim @@ -2,9 +2,8 @@ " Last Change: Thu, 22 May 2018 21:26:55 +0100 " Version: 0.1 " Author: Christian Brabandt -" Script: http://www.vim.org/scripts/script.php?script_id= +" Repository: https://github.com/chrisbra/vim-xml-ftplugin " License: VIM License -" GetLatestVimScripts: ???? 18 :AutoInstall: xmlformat.vim " Documentation: see :h xmlformat.txt (TODO!) " --------------------------------------------------------------------- " Load Once: {{{1 diff --git a/runtime/doc/arabic.txt b/runtime/doc/arabic.txt index 0572b85f8f..2303a2b862 100644 --- a/runtime/doc/arabic.txt +++ b/runtime/doc/arabic.txt @@ -319,4 +319,4 @@ There is one known minor bug, No other bugs are known to exist. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 051dedbdbd..8d1dca2ff9 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1593,4 +1593,4 @@ This will write the file without triggering the autocommands defined by the gzip plugin. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index b59f28f47b..703d336642 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1884,4 +1884,4 @@ The sorting can be interrupted, but if you interrupt it too late in the process you may end up with duplicated lines. This also depends on the system library function used. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt index 72887fea0b..4cc36258c0 100644 --- a/runtime/doc/channel.txt +++ b/runtime/doc/channel.txt @@ -816,4 +816,4 @@ the cursor to the last line. "A" will move to the end of the line, "I" to the start of the line. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index ae364c3230..df18ec6c45 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1164,4 +1164,4 @@ The character used for the pattern indicates the type of command-line: @ string for |input()| - text for |:insert| or |:append| - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/debug.txt b/runtime/doc/debug.txt index 6d2cea5d81..b03bf1517f 100644 --- a/runtime/doc/debug.txt +++ b/runtime/doc/debug.txt @@ -172,4 +172,4 @@ Visual C++ 2005 Express Edition can be downloaded for free from: http://msdn.microsoft.com/vstudio/express/visualC/default.aspx ========================================================================= - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/debugger.txt b/runtime/doc/debugger.txt index 9aa2fb8467..3370cf0988 100644 --- a/runtime/doc/debugger.txt +++ b/runtime/doc/debugger.txt @@ -139,4 +139,4 @@ Programming Environment. For Sun NetBeans support see |netbeans|. - vim:tw=78:sw=4:ts=8:ft=help:norl: + vim:tw=78:sw=4:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 20a623f362..b1b3cc49ec 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -563,4 +563,4 @@ long 32 or 64 bit signed, can hold a pointer Note that some compilers cannot handle long lines or strings. The C89 standard specifies a limit of 509 characters. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index e263e6b83e..502fb49181 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -441,4 +441,4 @@ evaluating 'patchexpr'. This hopefully avoids that files in the current directory are accidentally patched. Vim will also delete files starting with v:fname_in and ending in ".rej" and ".orig". - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt index 2a232228ed..62f23a2f80 100644 --- a/runtime/doc/digraph.txt +++ b/runtime/doc/digraph.txt @@ -1488,4 +1488,4 @@ char digraph hex dec official name ~ ſt ft FB05 64261 LATIN SMALL LIGATURE LONG S T st st FB06 64262 LATIN SMALL LIGATURE ST - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 4e974579fa..04bf4b1fd6 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1747,4 +1747,4 @@ There are three different types of searching: currently work with 'path' items that contain a URL or use the double star with depth limiter (/usr/**2) or upward search (;) notations. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index fb9093e1c5..964eab125f 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -9265,6 +9265,7 @@ amiga Amiga version of Vim. arabic Compiled with Arabic support |Arabic|. arp Compiled with ARP support (Amiga). autocmd Compiled with autocommand support. |autocommand| +autochdir Compiled with support for 'autochdir' autoservername Automatically enable |clientserver| balloon_eval Compiled with |balloon-eval| support. balloon_multiline GUI supports multiline balloons. @@ -11647,4 +11648,4 @@ without the |+eval| feature. Find more information in the file src/testdir/README.txt. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt index 1bb9f20727..493714e4d6 100644 --- a/runtime/doc/farsi.txt +++ b/runtime/doc/farsi.txt @@ -266,4 +266,4 @@ changes made in the current line. For more information about the bugs refer to rileft.txt. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 0c33845f55..b08e3d73f9 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -695,4 +695,4 @@ The mappings can be disabled with: > < - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index ad3f514663..c3ee97e162 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -601,4 +601,4 @@ used. Otherwise the values from the window where the buffer was edited last are used. ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index 9819c066af..f461b7eab5 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -777,4 +777,4 @@ Setting the filetype back to Perl sets all the usual "perl" related items back as they were. -vim:tw=78:ts=8:ft=help:norl: +vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index c30aa33c04..603a4d4ad3 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -1075,4 +1075,4 @@ careful! For the Win32 GUI the external commands are executed in a separate window. See |gui-shell-win32|. - vim:tw=78:sw=4:ts=8:ft=help:norl: + vim:tw=78:sw=4:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt index 7bd12aa610..15dd275a03 100644 --- a/runtime/doc/gui_w32.txt +++ b/runtime/doc/gui_w32.txt @@ -451,4 +451,4 @@ To try out if XPM support works do this: > :exe 'sign place 1 line=1 name=vimxpm file=' . expand('%:p') < - vim:tw=78:sw=4:ts=8:ft=help:norl: + vim:tw=78:sw=4:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt index 8a5e9bfe07..6b7a77307e 100644 --- a/runtime/doc/gui_x11.txt +++ b/runtime/doc/gui_x11.txt @@ -721,4 +721,4 @@ and use CLIPBOARD ("+) for cut/copy/paste operations. You thus have access to both by choosing to use either of the "* or "+ registers. - vim:tw=78:sw=4:ts=8:ft=help:norl: + vim:tw=78:sw=4:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/hangulin.txt b/runtime/doc/hangulin.txt index 56f188b2d5..708cfe9ac4 100644 --- a/runtime/doc/hangulin.txt +++ b/runtime/doc/hangulin.txt @@ -109,4 +109,4 @@ Send comments, patches and suggestions to: SungHyun Nam Chi-Deok Hwang <...> - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/hebrew.txt b/runtime/doc/hebrew.txt index 5400b49326..f2c3a3db44 100644 --- a/runtime/doc/hebrew.txt +++ b/runtime/doc/hebrew.txt @@ -139,4 +139,4 @@ The result is that all Hebrew characters are displayed as ~x. To solve this problem, set isprint=@,128-255. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 4c8eb94ef1..239de9d812 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -225,4 +225,4 @@ will try to find help for it. Especially for options in single quotes, e.g. 'compatible'. ------------------------------------------------------------------------------ - vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl: + vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:noet:ft=help:norl: diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 29941c1aeb..f6c6ab7444 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -370,4 +370,4 @@ highlighting. So do these: You can find the details in $VIMRUNTIME/syntax/help.vim - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/howto.txt b/runtime/doc/howto.txt index f6973102c6..26d611ef05 100644 --- a/runtime/doc/howto.txt +++ b/runtime/doc/howto.txt @@ -93,4 +93,4 @@ How to ... *howdoi* *how-do-i* *howto* *how-to* |2html.vim| convert a colored file to HTML |less| use Vim like less or more with syntax highlighting - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/if_cscop.txt b/runtime/doc/if_cscop.txt index cf2aff2bcc..ba0f1d5d13 100644 --- a/runtime/doc/if_cscop.txt +++ b/runtime/doc/if_cscop.txt @@ -484,4 +484,4 @@ For a cscope version for Win32 see (seems abandoned): Win32 support was added by Sergey Khorev . Contact him if you have Win32-specific issues. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/if_mzsch.txt b/runtime/doc/if_mzsch.txt index f118b17dcc..9d27683f7f 100644 --- a/runtime/doc/if_mzsch.txt +++ b/runtime/doc/if_mzsch.txt @@ -312,4 +312,4 @@ MzScheme's raco command: raco pkg install cext-lib # raco ctool command < ====================================================================== - vim:tw=78:ts=8:sts=4:ft=help:norl: + vim:tw=78:ts=8:noet:sts=4:ft=help:norl: diff --git a/runtime/doc/if_ole.txt b/runtime/doc/if_ole.txt index 4ec9ac5f1e..e734df9847 100644 --- a/runtime/doc/if_ole.txt +++ b/runtime/doc/if_ole.txt @@ -202,4 +202,4 @@ In Vim > [.Net remarks provided by Dave Fishburn and Brian Sturk] ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt index a06954e173..b82ee832fa 100644 --- a/runtime/doc/if_perl.txt +++ b/runtime/doc/if_perl.txt @@ -303,4 +303,4 @@ version of the shared library must match the Perl version Vim was compiled with. ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 89baef42f8..30a3a726a0 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -924,4 +924,4 @@ If you have more than one version of Python 3, you need to link python3 to the one you prefer, before running configure. ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt index 572a6ec15e..b1404769f8 100644 --- a/runtime/doc/if_ruby.txt +++ b/runtime/doc/if_ruby.txt @@ -234,4 +234,4 @@ version of the shared library must match the Ruby version Vim was compiled with. ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/if_sniff.txt b/runtime/doc/if_sniff.txt index cf6ed1c981..d0e16a8da5 100644 --- a/runtime/doc/if_sniff.txt +++ b/runtime/doc/if_sniff.txt @@ -8,4 +8,4 @@ The SNiFF+ support was removed at patch 7.4.1433. If you want to check it out sync to before that. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/if_tcl.txt b/runtime/doc/if_tcl.txt index 979a19b473..e822dfd170 100644 --- a/runtime/doc/if_tcl.txt +++ b/runtime/doc/if_tcl.txt @@ -544,4 +544,4 @@ of DYNAMIC_TCL_DLL file what was specified at compile time. The version of the shared library must match the Tcl version Vim was compiled with. ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 180d932b3f..54fb52618b 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -1156,4 +1156,4 @@ indent for a continuation line, a line that starts with a backslash: > Three times shiftwidth is the default value. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index f569ec5e87..1a0d225267 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1657,4 +1657,4 @@ tag command action ~ |:~| :~ repeat last ":substitute" - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index ca19136738..e145cacf31 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -2005,4 +2005,4 @@ self explanatory. Using the long or the short version depends on the [READ ERRORS] not all of the file could be read - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index 8325bb33bf..a000482e59 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -906,4 +906,4 @@ buffer lines logical lines window lines screen lines ~ 6. ~ ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 18b61df001..d6dbd5032f 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1552,4 +1552,4 @@ local to the script and use mappings local to the script. When the user invokes the user command, it will run in the context of the script it was defined in. This matters if || is used in a command. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 99ce10fab8..24fed6d7d9 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -1467,4 +1467,4 @@ Contributions specifically for the multi-byte features by: Taro Muraoka Yasuhiro Matsumoto - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index b4a72ff641..c23ae65d0e 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -866,4 +866,4 @@ The |g<| command can be used to see the last page of previous command output. This is especially useful if you accidentally typed at the hit-enter prompt. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/mlang.txt b/runtime/doc/mlang.txt index 3d590e0e06..4d85bbd43d 100644 --- a/runtime/doc/mlang.txt +++ b/runtime/doc/mlang.txt @@ -210,4 +210,4 @@ a message adapt to language preferences of the user, > :endif < - vim:tw=78:sw=4:ts=8:ft=help:norl: + vim:tw=78:sw=4:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index 2c0fd55304..b2105206b7 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1341,4 +1341,4 @@ L To line [count] from bottom of window (default: Last position is in a status line, that window is made the active window and the cursor is not moved. {not in Vi} - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt index 25fba4d5a2..61e58c245d 100644 --- a/runtime/doc/netbeans.txt +++ b/runtime/doc/netbeans.txt @@ -1007,4 +1007,4 @@ Expert tab MIME Type property. NetBeans is MIME oriented and the External Editor will only open MIME types specified in this property. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 469c363bc1..8645c47333 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -9204,4 +9204,4 @@ A jump table for the options with a short description can be found at |Q_op|. screen. When non-zero, characters are sent to the terminal one by one. For MS-DOS pcterm this does not work. For debugging purposes. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_390.txt b/runtime/doc/os_390.txt index 5b4b9f7a6f..ab88cc6710 100644 --- a/runtime/doc/os_390.txt +++ b/runtime/doc/os_390.txt @@ -131,4 +131,4 @@ Also look at: ------------------------------------------------------------------------------ - vim:tw=78:fo=tcq2:ts=8:ft=help:norl: + vim:tw=78:fo=tcq2:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_amiga.txt b/runtime/doc/os_amiga.txt index ad083b58a8..26aec5fe98 100644 --- a/runtime/doc/os_amiga.txt +++ b/runtime/doc/os_amiga.txt @@ -144,4 +144,4 @@ Installation ~ ;End VIM - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_beos.txt b/runtime/doc/os_beos.txt index 148f5fe0e7..1356a6b71e 100644 --- a/runtime/doc/os_beos.txt +++ b/runtime/doc/os_beos.txt @@ -317,4 +317,4 @@ it is about 1191K. http://polder.ubc.kun.nl/~rhialto/be - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt index b950953022..d24efdf076 100644 --- a/runtime/doc/os_dos.txt +++ b/runtime/doc/os_dos.txt @@ -295,4 +295,4 @@ When starting up, Vim checks for the presence of "sh" anywhere in the 'shell' option. If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or 'shellxquote' options will be set as described above. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_mac.txt b/runtime/doc/os_mac.txt index 72c0c160b7..28ebe66014 100644 --- a/runtime/doc/os_mac.txt +++ b/runtime/doc/os_mac.txt @@ -179,4 +179,4 @@ the system clipboard, the darwin feature should be disabled to prevent Vim from hanging at runtime. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_mint.txt b/runtime/doc/os_mint.txt index 96e139d3e7..ed33491bbe 100644 --- a/runtime/doc/os_mint.txt +++ b/runtime/doc/os_mint.txt @@ -36,4 +36,4 @@ Send bug reports to Jens M. Felderhoff, e-mail: - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_msdos.txt b/runtime/doc/os_msdos.txt index 50fb4e899d..d5be05f3ae 100644 --- a/runtime/doc/os_msdos.txt +++ b/runtime/doc/os_msdos.txt @@ -12,4 +12,4 @@ work, there is not enough memory. The DOS32 version (using DJGPP) might still work on older systems. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_os2.txt b/runtime/doc/os_os2.txt index 7891756612..2f094cfa22 100644 --- a/runtime/doc/os_os2.txt +++ b/runtime/doc/os_os2.txt @@ -10,4 +10,4 @@ This file used to contain the particularities for the OS/2 version of Vim. The OS/2 support was removed in patch 7.4.1008. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_qnx.txt b/runtime/doc/os_qnx.txt index 466699fcf6..4cbc7ead05 100644 --- a/runtime/doc/os_qnx.txt +++ b/runtime/doc/os_qnx.txt @@ -135,4 +135,4 @@ Todo: - Replace usage of fork() with spawn() when launching external programs. - vim:tw=78:sw=4:ts=8:ts=8:ft=help:norl: + vim:tw=78:sw=4:ts=8:noet:ts=8:ft=help:norl: diff --git a/runtime/doc/os_risc.txt b/runtime/doc/os_risc.txt index 095d5a9856..d951b8e8dd 100644 --- a/runtime/doc/os_risc.txt +++ b/runtime/doc/os_risc.txt @@ -9,4 +9,4 @@ The RISC OS support has been removed from Vim with patch 7.3.187. If you would like to use Vim on RISC OS get the files from before that patch. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_unix.txt b/runtime/doc/os_unix.txt index 4b69af5aa8..5067b1e44b 100644 --- a/runtime/doc/os_unix.txt +++ b/runtime/doc/os_unix.txt @@ -57,4 +57,4 @@ For real color terminals the ":highlight" command can be used. The file "tools/vim132" is a shell script that can be used to put Vim in 132 column mode on a vt100 and lookalikes. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt index 3e723b6770..fc6da61750 100644 --- a/runtime/doc/os_vms.txt +++ b/runtime/doc/os_vms.txt @@ -952,4 +952,4 @@ of OS_VMS.TXT: Bruce Hunsaker Sandor Kopanyi - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt index e9953339a1..9a5f748af6 100644 --- a/runtime/doc/os_win32.txt +++ b/runtime/doc/os_win32.txt @@ -303,4 +303,4 @@ A. Yes, place your favorite icon in bitmaps/vim.ico in a directory of 'runtimepath'. For example ~/vimfiles/bitmaps/vim.ico. - vim:tw=78:fo=tcq2:ts=8:ft=help:norl: + vim:tw=78:fo=tcq2:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 09b4c2c1a2..e7e510f3a7 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1417,4 +1417,4 @@ Finally, these constructs are unique to Perl: ":2match" for another plugin. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/pi_getscript.txt b/runtime/doc/pi_getscript.txt index 4190706829..ae38a3b1bf 100644 --- a/runtime/doc/pi_getscript.txt +++ b/runtime/doc/pi_getscript.txt @@ -479,4 +479,4 @@ v2 May 14, 2003 : extracts name of item to be obtained from the and they became numbers. Fixes comparison. ============================================================================== -vim:tw=78:ts=8:ft=help:fdm=marker +vim:tw=78:ts=8:noet:ft=help:fdm=marker diff --git a/runtime/doc/pi_gzip.txt b/runtime/doc/pi_gzip.txt index 21b6520ee1..6017efa899 100644 --- a/runtime/doc/pi_gzip.txt +++ b/runtime/doc/pi_gzip.txt @@ -40,4 +40,4 @@ compression. Thus editing the patchmode file will not give you the automatic decompression. You have to rename the file if you want this. ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/pi_logipat.txt b/runtime/doc/pi_logipat.txt index f8d666234f..8d33a565ac 100644 --- a/runtime/doc/pi_logipat.txt +++ b/runtime/doc/pi_logipat.txt @@ -118,4 +118,4 @@ Copyright: (c) 2004-2015 by Charles E. Campbell *logiPat-copyright* ============================================================================== -vim:tw=78:ts=8:ft=help +vim:tw=78:ts=8:noet:ft=help diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index b4f2f2693e..478338ed42 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -4267,4 +4267,4 @@ netrw: ============================================================================== Modelines: {{{1 - vim:tw=78:ts=8:ft=help:norl:fdm=marker + vim:tw=78:ts=8:noet:ft=help:norl:fdm=marker diff --git a/runtime/doc/pi_paren.txt b/runtime/doc/pi_paren.txt index d4ab4a08c8..8c4f04a1b5 100644 --- a/runtime/doc/pi_paren.txt +++ b/runtime/doc/pi_paren.txt @@ -57,4 +57,4 @@ comments. This is unrelated to the matchparen highlighting, they use a different mechanism. ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/pi_spec.txt b/runtime/doc/pi_spec.txt index abe5f1159a..aaede1e972 100644 --- a/runtime/doc/pi_spec.txt +++ b/runtime/doc/pi_spec.txt @@ -108,4 +108,4 @@ If you don't like the release updating feature and don't want to answer Good luck!! -vim:tw=78:ts=8:ft=help:norl: +vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/pi_tar.txt b/runtime/doc/pi_tar.txt index 7a6faf167d..f39e0c475b 100644 --- a/runtime/doc/pi_tar.txt +++ b/runtime/doc/pi_tar.txt @@ -148,4 +148,4 @@ Copyright 2005-2012: *tar-copyright* v1 (original) * Michael Toren (see http://michael.toren.net/code/) ============================================================================== -vim:tw=78:ts=8:ft=help +vim:tw=78:ts=8:noet:ft=help diff --git a/runtime/doc/pi_vimball.txt b/runtime/doc/pi_vimball.txt index 563b12a966..fec16a4d83 100644 --- a/runtime/doc/pi_vimball.txt +++ b/runtime/doc/pi_vimball.txt @@ -273,4 +273,4 @@ WINDOWS *vimball-windows* ============================================================================== -vim:tw=78:ts=8:ft=help:fdm=marker +vim:tw=78:ts=8:noet:ft=help:fdm=marker diff --git a/runtime/doc/pi_zip.txt b/runtime/doc/pi_zip.txt index c5fa391bfc..3517735733 100644 --- a/runtime/doc/pi_zip.txt +++ b/runtime/doc/pi_zip.txt @@ -149,4 +149,4 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright* v1 Sep 15, 2005 * Initial release, had browsing, reading, and writing ============================================================================== -vim:tw=78:ts=8:ft=help:fdm=marker +vim:tw=78:ts=8:noet:ft=help:fdm=marker diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt index b93a2305fa..07a95031e8 100644 --- a/runtime/doc/print.txt +++ b/runtime/doc/print.txt @@ -752,4 +752,4 @@ to adjust the number of lines before a formfeed character to prevent accidental blank pages. ============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 2955edac92..95bcfa06d8 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1794,4 +1794,4 @@ start of the file about how to use it. (This script is deprecated, see - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index f2c540b290..03ac357726 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1447,4 +1447,4 @@ Context-sensitive completion on the command-line: |zN| zN fold normal set 'foldenable' |zi| zi invert 'foldenable' - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/quotes.txt b/runtime/doc/quotes.txt index 063a3148b7..04e2aec2d6 100644 --- a/runtime/doc/quotes.txt +++ b/runtime/doc/quotes.txt @@ -272,4 +272,4 @@ In summary: |____/ |_| \___/|_| |_| (_|_) (Tony Nugent, Australia) ` - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt index 89703fdded..c4007db936 100644 --- a/runtime/doc/recover.txt +++ b/runtime/doc/recover.txt @@ -234,4 +234,4 @@ Note that after recovery the key of the swap file will be used for the text file. Thus if you write the text file, you need to use that new key. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 15219e0b9b..03e0d97592 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -204,4 +204,4 @@ When using gvim, the --remote-wait only works properly this way: > start /w gvim --remote-wait file.txt < - vim:tw=78:sw=4:ts=8:ft=help:norl: + vim:tw=78:sw=4:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index ff1d68d38e..55aed248b1 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -1010,4 +1010,4 @@ mind there are various things that may clobber the results: - The "self" time is wrong when a function is used recursively. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt index 17bfdba7ba..f5ec8e8762 100644 --- a/runtime/doc/rileft.txt +++ b/runtime/doc/rileft.txt @@ -121,4 +121,4 @@ o When both 'rightleft' and 'revins' are on: 'textwidth' does not work. o There is no full bidirectionality (bidi) support. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/russian.txt b/runtime/doc/russian.txt index cf64873194..fae8690df1 100644 --- a/runtime/doc/russian.txt +++ b/runtime/doc/russian.txt @@ -71,4 +71,4 @@ In order to use the Russian documentation, make sure you have set the releases of gettext. =============================================================================== - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt index 971fec8e98..1415e2f91e 100644 --- a/runtime/doc/scroll.txt +++ b/runtime/doc/scroll.txt @@ -332,4 +332,4 @@ Add these mappings to your vimrc file: > :map [65~ :map! [65~ < - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index dab63b1e48..bd63ea9ade 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -202,4 +202,4 @@ JUMPING TO A SIGN *:sign-jump* *E157* have a name. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt index 6f42eb398a..2b096e3bec 100644 --- a/runtime/doc/spell.txt +++ b/runtime/doc/spell.txt @@ -1646,4 +1646,4 @@ WORDCHARS (Hunspell) *spell-WORDCHARS* is no need to separate words before checking them (using a trie instead of a hashtable). - vim:tw=78:sw=4:ts=8:ft=help:norl: + vim:tw=78:sw=4:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/sponsor.txt b/runtime/doc/sponsor.txt index 6e42d157df..50148e1c96 100644 --- a/runtime/doc/sponsor.txt +++ b/runtime/doc/sponsor.txt @@ -213,4 +213,4 @@ is done. But a receipt is possible. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 7757088c86..3c2d868057 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1687,4 +1687,4 @@ most of the information will be restored). Use ! to abandon a modified buffer. |abandon| {not when compiled with tiny or small features} - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 526231f70b..b1a1e7258f 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -2876,17 +2876,17 @@ This covers syntax highlighting for the older Unix (Bourne) sh, and newer shells such as bash, dash, posix, and the Korn shells. Vim attempts to determine which shell type is in use by specifying that -various filenames are of specific types: > +various filenames are of specific types, e.g.: > ksh : .kshrc* *.ksh bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash < -If none of these cases pertain, then the first line of the file is examined -(ex. looking for /bin/sh /bin/ksh /bin/bash). If the first line specifies a -shelltype, then that shelltype is used. However some files (ex. .profile) are -known to be shell files but the type is not apparent. Furthermore, on many -systems sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" -(Posix). +See $VIMRUNTIME/filetype.vim for the full list of patterns. If none of these +cases pertain, then the first line of the file is examined (ex. looking for +/bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype, then +that shelltype is used. However some files (ex. .profile) are known to be +shell files but the type is not apparent. Furthermore, on many systems sh is +symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix). One may specify a global default by instantiating one of the following variables in your <.vimrc>: @@ -5478,4 +5478,4 @@ literal text specify the size of that text (in bytes): "<\@1<=span" Matches the same, but only tries one byte before "span". - vim:tw=78:sw=4:ts=8:ft=help:norl: + vim:tw=78:sw=4:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index 31fcc43564..a80d7c3b43 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -472,4 +472,4 @@ If you want to show something specific for a tab page, you might want to use a tab page local variable. |t:var| - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/tags b/runtime/doc/tags index 859db21704..135c3908eb 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4621,6 +4621,7 @@ E953 eval.txt /*E953* E954 options.txt /*E954* E955 eval.txt /*E955* E956 pattern.txt /*E956* +E957 eval.txt /*E957* E96 diff.txt /*E96* E97 diff.txt /*E97* E98 diff.txt /*E98* diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index 555beb509a..d3ceac662b 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -854,4 +854,4 @@ Common arguments for the commands above: < For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern is used as a literal string, not as a search pattern. - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt index dbf7e6483a..77cd933b42 100644 --- a/runtime/doc/term.txt +++ b/runtime/doc/term.txt @@ -977,4 +977,4 @@ To swap the meaning of the left and right mouse buttons: > :noremap! :noremap! < - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index cd2c664f54..f9fc0ee5ee 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -909,4 +909,4 @@ for when the terminal can't be resized by Vim). - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt index 619c95506d..bbe341cf2a 100644 --- a/runtime/doc/tips.txt +++ b/runtime/doc/tips.txt @@ -530,4 +530,4 @@ A slightly more advanced version is used in the |matchparen| plugin. autocmd InsertEnter * match none < - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 9b08aef8dc..69294172d3 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -50,14 +50,15 @@ Terminal debugger: initializing mzscheme avoid the problem, thus it's not some #ifdef. Terminal emulator window: +- When the job in the terminal doesn't use mouse events, let the scroll wheel + scroll the scrollback, like a terminal does at the shell prompt. #2490 + And use modeless selection. #2962 - With a vertical split only one window is updated. (Linwei, 2018 Jun 2, #2977) - When pasting should call vterm_keyboard_start_paste(), e.g. when using K_MIDDLEMOUSE, calling insert_reg(). - Users expect parsing the :term argument like a shell does, also support single quotes. E.g. with: :term grep 'alice says "hello"' (#1999) -- How to access selection in Terminal running a shell? (damnskippy, 2018 May - 27, #29620 When terminal doesn't use the mouse, use modeless selection. - Win32: Redirecting input does not work, half of Test_terminal_redir_file() is disabled. - Win32: Redirecting output works but includes escape sequences. @@ -78,6 +79,7 @@ Does not build with MinGW out of the box: - WINVER conflict, should use 0x0600 by default? Patches for Python: #3162, #3263 (Ozaki Kiichi) + Needs update. Crash when mixing matchadd and substitute()? (Max Christian Pohle, 2018 May 13, #2910) Can't reproduce? @@ -88,41 +90,65 @@ 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 +Improve fallback for menu translations, to avoid having to create lots of +files that source the actual file. E.g. menu_da_de -> menu_da +Include part of #3242? + +Inlcude Chinese-Taiwan translations. (bystar, #3261) + +Using mouse for inputlist() doesn't work after patch 8.0.1756. (Dominique +Pelle, 2018 Jul 22, #3239) Also see 8.0.0722. Check both console and GUI. More warnings from static analysis: https://lgtm.com/projects/g/vim/vim/alerts/?mode=list -Patch for Perl 5.28 on Windows. (#3196) +When handle_drop() is called while the updating_screen is true, it fails +completely. Should store the file list and use it when updating_screen is set +to false in reset_updating_screen(). 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) +Test fails in AppVeyor. 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) +Memory leak in test_assert: +==19127== by 0x2640D7: alloc (misc2.c:874) +==19127== by 0x2646D6: vim_strsave (misc2.c:1315) +==19127== by 0x1B68D2: f_getcwd (evalfunc.c:4950) +And: +==19127== by 0x2640D7: alloc (misc2.c:874) +==19127== by 0x1A9477: set_var (eval.c:7601) +==19127== by 0x19F96F: set_var_lval (eval.c:2233) +==19127== by 0x19EA3A: ex_let_one (eval.c:1810) +==19127== by 0x19D737: ex_let_vars (eval.c:1294) +==19127== by 0x19D6B4: ex_let (eval.c:1259) +Memory leaks in test_channel? (or is it because of fork()) +Using uninitialized value in test_crypt. +Memory leaks in test_escaped_glob +==20651== by 0x2640D7: alloc (misc2.c:874) +==20651== by 0x2646D6: vim_strsave (misc2.c:1315) +==20651== by 0x3741EA: get_function_args (userfunc.c:131) +==20651== by 0x378779: ex_function (userfunc.c:2036) +Memory leak in test_terminal: +==23530== by 0x2640D7: alloc (misc2.c:874) +==23530== by 0x2646D6: vim_strsave (misc2.c:1315) +==23530== by 0x25841D: FullName_save (misc1.c:5443) +==23530== by 0x17CB4F: fix_fname (buffer.c:4794) +==23530== by 0x17CB9A: fname_expand (buffer.c:4838) +==23530== by 0x1759AB: buflist_new (buffer.c:1889) +==23530== by 0x35C923: term_start (terminal.c:421) +==23530== by 0x2AFF30: mch_call_shell_terminal (os_unix.c:4377) +==23530== by 0x2B16BE: mch_call_shell (os_unix.c:5383) gethostbyname() is old, use getaddrinfo() if available. (#3227) @@ -152,12 +178,20 @@ Compiler warnings (geeknik, 2017 Oct 26): - signed integer overflow in getdecchrs() (#2254) - undefined left shift in get_string_tv() (#2250) +Win32 console: and typed in Insert mode don't result in normal +characters. (#3246) + Patch for more quickfix refactoring. (Yegappan Lakshmanan, #2950) Tests failing for "make testgui" with GTK: - Test_setbufvar_options() - Test_exit_callback_interval() +When using CTRL-W CR in the quickfix window, the jumplist in the opened window +is cleared, to avoid going back to the list of errors buffer (would have two +windows with it). Can we just remove the jump list entries for the quickfix +buffer? + Patch to stack and pop the window title and icon. (IWAMOTO Kouichi, 2018 Jun 22, #3059) 8 For xterm need to open a connection to the X server to get the window @@ -446,10 +480,6 @@ The ":move" command does not honor closed folds. (Ryan Lue, #2351) Patch to fix increment/decrement not working properly when 'virtualedit' is set. (Hirohito Higashi, 2016 Aug 1, #923) -Memory leaks in test_channel? (or is it because of fork()) -Using uninitialized value in test_crypt. -Memory leaks in test_escaped_glob - Patch to make gM move to middle of line. (Yasuhiro Matsumoto, Sep 8, #2070) Cannot copy modeless selection when cursor is inside it. (lkintact, #2300) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 541f613ac9..46bf5673ad 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1462,7 +1462,7 @@ au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. " Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts -au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call dist#ft#SetFileTypeSH("bash") +au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call dist#ft#SetFileTypeSH("bash") au BufNewFile,BufRead .kshrc*,*.ksh call dist#ft#SetFileTypeSH("ksh") au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1)) diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index ea3f9ac6c9..dc03211916 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: man " Maintainer: SungHyun Nam -" Last Change: 2018 May 2 +" Last Change: 2018 Jul 25 " To make the ":Man" command available before editing a manual page, source " this script from your startup vimrc file. @@ -14,32 +14,47 @@ if &filetype == "man" finish endif let b:did_ftplugin = 1 +endif +let s:cpo_save = &cpo +set cpo-=C + +if &filetype == "man" " allow dot and dash in manual page name. setlocal iskeyword+=\.,- + let b:undo_ftplugin = "setlocal iskeyword<" " Add mappings, unless the user didn't want this. if !exists("no_plugin_maps") && !exists("no_man_maps") if !hasmapto('ManBS') nmap h ManBS + let b:undo_ftplugin = b:undo_ftplugin + \ . '|silent! nunmap h' endif nnoremap ManBS :%s/.\b//g:setl nomod'' nnoremap :call PreGetPage(v:count) nnoremap :call PopPage() nnoremap q :q + + " Add undo commands for the maps + let b:undo_ftplugin = b:undo_ftplugin + \ . '|silent! nunmap ManBS' + \ . '|silent! nunmap ' + \ . '|silent! nunmap ' + \ . '|silent! nunmap q' endif if exists('g:ft_man_folding_enable') && (g:ft_man_folding_enable == 1) setlocal foldmethod=indent foldnestmax=1 foldenable + let b:undo_ftplugin = b:undo_ftplugin + \ . '|silent! setl fdm< fdn< fen<' endif - let b:undo_ftplugin = "setlocal iskeyword<" - endif if exists(":Man") != 2 - com -nargs=+ -complete=shellcmd Man call s:GetPage() + com -nargs=+ -complete=shellcmd Man call s:GetPage(, ) nmap K :call PreGetPage(0) nmap ManPreGetPage :call PreGetPage(0) endif @@ -100,7 +115,7 @@ func FindPage(sect, page) return 1 endfunc -func GetPage(...) +func GetPage(cmdmods, ...) if a:0 >= 2 let sect = a:1 let page = a:2 @@ -154,7 +169,11 @@ func GetPage(...) new endif else - new + if a:cmdmods != '' + exe a:cmdmods . ' new' + else + new + endif endif setl nonu fdc=0 endif @@ -218,4 +237,7 @@ endfunc endif +let &cpo = s:cpo_save +unlet s:cpo_save + " vim: set sw=2 ts=8 noet: diff --git a/runtime/ftplugin/rst.vim b/runtime/ftplugin/rst.vim index e61213e7a5..9d737cde44 100644 --- a/runtime/ftplugin/rst.vim +++ b/runtime/ftplugin/rst.vim @@ -1,10 +1,12 @@ -" Vim filetype plugin file -" Language: reStructuredText documentation format -" Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" reStructuredText filetype plugin file +" Language: reStructuredText documentation format +" Maintainer: Marshall Ward +" Original Maintainer: Nikolai Weibull +" Website: https://github.com/marshallward/vim-restructuredtext +" Latest Revision: 2018-01-07 if exists("b:did_ftplugin") - finish + finish endif let b:did_ftplugin = 1 @@ -16,5 +18,25 @@ let b:undo_ftplugin = "setl com< cms< et< fo<" setlocal comments=fb:.. commentstring=..\ %s expandtab setlocal formatoptions+=tcroql +" reStructuredText standard recommends that tabs be expanded to 8 spaces +" The choice of 3-space indentation is to provide slightly better support for +" directives (..) and ordered lists (1.), although it can cause problems for +" many other cases. +" +" More sophisticated indentation rules should be revisted in the future. + +if !exists("g:rst_style") || g:rst_style != 0 + setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8 +endif + +if has('patch-7.3.867') " Introduced the TextChanged event. + setlocal foldmethod=expr + setlocal foldexpr=RstFold#GetRstFold() + setlocal foldtext=RstFold#GetRstFoldText() + augroup RstFold + autocmd TextChanged,InsertLeave unlet! b:RstFoldCache + augroup END +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim index fb398cafb0..32bc9f35bb 100644 --- a/runtime/indent/sh.vim +++ b/runtime/indent/sh.vim @@ -7,6 +7,7 @@ " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-sh-indent " Changelog: +" 20180724 - make check for zsh syntax more rigid (needs word-boundaries) " 20180326 - better support for line continuation " 20180325 - better detection of function definitions " 20180127 - better support for zsh complex commands @@ -70,7 +71,7 @@ function! GetShIndent() " Check contents of previous lines if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' || - \ (&ft is# 'zsh' && line =~ '\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>') + \ (&ft is# 'zsh' && line =~ '\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>') if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$' let ind += s:indent_value('default') endif diff --git a/runtime/indent/xml.vim b/runtime/indent/xml.vim index 87ffb329b5..dcafb467a6 100644 --- a/runtime/indent/xml.vim +++ b/runtime/indent/xml.vim @@ -1,6 +1,8 @@ " Language: xml -" Maintainer: Johannes Zellner -" Last Change: 2017 Jun 13 +" Repository: https://github.com/chrisbra/vim-xml-ftplugin +" Maintainer: Christian Brabandt +" Previous Maintainer: Johannes Zellner +" Last Change: 20180724 - Correctly indent xml comments https://github.com/vim/vim/issues/3200 " Notes: 1) does not indent pure non-xml code (e.g. embedded scripts) " 2) will be confused by unbalanced tags in comments " or CDATA sections. @@ -55,9 +57,6 @@ fun! XmlIndentSynCheck(lnum) if '' != syn1 && syn1 !~ 'xml' && '' != syn2 && syn2 !~ 'xml' " don't indent pure non-xml code return 0 - elseif syn1 =~ '^xmlComment' && syn2 =~ '^xmlComment' - " indent comments specially - return -1 endif endif return 1 diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index ec55cf676a..9f4c26a0ee 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -877,7 +877,7 @@ func s:HandleNewBreakpoint(msg) return endif - let nr = substitute(a:msg, '.*number="\([0-9]\)*\".*', '\1', '') + 0 + let nr = substitute(a:msg, '.*number="\([0-9]*\)".*', '\1', '') + 0 if nr == 0 return endif diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index 89320597f1..c9bb5dc2d4 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Java " Maintainer: Claudio Fleiner -" URL: http://www.fleiner.com/vim/syntax/java.vim -" Last Change: 2015 March 01 +" URL: https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim +" Last Change: 2018 July 26 " Please check :help java.vim for comments on some of the options available. @@ -29,8 +29,6 @@ syn match javaOK "\.\.\." syn match javaError2 "#\|=<" hi def link javaError2 javaError - - " keyword definitions syn keyword javaExternal native package syn match javaExternal "\\(\s\+static\>\)\?" @@ -40,7 +38,7 @@ syn keyword javaRepeat while for do syn keyword javaBoolean true false syn keyword javaConstant null syn keyword javaTypedef this super -syn keyword javaOperator new instanceof +syn keyword javaOperator var new instanceof syn keyword javaType boolean char byte short int long float double syn keyword javaType void syn keyword javaStatement return @@ -54,17 +52,25 @@ syn match javaTypedef "\.\s*\"ms=s+1 syn keyword javaClassDecl enum syn match javaClassDecl "^class\>" syn match javaClassDecl "[^.]\s*\"ms=s+1 -syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>\(([^)]*)\)\=" contains=javaString +syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>" contains=javaString syn match javaClassDecl "@interface\>" syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite syn match javaUserLabelRef "\k\+" contained syn match javaVarArg "\.\.\." syn keyword javaScopeDecl public protected private abstract +" Java Modules(Since Java 9, for "module-info.java" file) +if fnamemodify(bufname("%"), ":t") == "module-info.java" + syn keyword javaModuleStorageClass module transitive + syn keyword javaModuleStmt open requires exports opens uses provides + syn keyword javaModuleExternal to with + syn cluster javaTop add=javaModuleStorageClass,javaModuleStmt,javaModuleExternal +endif + if exists("java_highlight_java_lang_ids") let java_highlight_all=1 endif -if exists("java_highlight_all") || exists("java_highlight_java") || exists("java_highlight_java_lang") +if exists("java_highlight_all") || exists("java_highlight_java") || exists("java_highlight_java_lang") " java.lang.* syn match javaLangClass "\" syn keyword javaR_JavaLang NegativeArraySizeException ArrayStoreException IllegalStateException RuntimeException IndexOutOfBoundsException UnsupportedOperationException ArrayIndexOutOfBoundsException ArithmeticException ClassCastException EnumConstantNotPresentException StringIndexOutOfBoundsException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException NumberFormatException NullPointerException TypeNotPresentException SecurityException @@ -296,6 +302,7 @@ hi def link javaStorageClass StorageClass hi def link javaMethodDecl javaStorageClass hi def link javaClassDecl javaStorageClass hi def link javaScopeDecl javaStorageClass + hi def link javaBoolean Boolean hi def link javaSpecial Special hi def link javaSpecialError Error @@ -329,6 +336,12 @@ hi def link htmlComment Special hi def link htmlCommentPart Special hi def link javaSpaceError Error +if fnamemodify(bufname("%"), ":t") == "module-info.java" + hi def link javaModuleStorageClass StorageClass + hi def link javaModuleStmt Statement + hi def link javaModuleExternal Include +endif + let b:current_syntax = "java" if main_syntax == 'java' diff --git a/runtime/syntax/javascript.vim b/runtime/syntax/javascript.vim index a95ecacb09..78714d0170 100644 --- a/runtime/syntax/javascript.vim +++ b/runtime/syntax/javascript.vim @@ -7,7 +7,7 @@ " (ss) repaired several quoting and grouping glitches " (ss) fixed regex parsing issue with multiple qualifiers [gi] " (ss) additional factoring of keywords, globals, and members -" Last Change: 2012 Oct 05 +" Last Change: 2018 Jul 28 " 2013 Jun 12: adjusted javaScriptRegexpString (Kevin Locke) " 2018 Apr 14: adjusted javaScriptRegexpString (LongJohnCoder) @@ -35,10 +35,13 @@ syn region javaScriptComment start="/\*" end="\*/" contains=@Spell,java syn match javaScriptSpecial "\\\d\d\d\|\\." syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc +syn region javaScriptStringT start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=javaScriptSpecial,javaScriptEmbed,@htmlPreproc + +syn region javaScriptEmbed start=+${+ end=+}+ contains=@javaScriptEmbededExpr syn match javaScriptSpecialCharacter "'\\.'" syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" -syn region javaScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimuys]\{0,2\}\s*$+ end=+/[gimuys]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline +syn region javaScriptRegexpString start=+[,(=+]\s*/[^/*]+ms=e-1,me=e-1 skip=+\\\\\|\\/+ end=+/[gimuys]\{0,2\}\s*$+ end=+/[gimuys]\{0,2\}\s*[+;.,)\]}]+me=e-1 end=+/[gimuys]\{0,2\}\s\+\/+me=e-1 contains=@htmlPreproc,javaScriptComment oneline syn keyword javaScriptConditional if else switch syn keyword javaScriptRepeat while for do in @@ -57,6 +60,8 @@ syn keyword javaScriptMember document event location syn keyword javaScriptDeprecated escape unescape syn keyword javaScriptReserved abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile +syn cluster javaScriptEmbededExpr contains=javaScriptBoolean,javaScriptNull,javaScriptIdentifier,javaScriptStringD,javaScriptStringS,javaScriptStringT + if exists("javaScript_fold") syn match javaScriptFunction "\" syn region javaScriptFunctionFold start="\.*[^};]$" end="^\z1}.*$" transparent fold keepend @@ -87,6 +92,7 @@ hi def link javaScriptCommentTodo Todo hi def link javaScriptSpecial Special hi def link javaScriptStringS String hi def link javaScriptStringD String +hi def link javaScriptStringT String hi def link javaScriptCharacter Character hi def link javaScriptSpecialCharacter javaScriptSpecial hi def link javaScriptNumber javaScriptValue @@ -114,6 +120,8 @@ hi def link javaScriptDeprecated Exception hi def link javaScriptReserved Keyword hi def link javaScriptDebug Debug hi def link javaScriptConstant Label +hi def link javaScriptEmbed Special + let b:current_syntax = "javascript" diff --git a/runtime/syntax/readline.vim b/runtime/syntax/readline.vim index 78472cdbfd..3831ae1149 100644 --- a/runtime/syntax/readline.vim +++ b/runtime/syntax/readline.vim @@ -2,9 +2,9 @@ " Language: readline(3) configuration file " Maintainer: Daniel Moch " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2017-12-25 -" readline_has_bash - if defined add support for bash specific -" settings/functions +" Latest Revision: 2018-07-26 +" Add new functions for Readline 7 / Bash 4.4 +" (credit: Github user bewuethr) if exists('b:current_syntax') finish @@ -111,7 +111,7 @@ syn keyword readlineKeyword contained \ nextgroup=readlineVariable \ skipwhite -syn keyword readlineVariable contained +syn keyword readlineVariable contained \ nextgroup=readlineBellStyle \ skipwhite \ bell-style @@ -120,12 +120,15 @@ syn keyword readlineVariable contained \ nextgroup=readlineBoolean \ skipwhite \ bind-tty-special-chars + \ blink-matching-paren + \ colored-completion-prefix \ colored-stats \ completion-ignore-case \ completion-map-case \ convert-meta \ disable-completion \ echo-control-characters + \ enable-bracketed-paste \ enable-keypad \ enable-meta-key \ expand-tilde @@ -269,6 +272,7 @@ syn keyword readlineFunction contained \ start-kbd-macro \ end-kbd-macro \ call-last-kbd-macro + \ print-last-kbd-macro \ \ re-read-init-file \ abort @@ -339,6 +343,8 @@ syn keyword readlineFunction contained if exists("readline_has_bash") syn keyword readlineFunction contained + \ shell-forward-word + \ shell-backward-word \ shell-expand-line \ history-expand-line \ magic-space @@ -347,6 +353,8 @@ if exists("readline_has_bash") \ insert-last-argument \ operate-and-get-next \ forward-backward-delete-char + \ shell-kill-word + \ shell-backward-kill-word \ delete-char-or-list \ complete-filename \ possible-filename-completions @@ -359,6 +367,7 @@ if exists("readline_has_bash") \ complete-command \ possible-command-completions \ dynamic-complete-history + \ dabbrev-expand \ complete-into-braces \ glob-expand-word \ glob-list-expansions diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim index 232d2a7de3..d620d91f4a 100644 --- a/runtime/syntax/rst.vim +++ b/runtime/syntax/rst.vim @@ -3,7 +3,7 @@ " Maintainer: Marshall Ward " Previous Maintainer: Nikolai Weibull " Website: https://github.com/marshallward/vim-restructuredtext -" Latest Revision: 2016-08-18 +" Latest Revision: 2018-07-23 if exists("b:current_syntax") finish @@ -50,7 +50,10 @@ syn cluster rstDirectives contains=rstFootnote,rstCitation, syn match rstExplicitMarkup '^\s*\.\.\_s' \ nextgroup=@rstDirectives,rstComment,rstSubstitutionDefinition -let s:ReferenceName = '[[:alnum:]]\+\%([_.-][[:alnum:]]\+\)*' +" "Simple reference names are single words consisting of alphanumerics plus +" isolated (no two adjacent) internal hyphens, underscores, periods, colons +" and plus signs." +let s:ReferenceName = '[[:alnum:]]\%([-_.:+]\?[[:alnum:]]\+\)*' syn keyword rstTodo contained FIXME TODO XXX NOTE @@ -83,7 +86,7 @@ execute 'syn region rstExDirective contained matchgroup=rstDirective' . \ ' end=+^\s\@!+ contains=@rstCruft,rstLiteralBlock' execute 'syn match rstSubstitutionDefinition contained' . - \ ' /|' . s:ReferenceName . '|\_s\+/ nextgroup=@rstDirectives' + \ ' /|.*|\_s\+/ nextgroup=@rstDirectives' function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_right) execute 'syn region rst' . a:name . @@ -107,10 +110,10 @@ function! s:DefineInlineMarkup(name, start, middle, end) call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '’', '’') " TODO: Additional Unicode Pd, Po, Pi, Pf, Ps characters - call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|[/:]\)', '') + call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|\%ua0\|[/:]\)', '') execute 'syn match rst' . a:name . - \ ' +\%(^\|\s\|[''"([{/:.,;!?\\-]\)+' @@ -124,14 +127,31 @@ call s:DefineInlineMarkup('InlineLiteral', '``', "", '``') call s:DefineInlineMarkup('SubstitutionReference', '|', '|', '|_\{0,2}') call s:DefineInlineMarkup('InlineInternalTargets', '_`', '`', '`') -syn match rstSections "^\%(\([=`:.'"~^_*+#-]\)\1\+\n\)\=.\+\n\([=`:.'"~^_*+#-]\)\2\+$" +" Sections are identified through their titles, which are marked up with +" adornment: "underlines" below the title text, or underlines and matching +" "overlines" above the title. An underline/overline is a single repeated +" punctuation character that begins in column 1 and forms a line extending at +" least as far as the right edge of the title text. +" +" It is difficult to count characters in a regex, but we at least special-case +" the case where the title has at least three characters to require the +" adornment to have at least three characters as well, in order to handle +" properly the case of a literal block: +" +" this is the end of a paragraph +" :: +" this is a literal block +syn match rstSections "\v^%(([=`:.'"~^_*+#-])\1+\n)?.{1,2}\n([=`:.'"~^_*+#-])\2+$" + \ contains=@Spell +syn match rstSections "\v^%(([=`:.'"~^_*+#-])\1{2,}\n)?.{3,}\n([=`:.'"~^_*+#-])\2{2,}$" + \ contains=@Spell " TODO: Can’t remember why these two can’t be defined like the ones above. execute 'syn match rstFootnoteReference contains=@NoSpell' . - \ ' +\[\%(\d\+\|#\%(' . s:ReferenceName . '\)\=\|\*\)\]_+' + \ ' +\%(\s\|^\)\[\%(\d\+\|#\%(' . s:ReferenceName . '\)\=\|\*\)\]_+' execute 'syn match rstCitationReference contains=@NoSpell' . - \ ' +\[' . s:ReferenceName . '\]_\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' + \ ' +\%(\s\|^\)\[' . s:ReferenceName . '\]_\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' execute 'syn match rstHyperlinkReference' . \ ' /\<' . s:ReferenceName . '__\=\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)/' @@ -140,28 +160,69 @@ syn match rstStandaloneHyperlink contains=@NoSpell \ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]" syn region rstCodeBlock contained matchgroup=rstDirective - \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s\+\w*\_s*\n\ze\z(\s\+\)+ + \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s\+.*\_s*\n\ze\z(\s\+\)+ \ skip=+^$+ \ end=+^\z1\@!+ \ contains=@NoSpell syn cluster rstDirectives add=rstCodeBlock if !exists('g:rst_syntax_code_list') - let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php', - \ 'python', 'perl', 'sh'] + " A mapping from a Vim filetype to a list of alias patterns (pattern + " branches to be specific, see ':help /pattern'). E.g. given: + " + " let g:rst_syntax_code_list = { + " \ 'cpp': ['cpp', 'c++'], + " \ } + " + " then the respective contents of the following two rST directives: + " + " .. code:: cpp + " + " auto i = 42; + " + " .. code:: C++ + " + " auto i = 42; + " + " will both be highlighted as C++ code. As shown by the latter block + " pattern matching will be case-insensitive. + let g:rst_syntax_code_list = { + \ 'vim': ['vim'], + \ 'java': ['java'], + \ 'cpp': ['cpp', 'c++'], + \ 'lisp': ['lisp'], + \ 'php': ['php'], + \ 'python': ['python'], + \ 'perl': ['perl'], + \ 'sh': ['sh'], + \ } +elseif type(g:rst_syntax_code_list) == type([]) + " backward compatibility with former list format + let s:old_spec = g:rst_syntax_code_list + let g:rst_syntax_code_list = {} + for s:elem in s:old_spec + let g:rst_syntax_code_list[s:elem] = [s:elem] + endfor endif -for code in g:rst_syntax_code_list +for s:filetype in keys(g:rst_syntax_code_list) unlet! b:current_syntax " guard against setting 'isk' option which might cause problems (issue #108) let prior_isk = &l:iskeyword - exe 'syn include @rst'.code.' syntax/'.code.'.vim' - exe 'syn region rstDirective'.code.' matchgroup=rstDirective fold' - \.' start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\_s*\n\ze\z(\s\+\)#' + let s:alias_pattern = '' + \.'\%(' + \.join(g:rst_syntax_code_list[s:filetype], '\|') + \.'\)' + + exe 'syn include @rst'.s:filetype.' syntax/'.s:filetype.'.vim' + exe 'syn region rstDirective'.s:filetype + \.' matchgroup=rstDirective fold' + \.' start="\c\%(sourcecode\|code\%(-block\)\=\)::\s\+'.s:alias_pattern.'\_s*\n\ze\z(\s\+\)"' \.' skip=#^$#' \.' end=#^\z1\@!#' - \.' contains=@NoSpell,@rst'.code - exe 'syn cluster rstDirectives add=rstDirective'.code + \.' contains=@NoSpell,@rst'.s:filetype + exe 'syn cluster rstDirectives add=rstDirective'.s:filetype + " reset 'isk' setting, if it has been changed if &l:iskeyword !=# prior_isk let &l:iskeyword = prior_isk @@ -169,6 +230,9 @@ for code in g:rst_syntax_code_list unlet! prior_isk endfor +" Enable top level spell checking +syntax spell toplevel + " TODO: Use better syncing. syn sync minlines=50 linebreaks=2 @@ -189,8 +253,6 @@ hi def link rstHyperlinkTarget String hi def link rstExDirective String hi def link rstSubstitutionDefinition rstDirective hi def link rstDelimiter Delimiter -hi def rstEmphasis ctermfg=13 term=italic cterm=italic gui=italic -hi def rstStrongEmphasis ctermfg=1 term=bold cterm=bold gui=bold hi def link rstInterpretedTextOrHyperlinkReference Identifier hi def link rstInlineLiteral String hi def link rstSubstitutionReference PreProc @@ -200,6 +262,14 @@ hi def link rstCitationReference Identifier hi def link rstHyperLinkReference Identifier hi def link rstStandaloneHyperlink Identifier hi def link rstCodeBlock String +if exists('g:rst_use_emphasis_colors') + " TODO: Less arbitrary color selection + hi def rstEmphasis ctermfg=13 term=italic cterm=italic gui=italic + hi def rstStrongEmphasis ctermfg=1 term=bold cterm=bold gui=bold +else + hi def rstEmphasis term=italic cterm=italic gui=italic + hi def rstStrongEmphasis term=bold cterm=bold gui=bold +endif let b:current_syntax = "rst" diff --git a/src/po/ja.euc-jp.po b/src/po/ja.euc-jp.po index f902a99af1..477a817b03 100644 --- a/src/po/ja.euc-jp.po +++ b/src/po/ja.euc-jp.po @@ -4,7 +4,7 @@ # Do ":help credits" in Vim to see a list of people who contributed. # # Copyright (C) 2001-2018 MURAOKA Taro , -# vim-jp (http://vim-jp.org/) +# vim-jp # # THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. # @@ -14,14 +14,14 @@ msgid "" msgstr "" "Project-Id-Version: Vim 8.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-01 10:46+0900\n" +"POT-Creation-Date: 2018-07-18 00:43+0900\n" "PO-Revision-Date: 2017-05-18 00:45+0900\n" "Last-Translator: MURAOKA Taro \n" -"Language-Team: vim-jp (https://github.com/vim-jp/lang-ja)\n" -"Language: Japanese\n" +"Language-Team: Japanese \n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=euc-jp\n" -"Content-Transfer-Encoding: 8-bit\n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" msgid "E831: bf_key_init() called with empty password" @@ -204,6 +204,9 @@ msgstr "" msgid "E382: Cannot write, 'buftype' option is set" msgstr "E382: 'buftype' ץꤵƤΤǽޤ" +msgid "[Prompt]" +msgstr "[ץץ]" + msgid "[Scratch]" msgstr "[]" @@ -258,10 +261,10 @@ msgstr "E917: %s() msgid "E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel" msgstr "" -"E912: raw nl ⡼ɤΥͥ ch_evalexpr()/ch_sendexpr() ϻȤޤ" +"E912: raw nl ⡼ɤΥͥ ch_evalexpr()/ch_sendexpr() ϻȤޤ" msgid "E906: not an open channel" -msgstr "E906: ƤʤͥǤ" +msgstr "E906: ƤʤͥǤ" msgid "E920: _io file requires _name to be set" msgstr "E920: _io ե _name ꤬ɬפǤ" @@ -521,7 +524,6 @@ msgstr "E710: msgid "E711: List value has not enough items" msgstr "E711: ꥹȷѿ˽ʬʿǤޤ" -# msgid "E690: Missing \"in\" after :for" msgstr "E690: :for θ \"in\" ޤ" @@ -590,7 +592,7 @@ msgid "E910: Using a Job as a Number" msgstr "E910: ֤ͤȤưäƤޤ" msgid "E913: Using a Channel as a Number" -msgstr "E913: ͥͤȤưäƤޤ" +msgstr "E913: ͥͤȤưäƤޤ" msgid "E891: Using a Funcref as a Float" msgstr "E891: ؿȷưȤưäƤޤ" @@ -611,7 +613,7 @@ msgid "E911: Using a Job as a Float" msgstr "E911: ֤ưȤưäƤޤ" msgid "E914: Using a Channel as a Float" -msgstr "E914: ͥưȤưäƤޤ" +msgstr "E914: ͥưȤưäƤޤ" msgid "E729: using Funcref as a String" msgstr "E729: ؿȷʸȤưäƤޤ" @@ -1424,6 +1426,9 @@ msgstr "E784: msgid "Already only one tab page" msgstr "˥֥ڡ1Ĥޤ" +msgid "Edit File in new tab page" +msgstr "֥ڡǥեԽޤ" + msgid "Edit File in new window" msgstr "ɥǥեԽޤ" @@ -2284,10 +2289,10 @@ msgstr " msgid "Open tab..." msgstr "֥ڡ򳫤" -msgid "Find string (use '\\\\' to find a '\\')" +msgid "Find string (use '\\\\' to find a '\\')" msgstr "ʸ ('\\' 򸡺ˤ '\\\\')" -msgid "Find & Replace (use '\\\\' to find a '\\')" +msgid "Find & Replace (use '\\\\' to find a '\\')" msgstr "ִ ('\\' 򸡺ˤ '\\\\')" msgid "Not Used" @@ -2705,6 +2710,19 @@ msgstr " msgid "not allowed in the Vim sandbox" msgstr "ɥܥåǤϵޤ" +#, c-format +msgid "E370: Could not load library %s" +msgstr "E370: 饤֥ %s ɤǤޤǤ" + +msgid "Sorry, this command is disabled: the Perl library could not be loaded." +msgstr "" +"Υޥɤ̵Ǥʤ: Perl饤֥ɤǤޤǤ." + +msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" +msgstr "" +"E299: ɥܥåǤ Safe ⥸塼ѤʤPerlץȤ϶ؤ" +"Ƥޤ" + msgid "E836: This Vim cannot execute :python after using :py3" msgstr "E836: VimǤ :py3 Ȥä :python Ȥޤ" @@ -4703,7 +4721,6 @@ msgstr "E777: ʸ msgid "E369: invalid item in %s%%[]" msgstr "E369: ̵ʹܤǤ: %s%%[]" -# #, c-format msgid "E769: Missing ] after %s[" msgstr "E769: %s[ θ ] ޤ" @@ -4726,15 +4743,12 @@ msgstr "E54: %s( msgid "E55: Unmatched %s)" msgstr "E55: %s) äƤޤ" -# 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%%[" msgstr "E69: %s%%[ θ ] ޤ" @@ -4743,7 +4757,9 @@ msgstr "E69: %s%%[ msgid "E70: Empty %s%%[]" msgstr "E70: %s%%[] Ǥ" -# +msgid "E956: Cannot use pattern recursively" +msgstr "E956: ѥƵŪ˻ȤȤϤǤޤ" + msgid "E65: Illegal back reference" msgstr "E65: ʸȤǤ" @@ -4776,7 +4792,6 @@ msgstr "E61:%s* msgid "E62: Nested %s%c" msgstr "E62:%s%c ҤˤʤäƤޤ" -# msgid "E63: invalid use of \\_" msgstr "E63: \\_ ̵ʻˡǤ" @@ -4784,16 +4799,13 @@ msgstr "E63: \\_ msgid "E64: %s%c follows nothing" msgstr "E64:%s%c θˤʤˤ⤢ޤ" -# msgid "E68: Invalid character after \\z" msgstr "E68: \\z θʸޤ" -# #, c-format msgid "E678: Invalid character after %s%%[dxouU]" msgstr "E678: %s%%[dxouU] θʸޤ" -# #, c-format msgid "E71: Invalid character after %s%%" msgstr "E71: %s%% θʸޤ" @@ -4826,7 +4838,6 @@ msgstr "E865: (NFA) msgid "E866: (NFA regexp) Misplaced %c" msgstr "E866: (NFA ɽ) ֤äƤޤ: %c" -# #, c-format msgid "E877: (NFA regexp) Invalid character class: %ld" msgstr "E877: (NFA ɽ) ̵ʸ饹: %ld" @@ -4864,6 +4875,11 @@ msgstr "E879: (NFA msgid "E873: (NFA regexp) proper termination error" msgstr "E873: (NFA ɽ) ü椬ޤ" +msgid "Could not open temporary log file for writing, displaying on stderr... " +msgstr "" +"NFAɽ󥸥ѤΥեѤȤƳޤ󡣥ɸ२顼" +"Ϥ˽Ϥޤ" + msgid "E874: (NFA) Could not pop the stack!" msgstr "E874: (NFA) åݥåפǤޤ!" @@ -4880,19 +4896,6 @@ msgstr "E876: (NFA msgid "E878: (NFA) Could not allocate memory for branch traversal!" msgstr "E878: (NFA) ߲Υ֥˽ʬʥƤޤ!" -msgid "" -"Could not open temporary log file for writing, displaying on stderr... " -msgstr "" -"NFAɽ󥸥ѤΥեѤȤƳޤ󡣥ɸϤ" -"Ϥޤ" - -#, c-format -msgid "(NFA) COULD NOT OPEN %s !" -msgstr "(NFA) ե %s 򳫤ޤ!" - -msgid "Could not open temporary log file for writing " -msgstr "NFAɽ󥸥ѤΥեѤȤƳޤ" - msgid " VREPLACE" msgstr " ִ" @@ -4983,7 +4986,7 @@ msgstr " #, c-format msgid "Searching included file %s" -msgstr "󥯥롼ɤ줿ե򥹥 %s" +msgstr "󥯥롼ɤ줿ե򸡺 %s" msgid "E387: Match is on current line" msgstr "E387: ߹Ԥ˳ޤ" @@ -5251,7 +5254,7 @@ msgstr " #, c-format msgid "Reading dictionary file %s..." -msgstr "ե %s 򥹥..." +msgstr "ե %s ɹ..." #, c-format msgid "E760: No word count in %s" @@ -5279,7 +5282,7 @@ msgstr " #, c-format msgid "Reading word file %s..." -msgstr "ɸϤɹ %s..." +msgstr "ñե %s ɹ..." #, c-format msgid "Duplicate /encoding= line ignored in %s line %d: %s" @@ -6030,6 +6033,10 @@ msgstr "E133: msgid "E107: Missing parentheses: %s" msgstr "E107: å '(' ޤ: %s" +#, c-format +msgid "%s (%s, compiled %s)" +msgstr "%s (%s, compiled %s)" + msgid "" "\n" "MS-Windows 64-bit GUI version" @@ -6353,19 +6360,6 @@ msgstr "E802: ̵ msgid "E803: ID not found: %ld" msgstr "E803: ID Ϥޤ: %ld" -#, c-format -msgid "E370: Could not load library %s" -msgstr "E370: 饤֥ %s ɤǤޤǤ" - -msgid "Sorry, this command is disabled: the Perl library could not be loaded." -msgstr "" -"Υޥɤ̵Ǥʤ: Perl饤֥ɤǤޤǤ." - -msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" -msgstr "" -"E299: ɥܥåǤ Safe ⥸塼ѤʤPerlץȤ϶ؤ" -"Ƥޤ" - msgid "Edit with &multiple Vims" msgstr "ʣVimԽ (&M)" diff --git a/src/po/ja.po b/src/po/ja.po index 874ee84c81..2dfad1c45b 100644 --- a/src/po/ja.po +++ b/src/po/ja.po @@ -4,7 +4,7 @@ # Do ":help credits" in Vim to see a list of people who contributed. # # Copyright (C) 2001-2018 MURAOKA Taro , -# vim-jp (http://vim-jp.org/) +# vim-jp # # THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. # @@ -14,14 +14,14 @@ msgid "" msgstr "" "Project-Id-Version: Vim 8.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-01 10:46+0900\n" +"POT-Creation-Date: 2018-07-18 00:43+0900\n" "PO-Revision-Date: 2017-05-18 00:45+0900\n" "Last-Translator: MURAOKA Taro \n" -"Language-Team: vim-jp (https://github.com/vim-jp/lang-ja)\n" -"Language: Japanese\n" +"Language-Team: Japanese \n" +"Language: ja\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8-bit\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" msgid "E831: bf_key_init() called with empty password" @@ -204,6 +204,9 @@ msgstr "" msgid "E382: Cannot write, 'buftype' option is set" msgstr "E382: 'buftype' オプションが設定されているので書込めません" +msgid "[Prompt]" +msgstr "[プロンプト]" + msgid "[Scratch]" msgstr "[下書き]" @@ -258,10 +261,10 @@ msgstr "E917: %s() にコールバックは使えません" msgid "E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel" msgstr "" -"E912: raw や nl モードのチャンネルに ch_evalexpr()/ch_sendexpr() は使えません" +"E912: raw や nl モードのチャネルに ch_evalexpr()/ch_sendexpr() は使えません" msgid "E906: not an open channel" -msgstr "E906: 開いていないチャンネルです" +msgstr "E906: 開いていないチャネルです" msgid "E920: _io file requires _name to be set" msgstr "E920: _io ファイルは _name の設定が必要です" @@ -521,7 +524,6 @@ msgstr "E710: リスト型変数にターゲットよりも多い要素があり msgid "E711: List value has not enough items" msgstr "E711: リスト型変数に十分な数の要素がありません" -# msgid "E690: Missing \"in\" after :for" msgstr "E690: :for の後に \"in\" がありません" @@ -590,7 +592,7 @@ msgid "E910: Using a Job as a Number" msgstr "E910: ジョブを数値として扱っています" msgid "E913: Using a Channel as a Number" -msgstr "E913: チャンネルを数値として扱っています" +msgstr "E913: チャネルを数値として扱っています" msgid "E891: Using a Funcref as a Float" msgstr "E891: 関数参照型を浮動小数点数として扱っています" @@ -611,7 +613,7 @@ msgid "E911: Using a Job as a Float" msgstr "E911: ジョブを浮動小数点数として扱っています" msgid "E914: Using a Channel as a Float" -msgstr "E914: チャンネルを浮動小数点数として扱っています" +msgstr "E914: チャネルを浮動小数点数として扱っています" msgid "E729: using Funcref as a String" msgstr "E729: 関数参照型を文字列として扱っています" @@ -1424,6 +1426,9 @@ msgstr "E784: 最後のタブページを閉じることはできません" msgid "Already only one tab page" msgstr "既にタブページは1つしかありません" +msgid "Edit File in new tab page" +msgstr "新しいタブページでファイルを編集します" + msgid "Edit File in new window" msgstr "新しいウィンドウでファイルを編集します" @@ -2284,10 +2289,10 @@ msgstr "アンドゥ(&U)" msgid "Open tab..." msgstr "タブページを開く" -msgid "Find string (use '\\\\' to find a '\\')" +msgid "Find string (use '\\\\' to find a '\\')" msgstr "検索文字列 ('\\' を検索するには '\\\\')" -msgid "Find & Replace (use '\\\\' to find a '\\')" +msgid "Find & Replace (use '\\\\' to find a '\\')" msgstr "検索・置換 ('\\' を検索するには '\\\\')" msgid "Not Used" @@ -2705,6 +2710,19 @@ msgstr "範囲外の行番号です" msgid "not allowed in the Vim sandbox" msgstr "サンドボックスでは許されません" +#, c-format +msgid "E370: Could not load library %s" +msgstr "E370: ライブラリ %s をロードできませんでした" + +msgid "Sorry, this command is disabled: the Perl library could not be loaded." +msgstr "" +"このコマンドは無効です、ごめんなさい: Perlライブラリをロードできませんでした." + +msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" +msgstr "" +"E299: サンドボックスでは Safe モジュールを使用しないPerlスクリプトは禁じられ" +"ています" + msgid "E836: This Vim cannot execute :python after using :py3" msgstr "E836: このVimでは :py3 を使った後に :python を使えません" @@ -4703,7 +4721,6 @@ msgstr "E777: 文字列かリストが必要です" msgid "E369: invalid item in %s%%[]" msgstr "E369: 無効な項目です: %s%%[]" -# #, c-format msgid "E769: Missing ] after %s[" msgstr "E769: %s[ の後に ] がありません" @@ -4726,15 +4743,12 @@ msgstr "E54: %s( が釣り合っていません" msgid "E55: Unmatched %s)" msgstr "E55: %s) が釣り合っていません" -# 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%%[" msgstr "E69: %s%%[ の後に ] がありません" @@ -4743,7 +4757,9 @@ msgstr "E69: %s%%[ の後に ] がありません" msgid "E70: Empty %s%%[]" msgstr "E70: %s%%[] が空です" -# +msgid "E956: Cannot use pattern recursively" +msgstr "E956: パターンを再帰的に使うことはできません" + msgid "E65: Illegal back reference" msgstr "E65: 不正な後方参照です" @@ -4776,7 +4792,6 @@ msgstr "E61:%s* が入れ子になっています" msgid "E62: Nested %s%c" msgstr "E62:%s%c が入れ子になっています" -# msgid "E63: invalid use of \\_" msgstr "E63: \\_ の無効な使用方法です" @@ -4784,16 +4799,13 @@ msgstr "E63: \\_ の無効な使用方法です" msgid "E64: %s%c follows nothing" msgstr "E64:%s%c の後になにもありません" -# msgid "E68: Invalid character after \\z" msgstr "E68: \\z の後に不正な文字がありました" -# #, c-format msgid "E678: Invalid character after %s%%[dxouU]" msgstr "E678: %s%%[dxouU] の後に不正な文字がありました" -# #, c-format msgid "E71: Invalid character after %s%%" msgstr "E71: %s%% の後に不正な文字がありました" @@ -4826,7 +4838,6 @@ msgstr "E865: (NFA) 期待より早く正規表現の終端に到達しました msgid "E866: (NFA regexp) Misplaced %c" msgstr "E866: (NFA 正規表現) 位置が誤っています: %c" -# #, c-format msgid "E877: (NFA regexp) Invalid character class: %ld" msgstr "E877: (NFA 正規表現) 無効な文字クラス: %ld" @@ -4864,6 +4875,11 @@ msgstr "E879: (NFA 正規表現) \\z( が多過ぎます" msgid "E873: (NFA regexp) proper termination error" msgstr "E873: (NFA 正規表現) 終端記号がありません" +msgid "Could not open temporary log file for writing, displaying on stderr... " +msgstr "" +"NFA正規表現エンジン用のログファイルを書込用として開けません。ログは標準エラー" +"出力に出力します。" + msgid "E874: (NFA) Could not pop the stack!" msgstr "E874: (NFA) スタックをポップできません!" @@ -4880,19 +4896,6 @@ msgstr "E876: (NFA 正規表現) NFA全体を保存するには空きスペー msgid "E878: (NFA) Could not allocate memory for branch traversal!" msgstr "E878: (NFA) 現在横断中のブランチに十分なメモリを割り当てられません!" -msgid "" -"Could not open temporary log file for writing, displaying on stderr... " -msgstr "" -"NFA正規表現エンジン用のログファイルを書込用として開けません。ログは標準出力に" -"出力します。" - -#, c-format -msgid "(NFA) COULD NOT OPEN %s !" -msgstr "(NFA) ログファイル %s を開けません!" - -msgid "Could not open temporary log file for writing " -msgstr "NFA正規表現エンジン用のログファイルを書込用として開けません。" - msgid " VREPLACE" msgstr " 仮想置換" @@ -4983,7 +4986,7 @@ msgstr "インクルードされたファイルをスキャン中: %s" #, c-format msgid "Searching included file %s" -msgstr "インクルードされたファイルをスキャン中 %s" +msgstr "インクルードされたファイルを検索中 %s" msgid "E387: Match is on current line" msgstr "E387: 現在行に該当があります" @@ -5251,7 +5254,7 @@ msgstr "値 %s は他の .aff ファイルで使用されたのと異なりま #, c-format msgid "Reading dictionary file %s..." -msgstr "辞書ファイル %s をスキャン中..." +msgstr "辞書ファイル %s を読込み中..." #, c-format msgid "E760: No word count in %s" @@ -5279,7 +5282,7 @@ msgstr "非ASCII文字を含む %d 個の単語を無視しました (%s 内)" #, c-format msgid "Reading word file %s..." -msgstr "標準入力から読込み中 %s..." +msgstr "単語ファイル %s を読込み中..." #, c-format msgid "Duplicate /encoding= line ignored in %s line %d: %s" @@ -6030,6 +6033,10 @@ msgstr "E133: 関数外に :return がありました" msgid "E107: Missing parentheses: %s" msgstr "E107: カッコ '(' がありません: %s" +#, c-format +msgid "%s (%s, compiled %s)" +msgstr "%s (%s, compiled %s)" + msgid "" "\n" "MS-Windows 64-bit GUI version" @@ -6353,19 +6360,6 @@ msgstr "E802: 無効な ID: %ld (1 以上でなければなりません)" msgid "E803: ID not found: %ld" msgstr "E803: ID はありません: %ld" -#, c-format -msgid "E370: Could not load library %s" -msgstr "E370: ライブラリ %s をロードできませんでした" - -msgid "Sorry, this command is disabled: the Perl library could not be loaded." -msgstr "" -"このコマンドは無効です、ごめんなさい: Perlライブラリをロードできませんでした." - -msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" -msgstr "" -"E299: サンドボックスでは Safe モジュールを使用しないPerlスクリプトは禁じられ" -"ています" - msgid "Edit with &multiple Vims" msgstr "複数のVimで編集する (&M)" diff --git a/src/po/ja.sjis.po b/src/po/ja.sjis.po index 840dcda47e..538db72493 100644 --- a/src/po/ja.sjis.po +++ b/src/po/ja.sjis.po @@ -4,7 +4,7 @@ # Do ":help credits" in Vim to see a list of people who contributed. # # Copyright (C) 2001-2018 MURAOKA Taro , -# vim-jp (http://vim-jp.org/) +# vim-jp # # THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. # @@ -14,14 +14,14 @@ msgid "" msgstr "" "Project-Id-Version: Vim 8.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-01 10:46+0900\n" +"POT-Creation-Date: 2018-07-18 00:43+0900\n" "PO-Revision-Date: 2017-05-18 00:45+0900\n" "Last-Translator: MURAOKA Taro \n" -"Language-Team: vim-jp (https://github.com/vim-jp/lang-ja)\n" -"Language: Japanese\n" +"Language-Team: Japanese \n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=cp932\n" -"Content-Transfer-Encoding: 8-bit\n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" msgid "E831: bf_key_init() called with empty password" @@ -204,6 +204,9 @@ msgstr "" msgid "E382: Cannot write, 'buftype' option is set" msgstr "E382: 'buftype' IvVݒ肳Ă̂ŏ߂܂" +msgid "[Prompt]" +msgstr "[vvg]" + msgid "[Scratch]" msgstr "[]" @@ -258,10 +261,10 @@ msgstr "E917: %s() msgid "E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel" msgstr "" -"E912: raw nl [h̃`l ch_evalexpr()/ch_sendexpr() ͎g܂" +"E912: raw nl [h̃`l ch_evalexpr()/ch_sendexpr() ͎g܂" msgid "E906: not an open channel" -msgstr "E906: JĂȂ`lł" +msgstr "E906: JĂȂ`lł" msgid "E920: _io file requires _name to be set" msgstr "E920: _io t@C _name ̐ݒ肪Kvł" @@ -521,7 +524,6 @@ msgstr "E710: msgid "E711: List value has not enough items" msgstr "E711: Xg^ϐɏ\\Ȑ̗vf܂" -# msgid "E690: Missing \"in\" after :for" msgstr "E690: :for ̌ \"in\" ܂" @@ -590,7 +592,7 @@ msgid "E910: Using a Job as a Number" msgstr "E910: Wu𐔒lƂĈĂ܂" msgid "E913: Using a Channel as a Number" -msgstr "E913: `l𐔒lƂĈĂ܂" +msgstr "E913: `l𐔒lƂĈĂ܂" msgid "E891: Using a Funcref as a Float" msgstr "E891: ֐Qƌ^𕂓_ƂĈĂ܂" @@ -611,7 +613,7 @@ msgid "E911: Using a Job as a Float" msgstr "E911: Wu𕂓_ƂĈĂ܂" msgid "E914: Using a Channel as a Float" -msgstr "E914: `l𕂓_ƂĈĂ܂" +msgstr "E914: `l𕂓_ƂĈĂ܂" msgid "E729: using Funcref as a String" msgstr "E729: ֐Qƌ^𕶎ƂĈĂ܂" @@ -1424,6 +1426,9 @@ msgstr "E784: msgid "Already only one tab page" msgstr "Ƀ^uy[W1‚܂" +msgid "Edit File in new tab page" +msgstr "V^uy[WŃt@CҏW܂" + msgid "Edit File in new window" msgstr "VEBhEŃt@CҏW܂" @@ -2284,10 +2289,10 @@ msgstr " msgid "Open tab..." msgstr "^uy[WJ" -msgid "Find string (use '\\\\' to find a '\\')" +msgid "Find string (use '\\\\' to find a '\\')" msgstr " ('\\' ɂ '\\\\')" -msgid "Find & Replace (use '\\\\' to find a '\\')" +msgid "Find & Replace (use '\\\\' to find a '\\')" msgstr "Eu ('\\' ɂ '\\\\')" msgid "Not Used" @@ -2705,6 +2710,19 @@ msgstr " msgid "not allowed in the Vim sandbox" msgstr "Th{bNXł͋܂" +#, c-format +msgid "E370: Could not load library %s" +msgstr "E370: Cu %s [hł܂ł" + +msgid "Sorry, this command is disabled: the Perl library could not be loaded." +msgstr "" +"̃R}h͖łA߂Ȃ: PerlCu[hł܂ł." + +msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" +msgstr "" +"E299: Th{bNXł Safe W[gpȂPerlXNvg͋ւ" +"Ă܂" + msgid "E836: This Vim cannot execute :python after using :py3" msgstr "E836: Vimł :py3 g :python g܂" @@ -4703,7 +4721,6 @@ msgstr "E777: msgid "E369: invalid item in %s%%[]" msgstr "E369: ȍڂł: %s%%[]" -# #, c-format msgid "E769: Missing ] after %s[" msgstr "E769: %s[ ̌ ] ܂" @@ -4726,15 +4743,12 @@ msgstr "E54: %s( msgid "E55: Unmatched %s)" msgstr "E55: %s) ނ荇Ă܂" -# msgid "E66: \\z( not allowed here" msgstr "E66: \\z( ̓RRł͋‚Ă܂" -# msgid "E67: \\z1 - \\z9 not allowed here" -msgstr "E67: \\z1 ̑̓RRł͋‚Ă܂" +msgstr "E67: \\z1 - \\z9 ̓RRł͋‚Ă܂" -# #, c-format msgid "E69: Missing ] after %s%%[" msgstr "E69: %s%%[ ̌ ] ܂" @@ -4743,7 +4757,9 @@ msgstr "E69: %s%%[ msgid "E70: Empty %s%%[]" msgstr "E70: %s%%[] ł" -# +msgid "E956: Cannot use pattern recursively" +msgstr "E956: p^[ċAIɎgƂ͂ł܂" + msgid "E65: Illegal back reference" msgstr "E65: sȌQƂł" @@ -4776,7 +4792,6 @@ msgstr "E61:%s* msgid "E62: Nested %s%c" msgstr "E62:%s%c qɂȂĂ܂" -# msgid "E63: invalid use of \\_" msgstr "E63: \\_ ̖Ȏgp@ł" @@ -4784,16 +4799,13 @@ msgstr "E63: \\_ msgid "E64: %s%c follows nothing" msgstr "E64:%s%c ̌ɂȂɂ܂" -# msgid "E68: Invalid character after \\z" msgstr "E68: \\z ̌ɕsȕ܂" -# #, c-format msgid "E678: Invalid character after %s%%[dxouU]" msgstr "E678: %s%%[dxouU] ̌ɕsȕ܂" -# #, c-format msgid "E71: Invalid character after %s%%" msgstr "E71: %s%% ̌ɕsȕ܂" @@ -4826,7 +4838,6 @@ msgstr "E865: (NFA) msgid "E866: (NFA regexp) Misplaced %c" msgstr "E866: (NFA K\\) ʒuĂ܂: %c" -# #, c-format msgid "E877: (NFA regexp) Invalid character class: %ld" msgstr "E877: (NFA K\\) ȕNX: %ld" @@ -4853,7 +4864,7 @@ msgid "E870: (NFA regexp) Error reading repetition limits" msgstr "E870: (NFA K\\) JԂ̐񐔂ǍɃG[" msgid "E871: (NFA regexp) Can't have a multi follow a multi" -msgstr "E871: (NFA K\\) JԂ ̌ JԂ ͂ł܂!" +msgstr "E871: (NFA K\\) JԂ ̌ JԂ ͂ł܂" msgid "E872: (NFA regexp) Too many '('" msgstr "E872: (NFA K\\) '(' ߂܂" @@ -4864,6 +4875,11 @@ msgstr "E879: (NFA msgid "E873: (NFA regexp) proper termination error" msgstr "E873: (NFA K\\) I[L܂" +msgid "Could not open temporary log file for writing, displaying on stderr... " +msgstr "" +"NFAK\\GWp̃Ot@CpƂĊJ܂BO͕WG[" +"o͂ɏo͂܂B" + msgid "E874: (NFA) Could not pop the stack!" msgstr "E874: (NFA) X^bN|bvł܂!" @@ -4880,19 +4896,6 @@ msgstr "E876: (NFA msgid "E878: (NFA) Could not allocate memory for branch traversal!" msgstr "E878: (NFA) ݉f̃u`ɏ\\ȃ蓖Ă܂!" -msgid "" -"Could not open temporary log file for writing, displaying on stderr... " -msgstr "" -"NFAK\\GWp̃Ot@CpƂĊJ܂BO͕Wo͂" -"o͂܂B" - -#, c-format -msgid "(NFA) COULD NOT OPEN %s !" -msgstr "(NFA) Ot@C %s J܂!" - -msgid "Could not open temporary log file for writing " -msgstr "NFAK\\GWp̃Ot@CpƂĊJ܂B" - msgid " VREPLACE" msgstr " zu" @@ -4983,7 +4986,7 @@ msgstr " #, c-format msgid "Searching included file %s" -msgstr "CN[hꂽt@CXL %s" +msgstr "CN[hꂽt@C %s" msgid "E387: Match is on current line" msgstr "E387: ݍsɊY܂" @@ -5251,7 +5254,7 @@ msgstr " #, c-format msgid "Reading dictionary file %s..." -msgstr "t@C %s XL..." +msgstr "t@C %s Ǎݒ..." #, c-format msgid "E760: No word count in %s" @@ -5279,7 +5282,7 @@ msgstr " #, c-format msgid "Reading word file %s..." -msgstr "W͂Ǎݒ %s..." +msgstr "Pt@C %s Ǎݒ..." #, c-format msgid "Duplicate /encoding= line ignored in %s line %d: %s" @@ -6030,6 +6033,10 @@ msgstr "E133: msgid "E107: Missing parentheses: %s" msgstr "E107: JbR '(' ܂: %s" +#, c-format +msgid "%s (%s, compiled %s)" +msgstr "%s (%s, compiled %s)" + msgid "" "\n" "MS-Windows 64-bit GUI version" @@ -6353,19 +6360,6 @@ msgstr "E802: msgid "E803: ID not found: %ld" msgstr "E803: ID ͂܂: %ld" -#, c-format -msgid "E370: Could not load library %s" -msgstr "E370: Cu %s [hł܂ł" - -msgid "Sorry, this command is disabled: the Perl library could not be loaded." -msgstr "" -"̃R}h͖łA߂Ȃ: PerlCu[hł܂ł." - -msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" -msgstr "" -"E299: Th{bNXł Safe W[gpȂPerlXNvg͋ւ" -"Ă܂" - msgid "Edit with &multiple Vims" msgstr "VimŕҏW (&M)" From 612cc3888b136e80485132d9f997ed457dbc5501 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 29 Jul 2018 15:34:26 +0200 Subject: [PATCH 13/17] patch 8.1.0225: mode() does not indicate using CTRL-O from Insert mode Problem: Mode() does not indicate using CTRL-O from Insert mode. Solution: Add "niI", "niR" and "niV" to mode() result. (closes #3000) --- runtime/doc/eval.txt | 52 +++++++++++++++++++--------------- src/evalfunc.c | 11 +++++-- src/testdir/test_functions.vim | 12 ++++++++ src/version.c | 2 ++ 4 files changed, 51 insertions(+), 26 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 964eab125f..2c9c114396 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -6224,32 +6224,38 @@ mode([expr]) Return a string that indicates the current mode. a non-empty String (|non-zero-arg|), then the full mode is returned, otherwise only the first letter is returned. - n Normal, Terminal-Normal - no Operator-pending - v Visual by character - V Visual by line - CTRL-V Visual blockwise - s Select by character - S Select by line - CTRL-S Select blockwise - i Insert - ic Insert mode completion |compl-generic| - ix Insert mode |i_CTRL-X| completion - R Replace |R| - Rc Replace mode completion |compl-generic| - Rv Virtual Replace |gR| - Rx Replace mode |i_CTRL-X| completion - c Command-line editing - cv Vim Ex mode |gQ| - ce Normal Ex mode |Q| - r Hit-enter prompt - rm The -- more -- prompt - r? A |:confirm| query of some sort - ! Shell or external command is executing - t Terminal-Job mode: keys go to the job + n Normal, Terminal-Normal + no Operator-pending + niI Normal using |i_CTRL-O| in |Insert-mode| + niR Normal using |i_CTRL-O| in |Replace-mode| + niV Normal using |i_CTRL-O| in |Virtual-Replace-mode| + v Visual by character + V Visual by line + CTRL-V Visual blockwise + s Select by character + S Select by line + CTRL-S Select blockwise + i Insert + ic Insert mode completion |compl-generic| + ix Insert mode |i_CTRL-X| completion + R Replace |R| + Rc Replace mode completion |compl-generic| + Rv Virtual Replace |gR| + Rx Replace mode |i_CTRL-X| completion + c Command-line editing + cv Vim Ex mode |gQ| + ce Normal Ex mode |Q| + r Hit-enter prompt + rm The -- more -- prompt + r? A |:confirm| query of some sort + ! Shell or external command is executing + t Terminal-Job mode: keys go to the job This is useful in the 'statusline' option or when used with |remote_expr()| In most other places it always returns "c" or "n". + Note that in the future more modes and more specific modes may + be added. It's better not to compare the whole string but only + the leading character(s). Also see |visualmode()|. mzeval({expr}) *mzeval()* diff --git a/src/evalfunc.c b/src/evalfunc.c index 12eac8d548..40fbf373a4 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -8366,10 +8366,9 @@ f_mkdir(typval_T *argvars, typval_T *rettv) static void f_mode(typval_T *argvars, typval_T *rettv) { - char_u buf[3]; + char_u buf[4]; - buf[1] = NUL; - buf[2] = NUL; + vim_memset(buf, 0, sizeof(buf)); if (time_for_testing == 93784) { @@ -8435,6 +8434,12 @@ f_mode(typval_T *argvars, typval_T *rettv) buf[0] = 'n'; if (finish_op) buf[1] = 'o'; + else if (restart_edit == 'I' || restart_edit == 'R' + || restart_edit == 'V') + { + buf[1] = 'i'; + buf[2] = restart_edit; + } } /* Clear out the minor mode when the argument is not a non-zero number or diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim index 14181fb0a4..41996bd451 100644 --- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -464,6 +464,18 @@ func Test_mode() call assert_equal('n', mode(0)) call assert_equal('n', mode(1)) + " i_CTRL-O + exe "normal i\:call Save_mode()\\" + call assert_equal("n-niI", g:current_modes) + + " R_CTRL-O + exe "normal R\:call Save_mode()\\" + call assert_equal("n-niR", g:current_modes) + + " gR_CTRL-O + exe "normal gR\:call Save_mode()\\" + call assert_equal("n-niV", g:current_modes) + " How to test operator-pending mode? call feedkeys("v", 'xt') diff --git a/src/version.c b/src/version.c index ab58a5c179..1aa6448fbb 100644 --- a/src/version.c +++ b/src/version.c @@ -798,6 +798,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 225, /**/ 224, /**/ From 1f0bfe561737cd445532f20d7607a81d1dadddee Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 29 Jul 2018 16:09:22 +0200 Subject: [PATCH 14/17] patch 8.1.0226: too many #ifdefs Problem: Too many #ifdefs. Solution: Graduate the +vreplace feature, it's not much code and quite a few #ifdefs. --- runtime/doc/change.txt | 4 -- runtime/doc/various.txt | 2 +- src/edit.c | 87 +++-------------------------------------- src/evalfunc.c | 4 -- src/feature.h | 7 ---- src/globals.h | 2 - src/gui.c | 2 - src/macros.h | 6 +-- src/misc1.c | 34 +++------------- src/misc2.c | 2 - src/normal.c | 10 +---- src/ops.c | 2 - src/screen.c | 5 +-- src/version.c | 6 +-- src/vim.h | 6 +-- 15 files changed, 21 insertions(+), 158 deletions(-) diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 703d336642..1ad2930d44 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -177,8 +177,6 @@ gR Enter Virtual Replace mode: Each character you type may replace several characters at once. Repeat the entered text [count]-1 times. See |Virtual-Replace-mode| for more details. - {not available when compiled without the |+vreplace| - feature} *c* ["x]c{motion} Delete {motion} text [into register x] and start @@ -303,8 +301,6 @@ gr{char} Replace the virtual characters under the cursor with space. See |gR| and |Virtual-Replace-mode| for more details. As with |r| a count may be given. {char} can be entered like with |r|. - {not available when compiled without the |+vreplace| - feature} *digraph-arg* The argument for Normal mode commands like |r| and |t| is a single character. diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index bd2b35ed74..48d63cd8a3 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -461,7 +461,7 @@ N *+viminfo* |'viminfo'| N *+virtualedit* |'virtualedit'| S *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200. N *+visualextra* extra Visual mode commands |blockwise-operators| -N *+vreplace* |gR| and |gr| +T *+vreplace* |gR| and |gr| *+vtp* on MS-Windows console: support for 'termguicolors' N *+wildignore* |'wildignore'| N *+wildmenu* |'wildmenu'| diff --git a/src/edit.c b/src/edit.c index e121506239..b0b44e606c 100644 --- a/src/edit.c +++ b/src/edit.c @@ -463,7 +463,6 @@ edit( { ResetRedobuff(); AppendNumberToRedobuff(count); -#ifdef FEAT_VREPLACE if (cmdchar == 'V' || cmdchar == 'v') { /* "gR" or "gr" command */ @@ -471,7 +470,6 @@ edit( AppendCharToRedobuff((cmdchar == 'v') ? 'r' : 'R'); } else -#endif { if (cmdchar == K_PS) AppendCharToRedobuff('a'); @@ -497,7 +495,6 @@ edit( #endif State = REPLACE; } -#ifdef FEAT_VREPLACE else if (cmdchar == 'V' || cmdchar == 'v') { State = VREPLACE; @@ -505,7 +502,6 @@ edit( orig_line_count = curbuf->b_ml.ml_line_count; vr_lines_changed = 1; } -#endif else State = INSERT; @@ -2042,7 +2038,6 @@ change_indent( int save_p_list; int start_col; colnr_T vc; -#ifdef FEAT_VREPLACE colnr_T orig_col = 0; /* init for GCC */ char_u *new_line, *orig_line = NULL; /* init for GCC */ @@ -2052,7 +2047,6 @@ change_indent( orig_line = vim_strsave(ml_get_curline()); /* Deal with NULL below */ orig_col = curwin->w_cursor.col; } -#endif /* for the following tricks we don't want list mode */ save_p_list = curwin->w_p_list; @@ -2091,17 +2085,13 @@ change_indent( (void)set_indent(amount, call_changed_bytes ? SIN_CHANGED : 0); else { -#ifdef FEAT_VREPLACE int save_State = State; /* Avoid being called recursively. */ if (State & VREPLACE_FLAG) State = INSERT; -#endif shift_line(type == INDENT_DEC, round, 1, call_changed_bytes); -#ifdef FEAT_VREPLACE State = save_State; -#endif } insstart_less -= curwin->w_cursor.col; @@ -2233,7 +2223,6 @@ change_indent( } } -#ifdef FEAT_VREPLACE /* * For VREPLACE mode, we also have to fix the replace stack. In this case * it is always possible because we backspace over the whole line and then @@ -2266,7 +2255,6 @@ change_indent( vim_free(new_line); } -#endif } /* @@ -2288,8 +2276,6 @@ truncate_spaces(char_u *line) line[i + 1] = NUL; } -#if defined(FEAT_VREPLACE) || defined(FEAT_INS_EXPAND) \ - || defined(FEAT_COMMENTS) || defined(PROTO) /* * Backspace the cursor until the given column. Handles REPLACE and VREPLACE * modes correctly. May also be used when not in insert mode at all. @@ -2308,7 +2294,6 @@ backspace_until_column(int col) break; } } -#endif /* * Like del_char(), but make sure not to go before column "limit_col". @@ -6224,9 +6209,7 @@ insertchar( && (force_format || (!VIM_ISWHITE(c) && !((State & REPLACE_FLAG) -#ifdef FEAT_VREPLACE && !(State & VREPLACE_FLAG) -#endif && *ml_get_cursor() != NUL) && (curwin->w_cursor.lnum != Insstart.lnum || ((!has_format_option(FO_INS_LONG) @@ -6471,11 +6454,7 @@ internal_format( * When 'ai' is off we don't want a space under the cursor to be * deleted. Replace it with an 'x' temporarily. */ - if (!curbuf->b_p_ai -#ifdef FEAT_VREPLACE - && !(State & VREPLACE_FLAG) -#endif - ) + if (!curbuf->b_p_ai && !(State & VREPLACE_FLAG)) { cc = gchar_cursor(); if (VIM_ISWHITE(cc)) @@ -6496,10 +6475,8 @@ internal_format( int end_foundcol = 0; /* column for start of word */ colnr_T len; colnr_T virtcol; -#ifdef FEAT_VREPLACE int orig_col = 0; char_u *saved_text = NULL; -#endif colnr_T col; colnr_T end_col; @@ -6669,11 +6646,9 @@ internal_format( * stack functions. VREPLACE does not use this, and backspaces * over the text instead. */ -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) orig_col = startcol; /* Will start backspacing from here */ else -#endif replace_offset = startcol - end_foundcol; /* @@ -6688,7 +6663,6 @@ internal_format( if (startcol < 0) startcol = 0; -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { /* @@ -6706,7 +6680,6 @@ internal_format( backspace_until_column(foundcol); } else -#endif { /* put cursor after pos. to break line */ if (!fo_white_par) @@ -6744,12 +6717,10 @@ internal_format( get_number_indent(curwin->w_cursor.lnum - 1); if (second_indent >= 0) { -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) change_indent(INDENT_SET, second_indent, FALSE, NUL, TRUE); else -#endif #ifdef FEAT_COMMENTS if (leader_len > 0 && second_indent - leader_len > 0) { @@ -6778,7 +6749,6 @@ internal_format( first_line = FALSE; } -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { /* @@ -6789,7 +6759,6 @@ internal_format( vim_free(saved_text); } else -#endif { /* * Check if cursor is not past the NUL off the line, cindent @@ -7140,13 +7109,11 @@ stop_arrow(void) } ai_col = 0; -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { orig_line_count = curbuf->b_ml.ml_line_count; vr_lines_changed = 1; } -#endif ResetRedobuff(); AppendToRedobuff((char_u *)"1i"); /* pretend we start an insertion */ new_insert_skip = 2; @@ -7983,7 +7950,6 @@ replace_flush(void) replace_do_bs(int limit_col) { int cc; -#ifdef FEAT_VREPLACE int orig_len = 0; int ins_len; int orig_vcols = 0; @@ -7991,12 +7957,10 @@ replace_do_bs(int limit_col) char_u *p; int i; int vcol; -#endif cc = replace_pop(); if (cc > 0) { -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { /* Get the number of screen cells used by the character we are @@ -8004,29 +7968,23 @@ replace_do_bs(int limit_col) getvcol(curwin, &curwin->w_cursor, NULL, &start_vcol, NULL); orig_vcols = chartabsize(ml_get_cursor(), start_vcol); } -#endif #ifdef FEAT_MBYTE if (has_mbyte) { (void)del_char_after_col(limit_col); -# ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) orig_len = (int)STRLEN(ml_get_cursor()); -# endif replace_push(cc); } else #endif { pchar_cursor(cc); -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) orig_len = (int)STRLEN(ml_get_cursor()) - 1; -#endif } replace_pop_ins(); -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { /* Get the number of screen cells used by the inserted characters */ @@ -8052,7 +8010,6 @@ replace_do_bs(int limit_col) } curwin->w_cursor.col -= ins_len; } -#endif /* mark the buffer as changed and prepare for displaying */ changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col); @@ -8966,11 +8923,9 @@ ins_insert(int replaceState) # ifdef FEAT_EVAL set_vim_var_string(VV_INSERTMODE, - (char_u *)((State & REPLACE_FLAG) ? "i" : -# ifdef FEAT_VREPLACE - replaceState == VREPLACE ? "v" : -# endif - "r"), 1); + (char_u *)((State & REPLACE_FLAG) ? "i" + : replaceState == VREPLACE ? "v" + : "r"), 1); # endif apply_autocmds(EVENT_INSERTCHANGE, NULL, NULL, FALSE, curbuf); if (State & REPLACE_FLAG) @@ -8990,11 +8945,9 @@ ins_insert(int replaceState) static void ins_ctrl_o(void) { -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) restart_edit = 'V'; else -#endif if (State & REPLACE_FLAG) restart_edit = 'R'; else @@ -9067,14 +9020,12 @@ ins_del(void) else { curwin->w_cursor.col = temp; -#ifdef FEAT_VREPLACE /* Adjust orig_line_count in case more lines have been deleted than * have been added. That makes sure, that open_line() later * can access all buffer lines correctly */ if (State & VREPLACE_FLAG && orig_line_count > curbuf->b_ml.ml_line_count) orig_line_count = curbuf->b_ml.ml_line_count; -#endif } } else if (del_char(FALSE) == FAIL) /* delete char under cursor */ @@ -9229,10 +9180,8 @@ ins_bs( } else { -#ifdef FEAT_VREPLACE if (!(State & VREPLACE_FLAG) || curwin->w_cursor.lnum > orig_line_count) -#endif { temp = gchar_cursor(); /* remember current char */ --curwin->w_cursor.lnum; @@ -9256,10 +9205,8 @@ ins_bs( if (temp == NUL && gchar_cursor() != NUL) inc_cursor(); } -#ifdef FEAT_VREPLACE else dec_cursor(); -#endif /* * In REPLACE mode we have to put back the text that was replaced @@ -9386,11 +9333,9 @@ ins_bs( && curwin->w_cursor.col < Insstart_orig.col) Insstart_orig.col = curwin->w_cursor.col; -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) ins_char(' '); else -#endif { ins_str((char_u *)" "); if ((State & REPLACE_FLAG)) @@ -10231,11 +10176,9 @@ ins_tab(void) ins_char(' '); while (--temp > 0) { -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) ins_char(' '); else -#endif { ins_str((char_u *)" "); if (State & REPLACE_FLAG) /* no char replaced */ @@ -10255,10 +10198,8 @@ ins_tab(void) #endif { char_u *ptr; -#ifdef FEAT_VREPLACE char_u *saved_line = NULL; /* init for GCC */ pos_T pos; -#endif pos_T fpos; pos_T *cursor; colnr_T want_vcol, vcol; @@ -10269,7 +10210,6 @@ ins_tab(void) * Get the current line. For VREPLACE mode, don't make real changes * yet, just work on a copy of the line. */ -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { pos = curwin->w_cursor; @@ -10280,7 +10220,6 @@ ins_tab(void) ptr = saved_line + pos.col; } else -#endif { ptr = ml_get_cursor(); cursor = &curwin->w_cursor; @@ -10360,11 +10299,7 @@ ins_tab(void) { STRMOVE(ptr, ptr + i); /* correct replace stack. */ - if ((State & REPLACE_FLAG) -#ifdef FEAT_VREPLACE - && !(State & VREPLACE_FLAG) -#endif - ) + if ((State & REPLACE_FLAG) && !(State & VREPLACE_FLAG)) for (temp = i; --temp >= 0; ) replace_join(repl_off); } @@ -10378,7 +10313,6 @@ ins_tab(void) #endif cursor->col -= i; -#ifdef FEAT_VREPLACE /* * In VREPLACE mode, we haven't changed anything yet. Do it now by * backspacing over the changed spacing and then inserting the new @@ -10394,13 +10328,10 @@ ins_tab(void) ins_bytes_len(saved_line + change_col, cursor->col - change_col); } -#endif } -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) vim_free(saved_line); -#endif curwin->w_p_list = save_list; } @@ -10427,11 +10358,7 @@ ins_eol(int c) * character under the cursor. Only push a NUL on the replace stack, * nothing to put back when the NL is deleted. */ - if ((State & REPLACE_FLAG) -#ifdef FEAT_VREPLACE - && !(State & VREPLACE_FLAG) -#endif - ) + if ((State & REPLACE_FLAG) && !(State & VREPLACE_FLAG)) replace_push(NUL); /* @@ -10700,11 +10627,9 @@ ins_try_si(int c) curwin->w_cursor = *pos; i = get_indent(); curwin->w_cursor = old_pos; -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) change_indent(INDENT_SET, i, FALSE, NUL, TRUE); else -#endif (void)set_indent(i, SIN_CHANGED); } else if (curwin->w_cursor.col > 0) diff --git a/src/evalfunc.c b/src/evalfunc.c index 40fbf373a4..31096d75db 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -6450,9 +6450,7 @@ f_has(typval_T *argvars, typval_T *rettv) #ifdef FEAT_VISUALEXTRA "visualextra", #endif -#ifdef FEAT_VREPLACE "vreplace", -#endif #ifdef FEAT_VTP "vtp", #endif @@ -8400,14 +8398,12 @@ f_mode(typval_T *argvars, typval_T *rettv) buf[0] = '!'; else if (State & INSERT) { -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { buf[0] = 'R'; buf[1] = 'v'; } else -#endif { if (State & REPLACE_FLAG) buf[0] = 'R'; diff --git a/src/feature.h b/src/feature.h index 762a70cee7..efe349d54f 100644 --- a/src/feature.h +++ b/src/feature.h @@ -206,13 +206,6 @@ # define FEAT_VIRTUALEDIT #endif -/* - * +vreplace "gR" and "gr" commands. - */ -#ifdef FEAT_NORMAL -# define FEAT_VREPLACE -#endif - /* * +cmdline_info 'showcmd' and 'ruler' options. */ diff --git a/src/globals.h b/src/globals.h index 0bb7de5ca5..9cf8455bc8 100644 --- a/src/globals.h +++ b/src/globals.h @@ -778,13 +778,11 @@ EXTERN pos_T Insstart; /* This is where the latest * op_insert(), to detect correctly where inserting by the user started. */ EXTERN pos_T Insstart_orig; -#ifdef FEAT_VREPLACE /* * Stuff for VREPLACE mode. */ EXTERN int orig_line_count INIT(= 0); /* Line count when "gR" started */ EXTERN int vr_lines_changed INIT(= 0); /* #Lines changed by "gR" so far */ -#endif #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) /* argument to SETJMP() for handling X IO errors */ diff --git a/src/gui.c b/src/gui.c index f51b81f867..15adb1f1df 100644 --- a/src/gui.c +++ b/src/gui.c @@ -3181,10 +3181,8 @@ button_set: case SELECTMODE: checkfor = MOUSE_VISUAL; break; case REPLACE: case REPLACE+LANGMAP: -# ifdef FEAT_VREPLACE case VREPLACE: case VREPLACE+LANGMAP: -# endif case INSERT: case INSERT+LANGMAP: checkfor = MOUSE_INSERT; break; case ASKMORE: diff --git a/src/macros.h b/src/macros.h index c91b4b6205..1654e3e558 100644 --- a/src/macros.h +++ b/src/macros.h @@ -235,11 +235,7 @@ # define TIME_MSG(s) do { /**/ } while (0) #endif -#ifdef FEAT_VREPLACE -# define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG)) -#else -# define REPLACE_NORMAL(s) ((s) & REPLACE_FLAG) -#endif +#define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG)) #ifdef FEAT_ARABIC # define UTF_COMPOSINGLIKE(p1, p2) utf_composinglike((p1), (p2)) diff --git a/src/misc1.c b/src/misc1.c index ab5f6f7319..1647aa9524 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -784,10 +784,7 @@ open_line( char_u *leader = NULL; /* copy of comment leader */ #endif char_u *allocated = NULL; /* allocated memory */ -#if defined(FEAT_SMARTINDENT) || defined(FEAT_VREPLACE) || defined(FEAT_LISP) \ - || defined(FEAT_CINDENT) || defined(FEAT_COMMENTS) char_u *p; -#endif int saved_char = NUL; /* init for GCC */ #if defined(FEAT_SMARTINDENT) || defined(FEAT_COMMENTS) pos_T *pos; @@ -804,7 +801,7 @@ open_line( int no_si = FALSE; /* reset did_si afterwards */ int first_char = NUL; /* init for GCC */ #endif -#if defined(FEAT_VREPLACE) && (defined(FEAT_LISP) || defined(FEAT_CINDENT)) +#if defined(FEAT_LISP) || defined(FEAT_CINDENT) int vreplace_mode; #endif int did_append; /* appended a new line */ @@ -817,7 +814,6 @@ open_line( if (saved_line == NULL) /* out of memory! */ return FALSE; -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { /* @@ -857,13 +853,8 @@ open_line( } saved_line[curwin->w_cursor.col] = NUL; } -#endif - if ((State & INSERT) -#ifdef FEAT_VREPLACE - && !(State & VREPLACE_FLAG) -#endif - ) + if ((State & INSERT) && !(State & VREPLACE_FLAG)) { p_extra = saved_line + curwin->w_cursor.col; #ifdef FEAT_SMARTINDENT @@ -1601,9 +1592,7 @@ open_line( old_cursor = curwin->w_cursor; if (dir == BACKWARD) --curwin->w_cursor.lnum; -#ifdef FEAT_VREPLACE if (!(State & VREPLACE_FLAG) || old_cursor.lnum >= orig_line_count) -#endif { if (ml_append(curwin->w_cursor.lnum, p_extra, (colnr_T)0, FALSE) == FAIL) @@ -1620,7 +1609,6 @@ open_line( mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L); did_append = TRUE; } -#ifdef FEAT_VREPLACE else { /* @@ -1640,7 +1628,6 @@ open_line( curwin->w_cursor.lnum--; did_append = FALSE; } -#endif if (newindent #ifdef FEAT_SMARTINDENT @@ -1744,7 +1731,7 @@ open_line( curwin->w_cursor.coladd = 0; #endif -#if defined(FEAT_VREPLACE) && (defined(FEAT_LISP) || defined(FEAT_CINDENT)) +#if defined(FEAT_LISP) || defined(FEAT_CINDENT) /* * In VREPLACE mode, we are handling the replace stack ourselves, so stop * fixthisline() from doing it (via change_indent()) by telling it we're in @@ -1791,12 +1778,11 @@ open_line( ai_col = (colnr_T)getwhitecols_curline(); } #endif -#if defined(FEAT_VREPLACE) && (defined(FEAT_LISP) || defined(FEAT_CINDENT)) +#if defined(FEAT_LISP) || defined(FEAT_CINDENT) if (vreplace_mode != 0) State = vreplace_mode; #endif -#ifdef FEAT_VREPLACE /* * Finally, VREPLACE gets the stuff on the new line, then puts back the * original line, and inserts the new stuff char by char, pushing old stuff @@ -1821,7 +1807,6 @@ open_line( vim_free(p_extra); next_line = NULL; } -#endif retval = OK; /* success! */ theend: @@ -2307,7 +2292,6 @@ plines_m_win(win_T *wp, linenr_T first, linenr_T last) return (count); } -#if defined(FEAT_VREPLACE) || defined(FEAT_INS_EXPAND) || defined(PROTO) /* * Insert string "p" at the cursor position. Stops at a NUL byte. * Handles Replace mode and multi-byte characters. @@ -2317,10 +2301,7 @@ ins_bytes(char_u *p) { ins_bytes_len(p, (int)STRLEN(p)); } -#endif -#if defined(FEAT_VREPLACE) || defined(FEAT_INS_EXPAND) \ - || defined(FEAT_COMMENTS) || defined(FEAT_MBYTE) || defined(PROTO) /* * Insert string "p" with length "len" at the cursor position. * Handles Replace mode and multi-byte characters. @@ -2329,7 +2310,7 @@ ins_bytes(char_u *p) ins_bytes_len(char_u *p, int len) { int i; -# ifdef FEAT_MBYTE +#ifdef FEAT_MBYTE int n; if (has_mbyte) @@ -2343,11 +2324,10 @@ ins_bytes_len(char_u *p, int len) ins_char_bytes(p + i, n); } else -# endif +#endif for (i = 0; i < len; ++i) ins_char(p[i]); } -#endif /* * Insert or replace a single character at the cursor position. @@ -2406,7 +2386,6 @@ ins_char_bytes(char_u *buf, int charlen) if (State & REPLACE_FLAG) { -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) { colnr_T new_vcol = 0; /* init for GCC */ @@ -2456,7 +2435,6 @@ ins_char_bytes(char_u *buf, int charlen) curwin->w_p_list = old_list; } else -#endif if (oldp[col] != NUL) { /* normal replace */ diff --git a/src/misc2.c b/src/misc2.c index 4a4908c199..b7716cea13 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -3766,10 +3766,8 @@ get_shape_idx(int mouse) #endif if (!mouse && State == SHOWMATCH) return SHAPE_IDX_SM; -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) return SHAPE_IDX_R; -#endif if (State & REPLACE_FLAG) return SHAPE_IDX_R; if (State & INSERT) diff --git a/src/normal.c b/src/normal.c index 4e36d56074..f3cd664a66 100644 --- a/src/normal.c +++ b/src/normal.c @@ -111,9 +111,7 @@ static void nv_findpar(cmdarg_T *cap); static void nv_undo(cmdarg_T *cap); static void nv_kundo(cmdarg_T *cap); static void nv_Replace(cmdarg_T *cap); -#ifdef FEAT_VREPLACE static void nv_vreplace(cmdarg_T *cap); -#endif static void v_swap_corners(int cmdchar); static void nv_replace(cmdarg_T *cap); static void n_swapchar(cmdarg_T *cap); @@ -7300,7 +7298,6 @@ nv_Replace(cmdarg_T *cap) } } -#ifdef FEAT_VREPLACE /* * "gr". */ @@ -7323,15 +7320,14 @@ nv_vreplace(cmdarg_T *cap) cap->extra_char = get_literal(); stuffcharReadbuff(cap->extra_char); stuffcharReadbuff(ESC); -# ifdef FEAT_VIRTUALEDIT +#ifdef FEAT_VIRTUALEDIT if (virtual_active()) coladvance(getviscol()); -# endif +#endif invoke_edit(cap, TRUE, 'v', FALSE); } } } -#endif /* * Swap case for "~" command, when it does not work like an operator. @@ -7944,7 +7940,6 @@ nv_g_cmd(cmdarg_T *cap) clearopbeep(oap); break; -#ifdef FEAT_VREPLACE /* * "gR": Enter virtual replace mode. */ @@ -7956,7 +7951,6 @@ nv_g_cmd(cmdarg_T *cap) case 'r': nv_vreplace(cap); break; -#endif case '&': do_cmdline_cmd((char_u *)"%s//~/&"); diff --git a/src/ops.c b/src/ops.c index 26e15f753e..50ebf44495 100644 --- a/src/ops.c +++ b/src/ops.c @@ -376,11 +376,9 @@ shift_line( } /* Set new indent */ -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) change_indent(INDENT_SET, count, FALSE, NUL, call_changed_bytes); else -#endif (void)set_indent(count, call_changed_bytes ? SIN_CHANGED : 0); } diff --git a/src/screen.c b/src/screen.c index 954beef95e..4dfbfec892 100644 --- a/src/screen.c +++ b/src/screen.c @@ -10375,12 +10375,9 @@ showmode(void) else #endif { -#ifdef FEAT_VREPLACE if (State & VREPLACE_FLAG) MSG_PUTS_ATTR(_(" VREPLACE"), attr); - else -#endif - if (State & REPLACE_FLAG) + else if (State & REPLACE_FLAG) MSG_PUTS_ATTR(_(" REPLACE"), attr); else if (State & INSERT) { diff --git a/src/version.c b/src/version.c index 1aa6448fbb..ff1c00a08a 100644 --- a/src/version.c +++ b/src/version.c @@ -714,11 +714,7 @@ static char *(features[]) = #else "-viminfo", #endif -#ifdef FEAT_VREPLACE "+vreplace", -#else - "-vreplace", -#endif #ifdef WIN3264 # ifdef FEAT_VTP "+vtp", @@ -798,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 226, /**/ 225, /**/ diff --git a/src/vim.h b/src/vim.h index fb476c5297..a85d47f5eb 100644 --- a/src/vim.h +++ b/src/vim.h @@ -675,10 +675,8 @@ extern int (*dyn_libintl_putenv)(const char *envstring); #define REPLACE_FLAG 0x40 /* Replace mode flag */ #define REPLACE (REPLACE_FLAG + INSERT) -#ifdef FEAT_VREPLACE -# define VREPLACE_FLAG 0x80 /* Virtual-replace mode flag */ -# define VREPLACE (REPLACE_FLAG + VREPLACE_FLAG + INSERT) -#endif +#define VREPLACE_FLAG 0x80 /* Virtual-replace mode flag */ +#define VREPLACE (REPLACE_FLAG + VREPLACE_FLAG + INSERT) #define LREPLACE (REPLACE_FLAG + LANGMAP) #define NORMAL_BUSY (0x100 + NORMAL) /* Normal mode, busy with a command */ From fda95e75721fb221495c69e493ec2761b5d85123 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 29 Jul 2018 16:13:17 +0200 Subject: [PATCH 15/17] patch 8.1.0227: spaces instead of tabs in makefile Problem: Spaces instead of tabs in makefile. Solution: Use tabs and fix sorting. (Ken Takata) --- src/po/Make_all.mak | 4 ++-- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/po/Make_all.mak b/src/po/Make_all.mak index eabab38282..e16b9acf2b 100644 --- a/src/po/Make_all.mak +++ b/src/po/Make_all.mak @@ -21,6 +21,7 @@ LANGUAGES = \ ja.sjis \ ko \ ko.UTF-8 \ + lv \ nb \ nl \ no \ @@ -42,7 +43,6 @@ LANGUAGES = \ zh_CN.cp936 \ zh_TW \ zh_TW.UTF-8 \ - lv \ MOFILES = \ @@ -61,6 +61,7 @@ MOFILES = \ ja.mo \ ko.UTF-8.mo \ ko.mo \ + lv.mo \ nb.mo \ nl.mo \ no.mo \ @@ -76,7 +77,6 @@ MOFILES = \ zh_CN.mo \ zh_TW.UTF-8.mo \ zh_TW.mo \ - lv.mo \ MOCONVERTED = \ diff --git a/src/version.c b/src/version.c index ff1c00a08a..652835526f 100644 --- a/src/version.c +++ b/src/version.c @@ -794,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 227, /**/ 226, /**/ From 92d147be959e689f8f58fd5d138a31835e160289 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 29 Jul 2018 17:35:23 +0200 Subject: [PATCH 16/17] patch 8.1.0228: dropping files is ignored while Vim is busy Problem: Dropping files is ignored while Vim is busy. Solution: Postpone the effect of dropping files until it's safe. --- src/ex_docmd.c | 126 +++++++++++++++++++++++++++++------------ src/gui.c | 70 +++++++++++++---------- src/gui.h | 5 +- src/gui_mac.c | 95 +++++++++++++++++-------------- src/main.c | 10 +++- src/proto/ex_docmd.pro | 3 +- src/screen.c | 6 ++ src/version.c | 2 + 8 files changed, 202 insertions(+), 115 deletions(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 54fb6aba1c..6682286210 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -7859,57 +7859,37 @@ ex_shell(exarg_T *eap UNUSED) do_shell(NULL, 0); } -#if defined(HAVE_DROP_FILE) \ - || (defined(FEAT_GUI_GTK) && defined(FEAT_DND)) \ - || defined(FEAT_GUI_MSWIN) \ - || defined(FEAT_GUI_MAC) \ - || defined(PROTO) +#if defined(HAVE_DROP_FILE) || defined(PROTO) -/* - * Handle a file drop. The code is here because a drop is *nearly* like an - * :args command, but not quite (we have a list of exact filenames, so we - * don't want to (a) parse a command line, or (b) expand wildcards. So the - * code is very similar to :args and hence needs access to a lot of the static - * functions in this file. - * - * The list should be allocated using alloc(), as should each item in the - * list. This function takes over responsibility for freeing the list. - * - * XXX The list is made into the argument list. This is freed using - * FreeWild(), which does a series of vim_free() calls. - */ - void -handle_drop( - int filec, /* the number of files dropped */ - char_u **filev, /* the list of files dropped */ - int split) /* force splitting the window */ +static int drop_busy = FALSE; +static int drop_filec; +static char_u **drop_filev = NULL; +static int drop_split; +static void (*drop_callback)(void *); +static void *drop_cookie; + + static void +handle_drop_internal(void) { exarg_T ea; int save_msg_scroll = msg_scroll; - /* Postpone this while editing the command line. */ - if (text_locked()) - return; - if (curbuf_locked()) - return; - - /* When the screen is being updated we should not change buffers and - * windows structures, it may cause freed memory to be used. */ - if (updating_screen) - return; + // Setting the argument list may cause screen updates and being called + // recursively. Avoid that by setting drop_busy. + drop_busy = TRUE; /* Check whether the current buffer is changed. If so, we will need * to split the current window or data could be lost. * We don't need to check if the 'hidden' option is set, as in this * case the buffer won't be lost. */ - if (!buf_hide(curbuf) && !split) + if (!buf_hide(curbuf) && !drop_split) { ++emsg_off; - split = check_changed(curbuf, CCGD_AW); + drop_split = check_changed(curbuf, CCGD_AW); --emsg_off; } - if (split) + if (drop_split) { if (win_split(0, 0) == FAIL) return; @@ -7924,7 +7904,7 @@ handle_drop( /* * Set up the new argument list. */ - alist_set(ALIST(curwin), filec, filev, FALSE, NULL, 0); + alist_set(ALIST(curwin), drop_filec, drop_filev, FALSE, NULL, 0); /* * Move to the first file. @@ -7942,6 +7922,78 @@ handle_drop( * unexpectedly. The screen will be redrawn by the caller, thus * msg_scroll being set by displaying a message is irrelevant. */ msg_scroll = save_msg_scroll; + + if (drop_callback != NULL) + drop_callback(drop_cookie); + + drop_filev = NULL; + drop_busy = FALSE; +} + +/* + * Handle a file drop. The code is here because a drop is *nearly* like an + * :args command, but not quite (we have a list of exact filenames, so we + * don't want to (a) parse a command line, or (b) expand wildcards. So the + * code is very similar to :args and hence needs access to a lot of the static + * functions in this file. + * + * The "filev" list must have been allocated using alloc(), as should each item + * in the list. This function takes over responsibility for freeing the "filev" + * list. + */ + void +handle_drop( + int filec, // the number of files dropped + char_u **filev, // the list of files dropped + int split, // force splitting the window + void (*callback)(void *), // to be called after setting the argument + // list + void *cookie) // argument for "callback" (allocated) +{ + // Cannot handle recursive drops, finish the pending one. + if (drop_busy) + { + FreeWild(filec, filev); + vim_free(cookie); + return; + } + + // When calling handle_drop() more than once in a row we only use the last + // one. + if (drop_filev != NULL) + { + FreeWild(drop_filec, drop_filev); + vim_free(drop_cookie); + } + + drop_filec = filec; + drop_filev = filev; + drop_split = split; + drop_callback = callback; + drop_cookie = cookie; + + // Postpone this when: + // - editing the command line + // - not possible to change the current buffer + // - updating the screen + // As it may change buffers and window structures that are in use and cause + // freed memory to be used. + if (text_locked() || curbuf_locked() || updating_screen) + return; + + handle_drop_internal(); +} + +/* + * To be called when text is unlocked, curbuf is unlocked or updating_screen is + * reset: Handle a postponed drop. + */ + void +handle_any_postponed_drop(void) +{ + if (!drop_busy && drop_filev != NULL + && !text_locked() && !curbuf_locked() && !updating_screen) + handle_drop_internal(); } #endif diff --git a/src/gui.c b/src/gui.c index 15adb1f1df..82ca09dd27 100644 --- a/src/gui.c +++ b/src/gui.c @@ -5383,10 +5383,7 @@ gui_do_findrepl( #endif -#if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \ - || defined(FEAT_GUI_MSWIN) \ - || defined(FEAT_GUI_MAC) \ - || defined(PROTO) +#if defined(HAVE_DROP_FILE) || defined(PROTO) static void gui_wingoto_xy(int x, int y); @@ -5408,6 +5405,42 @@ gui_wingoto_xy(int x, int y) } } +/* + * Function passed to handle_drop() for the actions to be done after the + * argument list has been updated. + */ + static void +drop_callback(void *cookie) +{ + char_u *p = cookie; + + /* If Shift held down, change to first file's directory. If the first + * item is a directory, change to that directory (and let the explorer + * plugin show the contents). */ + if (p != NULL) + { + if (mch_isdir(p)) + { + if (mch_chdir((char *)p) == 0) + shorten_fnames(TRUE); + } + else if (vim_chdirfile(p, "drop") == OK) + shorten_fnames(TRUE); + vim_free(p); + } + + /* Update the screen display */ + update_screen(NOT_VALID); +# ifdef FEAT_MENU + gui_update_menus(0); +# endif +#ifdef FEAT_TITLE + maketitle(); +#endif + setcursor(); + out_flush_cursor(FALSE, FALSE); +} + /* * Process file drop. Mouse cursor position, key modifiers, name of files * and count of files are given. Argument "fnames[count]" has full pathnames @@ -5488,33 +5521,8 @@ gui_handle_drop( vim_free(fnames); } else - handle_drop(count, fnames, (modifiers & MOUSE_CTRL) != 0); - - /* If Shift held down, change to first file's directory. If the first - * item is a directory, change to that directory (and let the explorer - * plugin show the contents). */ - if (p != NULL) - { - if (mch_isdir(p)) - { - if (mch_chdir((char *)p) == 0) - shorten_fnames(TRUE); - } - else if (vim_chdirfile(p, "drop") == OK) - shorten_fnames(TRUE); - vim_free(p); - } - - /* Update the screen display */ - update_screen(NOT_VALID); -# ifdef FEAT_MENU - gui_update_menus(0); -# endif -#ifdef FEAT_TITLE - maketitle(); -#endif - setcursor(); - out_flush_cursor(FALSE, FALSE); + handle_drop(count, fnames, (modifiers & MOUSE_CTRL) != 0, + drop_callback, (void *)p); } entered = FALSE; diff --git a/src/gui.h b/src/gui.h index 13c97e61bd..9ac5e071c9 100644 --- a/src/gui.h +++ b/src/gui.h @@ -65,8 +65,9 @@ /* * GUIs that support dropping files on a running Vim. */ -#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MAC) \ - || defined(FEAT_GUI_GTK) +#if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \ + || defined(FEAT_GUI_MSWIN) \ + || defined(FEAT_GUI_MAC) # define HAVE_DROP_FILE #endif diff --git a/src/gui_mac.c b/src/gui_mac.c index d2279ece5a..a6305936e2 100644 --- a/src/gui_mac.c +++ b/src/gui_mac.c @@ -1007,6 +1007,55 @@ struct SelectionRange /* for handling kCoreClassEvent:kOpenDocuments:keyAEPositi long theDate; // modification date/time }; +static long drop_numFiles; +static short drop_gotPosition; +static SelectionRange drop_thePosition; + + static void +drop_callback(void *cookie UNUSED) +{ + /* TODO: Handle the goto/select line more cleanly */ + if ((drop_numFiles == 1) & (drop_gotPosition)) + { + if (drop_thePosition.lineNum >= 0) + { + lnum = drop_thePosition.lineNum + 1; + /* oap->motion_type = MLINE; + setpcmark();*/ + if (lnum < 1L) + lnum = 1L; + else if (lnum > curbuf->b_ml.ml_line_count) + lnum = curbuf->b_ml.ml_line_count; + curwin->w_cursor.lnum = lnum; + curwin->w_cursor.col = 0; + /* beginline(BL_SOL | BL_FIX);*/ + } + else + goto_byte(drop_thePosition.startRange + 1); + } + + /* Update the screen display */ + update_screen(NOT_VALID); + + /* Select the text if possible */ + if (drop_gotPosition) + { + VIsual_active = TRUE; + VIsual_select = FALSE; + VIsual = curwin->w_cursor; + if (drop_thePosition.lineNum < 0) + { + VIsual_mode = 'v'; + goto_byte(drop_thePosition.endRange); + } + else + { + VIsual_mode = 'V'; + VIsual.col = 0; + } + } +} + /* The IDE uses the optional keyAEPosition parameter to tell the ed- itor the selection range. If lineNum is zero or greater, scroll the text to the specified line. If lineNum is less than zero, use the values in @@ -1113,48 +1162,10 @@ HandleODocAE(const AppleEvent *theAEvent, AppleEvent *theReply, long refCon) } /* Handle the drop, :edit to get to the file */ - handle_drop(numFiles, fnames, FALSE); - - /* TODO: Handle the goto/select line more cleanly */ - if ((numFiles == 1) & (gotPosition)) - { - if (thePosition.lineNum >= 0) - { - lnum = thePosition.lineNum + 1; - /* oap->motion_type = MLINE; - setpcmark();*/ - if (lnum < 1L) - lnum = 1L; - else if (lnum > curbuf->b_ml.ml_line_count) - lnum = curbuf->b_ml.ml_line_count; - curwin->w_cursor.lnum = lnum; - curwin->w_cursor.col = 0; - /* beginline(BL_SOL | BL_FIX);*/ - } - else - goto_byte(thePosition.startRange + 1); - } - - /* Update the screen display */ - update_screen(NOT_VALID); - - /* Select the text if possible */ - if (gotPosition) - { - VIsual_active = TRUE; - VIsual_select = FALSE; - VIsual = curwin->w_cursor; - if (thePosition.lineNum < 0) - { - VIsual_mode = 'v'; - goto_byte(thePosition.endRange); - } - else - { - VIsual_mode = 'V'; - VIsual.col = 0; - } - } + drop_numFiles = numFiles; + drop_gotPosition = gotPosition; + drop_thePosition = thePosition; + handle_drop(numFiles, fnames, FALSE, drop_callback, NULL); setcursor(); out_flush(); diff --git a/src/main.c b/src/main.c index 8a598c5e86..f67706699c 100644 --- a/src/main.c +++ b/src/main.c @@ -911,7 +911,7 @@ vim_main2(void) /* * Call the main command loop. This never returns. - */ + */ main_loop(FALSE, FALSE); #endif /* NO_VIM_MAIN */ @@ -1155,9 +1155,15 @@ main_loop( else if (do_redraw || stuff_empty()) { #ifdef FEAT_GUI - /* If ui_breakcheck() was used a resize may have been postponed. */ + // If ui_breakcheck() was used a resize may have been postponed. gui_may_resize_shell(); #endif +#ifdef HAVE_DROP_FILE + // If files were dropped while text was locked or the curbuf was + // locked, this would be a good time to handle the drop. + handle_any_postponed_drop(); +#endif + /* Trigger CursorMoved if the cursor moved. */ if (!finish_op && ( has_cursormoved() diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro index 3a0a9c6b9b..ada1a9a4ed 100644 --- a/src/proto/ex_docmd.pro +++ b/src/proto/ex_docmd.pro @@ -31,7 +31,8 @@ void not_exiting(void); void tabpage_close(int forceit); void tabpage_close_other(tabpage_T *tp, int forceit); void ex_all(exarg_T *eap); -void handle_drop(int filec, char_u **filev, int split); +void handle_drop(int filec, char_u **filev, int split, void (*callback)(void *), void *cookie); +void handle_any_postponed_drop(void); void alist_clear(alist_T *al); void alist_init(alist_T *al); void alist_unlink(alist_T *al); diff --git a/src/screen.c b/src/screen.c index 4dfbfec892..cab5731dc1 100644 --- a/src/screen.c +++ b/src/screen.c @@ -526,6 +526,12 @@ reset_updating_screen(int may_resize_shell UNUSED) #ifdef FEAT_TERMINAL term_check_channel_closed_recently(); #endif + +#ifdef HAVE_DROP_FILE + // If handle_drop() was called while updating_screen was TRUE need to + // handle the drop now. + handle_any_postponed_drop(); +#endif } /* diff --git a/src/version.c b/src/version.c index 652835526f..8b31adb8b3 100644 --- a/src/version.c +++ b/src/version.c @@ -794,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 228, /**/ 227, /**/ From 79c2ad50b8069bbb3281bcabe412bd6641756724 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 29 Jul 2018 17:40:43 +0200 Subject: [PATCH 17/17] patch 8.1.0229: crash when dumping profiling data Problem: Crash when dumping profiling data. Solution: Reset flag indicating that initialization was done. --- src/userfunc.c | 34 +++++++++++++++++++++------------- src/version.c | 2 ++ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/userfunc.c b/src/userfunc.c index 80a603b16e..a8ea303a95 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -1102,6 +1102,21 @@ func_remove(ufunc_T *fp) return FALSE; } + static void +func_clear_items(ufunc_T *fp) +{ + ga_clear_strings(&(fp->uf_args)); + ga_clear_strings(&(fp->uf_lines)); +#ifdef FEAT_PROFILE + vim_free(fp->uf_tml_count); + fp->uf_tml_count = NULL; + vim_free(fp->uf_tml_total); + fp->uf_tml_total = NULL; + vim_free(fp->uf_tml_self); + fp->uf_tml_self = NULL; +#endif +} + /* * Free all things that a function contains. Does not free the function * itself, use func_free() for that. @@ -1115,13 +1130,7 @@ func_clear(ufunc_T *fp, int force) fp->uf_cleared = TRUE; /* clear this function */ - ga_clear_strings(&(fp->uf_args)); - ga_clear_strings(&(fp->uf_lines)); -#ifdef FEAT_PROFILE - vim_free(fp->uf_tml_count); - vim_free(fp->uf_tml_total); - vim_free(fp->uf_tml_self); -#endif + func_clear_items(fp); funccal_unref(fp->uf_scoped, fp, force); } @@ -2312,9 +2321,12 @@ ex_function(exarg_T *eap) else { /* redefine existing function */ - ga_clear_strings(&(fp->uf_args)); - ga_clear_strings(&(fp->uf_lines)); VIM_CLEAR(name); + func_clear_items(fp); +#ifdef FEAT_PROFILE + fp->uf_profiling = FALSE; + fp->uf_prof_initialized = FALSE; +#endif } } } @@ -2434,10 +2446,6 @@ ex_function(exarg_T *eap) fp->uf_scoped = NULL; #ifdef FEAT_PROFILE - fp->uf_tml_count = NULL; - fp->uf_tml_total = NULL; - fp->uf_tml_self = NULL; - fp->uf_profiling = FALSE; if (prof_def_func()) func_do_profile(fp); #endif diff --git a/src/version.c b/src/version.c index 8b31adb8b3..5f7d908f1d 100644 --- a/src/version.c +++ b/src/version.c @@ -794,6 +794,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 229, /**/ 228, /**/