Patch 8.2.0764
Patch 8.2.0764 Problem:Vim9: assigning to option not fully tested. Solution: Add more test cases. Allow using any type for assignment. Files: src/vim9compile.c, src/vim9execute.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.0763/src/vim9compile.c 2020-05-14 22:41:10.229637563 +0200 --- src/vim9compile.c 2020-05-15 23:26:26.476550213 +0200 *** *** 3490,3496 type_T **typep; // list index: list[123] ! // list member: dict[key] // TODO: blob index // TODO: more arguments // TODO: recognize list or dict at runtime --- 3490,3496 type_T **typep; // list index: list[123] ! // dict member: dict[key] // TODO: blob index // TODO: more arguments // TODO: recognize list or dict at runtime *** *** 4999,5006 goto theend; } } ! else if (*p != '=' && check_type(member_type, stacktype, TRUE) ! == FAIL) goto theend; } } --- 4999,5006 goto theend; } } ! else if (*p != '=' && need_type(stacktype, member_type, -1, !cctx) == FAIL) goto theend; } } *** ../vim-8.2.0763/src/vim9execute.c 2020-05-15 21:44:14.400495565 +0200 --- src/vim9execute.c 2020-05-15 23:32:55.347465694 +0200 *** *** 1164,1176 if (s == NULL) s = (char_u *)""; } - else if (tv->v_type == VAR_NUMBER) - n = tv->vval.v_number; else ! { ! emsg(_("E1051: Expected string or number")); ! goto failed; ! } msg = set_option_value(iptr->isn_arg.storeopt.so_name, n, s, iptr->isn_arg.storeopt.so_flags); if (msg != NULL) --- 1164,1172 if (s == NULL) s = (char_u *)""; } else ! // must be VAR_NUMBER, CHECKTYPE makes sure ! n = tv->vval.v_number; msg = set_option_value(iptr->isn_arg.storeopt.so_name, n, s, iptr->isn_arg.storeopt.so_flags); if (msg != NULL) *** ../vim-8.2.0763/src/testdir/test_vim9_script.vim2020-05-15 18:17:24.590759529 +0200 --- src/testdir/test_vim9_script.vim2020-05-15 23:34:27.519195667 +0200 *** *** 14,19 --- 14,21 let g:existing = 'yes' let g:inc_counter = 1 let $SOME_ENV_VAR = 'some' + let g:alist = [7] + let g:astring = 'text' def Test_assignment() let bool1: bool = true *** *** 95,101 --- 97,108 assert_equal(2, &ts) call CheckDefFailure(['¬ex += 3'], 'E113:') call CheckDefFailure(['&ts ..= "xxx"'], 'E1019:') + call CheckDefFailure(['&ts = [7]'], 'E1013:') + call CheckDefExecFailure(['&ts = g:alist'], 'E1029: Expected number but got list') + call CheckDefFailure(['&ts = "xx"'], 'E1013:') + call CheckDefExecFailure(['&ts = g:astring'], 'E1029: Expected number but got string') call CheckDefFailure(['&path += 3'], 'E1013:') + call CheckDefExecFailure(['&bs = "asdf"'], 'E474:') # test freeing ISN_STOREOPT call CheckDefFailure(['&ts = 3', 'let asdf'], 'E1022:') &ts = 8 *** ../vim-8.2.0763/src/version.c 2020-05-15 22:46:40.759917714 +0200 --- src/version.c 2020-05-15 23:34:59.359101655 +0200 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ + 764, /**/ -- Contrary to popular belief, Unix is user friendly. It just happens to be selective about who it makes friends with. -- Dave Parnas /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_d
Patch 8.2.0763
Patch 8.2.0763 Problem:GUI test fails without the terminal feature. Solution: Check the terminal feature is supported. (Ken Takata, closes #6084) Files: src/testdir/test_gui.vim *** ../vim-8.2.0762/src/testdir/test_gui.vim2020-05-11 22:04:46.928845435 +0200 --- src/testdir/test_gui.vim2020-05-15 22:46:20.144000223 +0200 *** *** 841,846 --- 841,847 " Test for "!" option in 'guioptions'. Use a terminal for running external " commands func Test_gui_run_cmd_in_terminal() + CheckFeature terminal let save_guioptions = &guioptions set guioptions+=! if has('win32') *** ../vim-8.2.0762/src/version.c 2020-05-15 22:30:34.895488256 +0200 --- src/version.c 2020-05-15 22:45:27.980211322 +0200 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ + 763, /**/ -- hundred-and-one symptoms of being an internet addict: 100. The most exciting sporting events you noticed during summer 1996 was Netscape vs. Microsoft. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202005152047.04FKlNjo019650%40masaka.moolenaar.net.
Patch 8.2.0762
Patch 8.2.0762 Problem:Buffer is not considered modified after setting crypt key. Solution: Set the modified flag. (Christian Brabandt, closes #6082) Files: src/optionstr.c, src/testdir/test_crypt.vim *** ../vim-8.2.0761/src/optionstr.c 2020-04-17 19:41:16.100078313 +0200 --- src/optionstr.c 2020-05-15 22:28:34.399878939 +0200 *** *** 1157,1164 --- 1157,1167 if (STRCMP(curbuf->b_p_key, oldval) != 0) // Need to update the swapfile. + { ml_set_crypt_key(curbuf, oldval, *curbuf->b_p_cm == NUL ? p_cm : curbuf->b_p_cm); + changed_internal(); + } } else if (gvarp == &p_cm) *** ../vim-8.2.0761/src/testdir/test_crypt.vim 2019-06-15 17:30:57.0 +0200 --- src/testdir/test_crypt.vim 2020-05-15 22:30:07.107578455 +0200 *** *** 110,112 --- 110,138 bwipe! endfunc + func Test_crypt_set_key_changes_buffer() + + new Xtest1.txt + call setline(1, 'nothing') + set cryptmethod=blowfish2 + call feedkeys(":X\foobar\foobar\", 'xt') + call assert_fails(":q", "E37:") + w + set key=anotherkey + call assert_fails(":bw") + w + call feedkeys(":X\foobar\foobar\", 'xt') + call assert_fails(":bw") + w + let winnr = winnr() + wincmd p + call setwinvar(winnr, '&key', 'yetanotherkey') + wincmd p + call assert_fails(":bw") + w + + set cryptmethod& + set key= + bwipe! + call delete('Xtest1.txt') + endfunc *** ../vim-8.2.0761/src/version.c 2020-05-15 22:01:51.284965534 +0200 --- src/version.c 2020-05-15 22:29:40.911663367 +0200 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ + 762, /**/ -- hundred-and-one symptoms of being an internet addict: 99. The hum of a cooling fan and the click of keys is comforting to you. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202005152031.04FKVB17016635%40masaka.moolenaar.net.
Patch 8.2.0761
Patch 8.2.0761 Problem:Vim9: instructions not tested Solution: Use a variable instead of a constant. Files: src/testdir/test_vim9_expr.vim *** ../vim-8.2.0760/src/testdir/test_vim9_expr.vim 2020-05-15 21:44:14.400495565 +0200 --- src/testdir/test_vim9_expr.vim 2020-05-15 22:00:43.833189401 +0200 *** *** 170,184 assert_equal(false, 61 == g:anint) if has('float') ! assert_equal(true, 0.3 == 0.3) ! assert_equal(false, 0.4 == 0.3) assert_equal(true, 0.1 == g:afloat) assert_equal(false, g:afloat == 0.3) ! assert_equal(true, 3.0 == 3) ! assert_equal(true, 3 == 3.0) ! assert_equal(false, 3.1 == 3) ! assert_equal(false, 3 == 3.1) endif assert_equal(true, 'abc' == 'abc') --- 170,187 assert_equal(false, 61 == g:anint) if has('float') ! let ff = 0.3 ! assert_equal(true, ff == 0.3) ! assert_equal(false, 0.4 == ff) assert_equal(true, 0.1 == g:afloat) assert_equal(false, g:afloat == 0.3) ! ff = 3.0 ! assert_equal(true, ff == 3) ! assert_equal(true, 3 == ff) ! ff = 3.1 ! assert_equal(false, ff == 3) ! assert_equal(false, 3 == ff) endif assert_equal(true, 'abc' == 'abc') *** *** 198,205 call CheckDefFailure(["let x = 'a' == xxx"], 'E1001:') ! assert_equal(true, 0z3f == 0z3f) ! assert_equal(false, 0z3f == 0z4f) assert_equal(true, g:ablob == 0z01ab) assert_equal(false, 0z3f == g:ablob) --- 201,209 call CheckDefFailure(["let x = 'a' == xxx"], 'E1001:') ! let bb = 0z3f ! assert_equal(true, 0z3f == bb) ! assert_equal(false, bb == 0z4f) assert_equal(true, g:ablob == 0z01ab) assert_equal(false, 0z3f == g:ablob) *** *** 250,264 assert_equal(true, 61 != g:anint) if has('float') ! assert_equal(false, 0.3 != 0.3) ! assert_equal(true, 0.4 != 0.3) assert_equal(false, 0.1 != g:afloat) assert_equal(true, g:afloat != 0.3) ! assert_equal(false, 3.0 != 3) ! assert_equal(false, 3 != 3.0) ! assert_equal(true, 3.1 != 3) ! assert_equal(true, 3 != 3.1) endif assert_equal(false, 'abc' != 'abc') --- 254,271 assert_equal(true, 61 != g:anint) if has('float') ! let ff = 0.3 ! assert_equal(false, 0.3 != ff) ! assert_equal(true, 0.4 != ff) assert_equal(false, 0.1 != g:afloat) assert_equal(true, g:afloat != 0.3) ! ff = 3.0 ! assert_equal(false, ff != 3) ! assert_equal(false, 3 != ff) ! ff = 3.1 ! assert_equal(true, ff != 3) ! assert_equal(true, 3 != ff) endif assert_equal(false, 'abc' != 'abc') *** *** 271,278 assert_equal(true, 'abc' != 'ABC') set noignorecase ! assert_equal(false, 0z3f != 0z3f) ! assert_equal(true, 0z3f != 0z4f) assert_equal(false, g:ablob != 0z01ab) assert_equal(true, 0z3f != g:ablob) --- 278,286 assert_equal(true, 'abc' != 'ABC') set noignorecase ! let bb = 0z3f ! assert_equal(false, 0z3f != bb) ! assert_equal(true, bb != 0z4f) assert_equal(false, g:ablob != 0z01ab) assert_equal(true, 0z3f != g:ablob) *** *** 306,315 assert_false(2 > 2) assert_false(2 > 3) if has('float') ! assert_true(2.0 > 0.0) ! assert_true(2.0 > 1.0) ! assert_false(2.0 > 2.0) ! assert_false(2.0 > 3.0) endif enddef --- 314,324 assert_false(2 > 2) assert_false(2 > 3) if has('float') ! let ff = 2.0 ! assert_true(ff > 0.0) ! assert_true(ff > 1.0) ! assert_false(ff > 2.0) ! assert_false(ff > 3.0) endif enddef *** *** 320,328 2) assert_false(2 >= 3) if has('float') ! assert_true(2.0 >= 0.0) ! assert_true(2.0 >= 2.0) ! assert_false(2.0 >= 3.0) endif enddef --- 329,338 2) assert_false(2 >= 3) if has('float') ! let ff = 2.0 ! assert_true(ff >= 0.0) ! assert_true(ff >= 2.0) ! assert_false(ff >= 3.0) endif enddef *** *** 333,341 2) assert_true(2 < 3) if has('float') ! assert_false(2.0 < 0.0) ! assert_false(2.0 < 2.0) ! assert_true(2.0 < 3.0) endif enddef --- 343,352 2) assert_true(2 < 3) if has('float') ! let ff = 2.0 ! assert_false(ff < 0.0) ! assert_false(ff < 2.0) ! assert_true(ff < 3.0) endif enddef *** *** 347,356 assert_true(2 <= 2) assert_true(2 <= 3) if has('float') ! assert_false(2.0 <= 0.0) ! assert_false(2.0 <= 1.0) ! assert_true(2.0 <= 2.0) ! assert_true(2.0 <= 3.0) endif enddef --- 358,368 assert_true(2 <= 2) assert_true(2 <= 3) if has('float') ! let ff = 2.0 ! assert_false(ff <= 0.0) ! assert_false(ff <= 1.0) ! assert_true(ff <= 2.0) !
Patch 8.2.0760
Patch 8.2.0760 Problem:Vim9: dict member errors not tested. Solution: Delete unreachable error. Add tests. Files: src/vim9execute.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.0759/src/vim9execute.c 2020-05-15 21:42:50.424779770 +0200 --- src/vim9execute.c 2020-05-15 21:37:48.009814327 +0200 *** *** 2104,2123 // dict member: dict is at stack-2, key at stack-1 tv = STACK_TV_BOT(-2); ! if (tv->v_type != VAR_DICT) ! { ! emsg(_(e_dictreq)); ! goto failed; ! } dict = tv->vval.v_dict; tv = STACK_TV_BOT(-1); ! if (tv->v_type != VAR_STRING) ! { ! emsg(_(e_stringreq)); ! goto failed; ! } key = tv->vval.v_string; if ((di = dict_find(dict, key, -1)) == NULL) { semsg(_(e_dictkey), key); --- 2104,2116 // dict member: dict is at stack-2, key at stack-1 tv = STACK_TV_BOT(-2); ! // no need to check for VAR_DICT, CHECKTYPE will check. dict = tv->vval.v_dict; tv = STACK_TV_BOT(-1); ! // no need to check for VAR_STRING, 2STRING will check. key = tv->vval.v_string; + if ((di = dict_find(dict, key, -1)) == NULL) { semsg(_(e_dictkey), key); *** ../vim-8.2.0759/src/testdir/test_vim9_expr.vim 2020-05-10 19:10:27.968996544 +0200 --- src/testdir/test_vim9_expr.vim 2020-05-15 21:35:49.990224702 +0200 *** *** 799,806 --- 799,810 def Test_expr_member() assert_equal(1, g:dict_one.one) + let d: dict = g:dict_one + assert_equal(1, d['one']) call CheckDefFailure(["let x = g:dict_one.#$!"], 'E1002:') + call CheckDefExecFailure(["let d: dict", "echo d['a']"], 'E716:') + call CheckDefExecFailure(["let d: dict", "d = g:list_empty"], 'E1029: Expected dict but got list') enddef def Test_expr7_option() *** ../vim-8.2.0759/src/version.c 2020-05-15 21:42:50.424779770 +0200 --- src/version.c 2020-05-15 21:43:44.700595963 +0200 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ + 760, /**/ -- hundred-and-one symptoms of being an internet addict: 97. Your mother tells you to remember something, and you look for a File/Save command. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202005151944.04FJilAf006240%40masaka.moolenaar.net.
Patch 8.2.0759
Patch 8.2.0759 (after 8.2.0751) Problem:Vim9: missing changes for performance improvements Solution: Use GA_GROW(). Don't call breakcheck so often. Files: src/vim9execute.c *** ../vim-8.2.0758/src/vim9execute.c 2020-05-10 21:47:40.152613769 +0200 --- src/vim9execute.c 2020-05-15 21:37:48.009814327 +0200 *** *** 128,134 if (count > 0) ectx->ec_stack.ga_len -= count - 1; ! else if (ga_grow(&ectx->ec_stack, 1) == FAIL) return FAIL; else ++ectx->ec_stack.ga_len; --- 128,134 if (count > 0) ectx->ec_stack.ga_len -= count - 1; ! else if (GA_GROW(&ectx->ec_stack, 1) == FAIL) return FAIL; else ++ectx->ec_stack.ga_len; *** *** 437,443 // Result replaces the arguments on the stack. if (argcount > 0) ectx->ec_stack.ga_len -= argcount - 1; ! else if (ga_grow(&ectx->ec_stack, 1) == FAIL) return FAIL; else ++ectx->ec_stack.ga_len; --- 437,443 // Result replaces the arguments on the stack. if (argcount > 0) ectx->ec_stack.ga_len -= argcount - 1; ! else if (GA_GROW(&ectx->ec_stack, 1) == FAIL) return FAIL; else ++ectx->ec_stack.ga_len; *** *** 651,656 --- 651,657 int ret = FAIL; int defcount = ufunc->uf_args.ga_len - argc; int save_sc_version = current_sctx.sc_version; + int breakcheck_count = 0; // Get pointer to item in the stack. #define STACK_TV(idx) (((typval_T *)ectx.ec_stack.ga_data) + idx) *** *** 749,755 { isn_T *iptr; ! veryfast_breakcheck(); if (got_int) { // Turn CTRL-C into an exception. --- 750,760 { isn_T *iptr; ! if (++breakcheck_count >= 100) ! { ! line_breakcheck(); ! breakcheck_count = 0; ! } if (got_int) { // Turn CTRL-C into an exception. *** *** 790,796 if (ectx.ec_frame_idx == initial_frame_idx) { // At the toplevel we are done. Push a dummy return value. ! if (ga_grow(&ectx.ec_stack, 1) == FAIL) goto failed; tv = STACK_TV_BOT(0); tv->v_type = VAR_NUMBER; --- 795,801 if (ectx.ec_frame_idx == initial_frame_idx) { // At the toplevel we are done. Push a dummy return value. ! if (GA_GROW(&ectx.ec_stack, 1) == FAIL) goto failed; tv = STACK_TV_BOT(0); tv->v_type = VAR_NUMBER; *** *** 942,948 // load local variable or argument case ISN_LOAD: ! if (ga_grow(&ectx.ec_stack, 1) == FAIL) goto failed; copy_tv(STACK_TV_VAR(iptr->isn_arg.number), STACK_TV_BOT(0)); ++ectx.ec_stack.ga_len; --- 947,953 // load local variable or argument case ISN_LOAD: ! if (GA_GROW(&ectx.ec_stack, 1) == FAIL) goto failed; copy_tv(STACK_TV_VAR(iptr->isn_arg.number), STACK_TV_BOT(0)); ++ectx.ec_stack.ga_len; *** *** 950,956 // load variable or argument from outer scope case ISN_LOADOUTER: ! if (ga_grow(&ectx.ec_stack, 1) == FAIL) goto failed; copy_tv(STACK_OUT_TV_VAR(iptr->isn_arg.number), STACK_TV_BOT(0)); --- 955,961 // load variable or argument from outer scope case ISN_LOADOUTER: ! if (GA_GROW(&ectx.ec_stack, 1) == FAIL) goto failed; copy_tv(STACK_OUT_TV_VAR(iptr->isn_arg.number), STACK_TV_BOT(0)); *** *** 959,965 // load v: variable case ISN_LOADV: ! if (ga_grow(&ectx.ec_stack, 1) == FAIL) goto failed; copy_tv(get_vim_var_tv(iptr->isn_arg.number), STACK_TV_BOT(0)); ++ectx.ec_stack.ga_len; --- 964,970 // load v: variable case ISN_LOADV: ! if (GA_GROW(&ectx.ec_stack, 1) == FAIL) goto failed; copy_tv(get_vim_var_tv(iptr->isn_arg.number), STACK_TV_BOT(0)); ++ectx.ec_stack.ga_len; *** *** 974,980 sv = ((svar_T *)si->sn_var_vals.ga_data) + iptr->isn_arg.script.script_idx; ! if (ga_grow(&ectx.ec_stack, 1) == FAIL) goto
Patch 8.2.0758
Patch 8.2.0758 Problem:Vim9: no test for STORELIST and STOREDICT. Solution: Add a test. Make matches stricter. Files: src/testdir/test_vim9_disassemble.vim *** ../vim-8.2.0757/src/testdir/test_vim9_disassemble.vim 2020-05-15 19:21:28.349090291 +0200 --- src/testdir/test_vim9_disassemble.vim 2020-05-15 20:52:12.069668479 +0200 *** *** 154,159 --- 154,190 res) enddef + def s:ScriptFuncStoreMember() + let locallist: list = [] + locallist[0] = 123 + let localdict: dict = {} + localdict["a"] = 456 + enddef + + def Test_disassemble_store_member() + let res = execute('disass s:ScriptFuncStoreMember') + assert_match('\d*_ScriptFuncStoreMember\_s*' .. + 'let locallist: list = []\_s*' .. + '\d NEWLIST size 0\_s*' .. + '\d STORE $0\_s*' .. + 'locallist\[0\] = 123\_s*' .. + '\d PUSHNR 123\_s*' .. + '\d PUSHNR 0\_s*' .. + '\d LOAD $0\_s*' .. + '\d STORELIST\_s*' .. + 'let localdict: dict = {}\_s*' .. + '\d NEWDICT size 0\_s*' .. + '\d STORE $1\_s*' .. + 'localdict\["a"\] = 456\_s*' .. + '\d\+ PUSHNR 456\_s*' .. + '\d\+ PUSHS "a"\_s*' .. + '\d\+ LOAD $1\_s*' .. + '\d\+ STOREDICT\_s*' .. + '\d\+ PUSHNR 0\_s*' .. + '\d\+ RETURN', + res) + enddef + def s:ScriptFuncUnlet() g:somevar = "value" unlet g:somevar *** *** 163,208 def Test_disassemble_unlet() let res = execute('disass s:ScriptFuncUnlet') ! assert_match('\d*_ScriptFuncUnlet.*' .. ! 'g:somevar = "value".*' .. ! '\d PUSHS "value".*' .. ! '\d STOREG g:somevar.*' .. ! 'unlet g:somevar.*' .. ! '\d UNLET g:somevar.*' .. ! 'unlet! g:somevar.*' .. ! '\d UNLET! g:somevar.*' .. ! 'unlet $SOMEVAR.*' .. ! '\d UNLETENV $SOMEVAR.*', res) enddef def s:ScriptFuncTry() try ! echo 'yes' catch /fail/ ! echo 'no' finally ! throw 'end' endtry enddef def Test_disassemble_try() let res = execute('disass s:ScriptFuncTry') ! assert_match('\d*_ScriptFuncTry.*' .. ! 'try.*' .. ! 'TRY catch -> \d\+, finally -> \d\+.*' .. ! 'catch /fail/.*' .. ! ' JUMP -> \d\+.*' .. ! ' PUSH v:exception.*' .. ! ' PUSHS "fail".*' .. ! ' COMPARESTRING =\~.*' .. ! ' JUMP_IF_FALSE -> \d\+.*' .. ! ' CATCH.*' .. ! 'finally.*' .. ! ' PUSHS "end".*' .. ! ' THROW.*' .. ! 'endtry.*' .. ! ' ENDTRY.*', res) enddef --- 194,246 def Test_disassemble_unlet() let res = execute('disass s:ScriptFuncUnlet') ! assert_match('\d*_ScriptFuncUnlet\_s*' .. ! 'g:somevar = "value"\_s*' .. ! '\d PUSHS "value"\_s*' .. ! '\d STOREG g:somevar\_s*' .. ! 'unlet g:somevar\_s*' .. ! '\d UNLET g:somevar\_s*' .. ! 'unlet! g:somevar\_s*' .. ! '\d UNLET! g:somevar\_s*' .. ! 'unlet $SOMEVAR\_s*' .. ! '\d UNLETENV $SOMEVAR\_s*', res) enddef def s:ScriptFuncTry() try ! echo "yes" catch /fail/ ! echo "no" finally ! throw "end" endtry enddef def Test_disassemble_try() let res = execute('disass s:ScriptFuncTry') ! assert_match('\d*_ScriptFuncTry\_s*' .. ! 'try\_s*' .. ! '\d TRY catch -> \d\+, finally -> \d\+\_s*' .. ! 'echo "yes"\_s*' .. ! '\d PUSHS "yes"\_s*' .. ! '\d ECHO 1\_s*' .. ! 'catch /fail/\_s*' .. ! '\d JUMP -> \d\+\_s*' .. ! '\d PUSH v:exception\_s*' .. ! '\d PUSHS "fail"\_s*' .. ! '\d COMPARESTRING =\~\_s*' .. ! '\d JUMP_IF_FALSE -> \d\+\_s*' .. ! '\d CATCH\_s*' .. ! 'echo "no"\_s*' .. ! '\d\+ PUSHS "no"\_s*' .. ! '\d\+ ECHO 1\_s*' .. ! 'finally\_s*' .. ! 'throw "end"\_s*' .. ! '\d\+ PUSHS "end"\_s*' .. ! '\d\+ THROW\_s*' .. ! 'endtry\_s*' .. ! '\d\+ ENDTRY', res) enddef *** *** 213,230 def Test_disassemble_new() let res = execute('disass s:ScriptFuncNew') ! assert_match('\d*_ScriptFuncNew.*' .. ! 'let ll = \[1, "two", 333].*' .. ! 'PUSHNR 1.*' .. ! 'PUSHS "two".*' .. ! 'PUSHNR 333.*' .. ! 'NEWLIST size 3.*' .. ! 'let dd = #{one: 1, two: "val"}.*' .. ! 'PUSHS "one".*' .. ! 'PUSHNR 1.*' .. ! 'PUSHS "two".*' .. ! 'PUSHS "val".*' .. ! 'NEWDICT size 2.*', res) enddef --- 251,269 def Test_disassemble_new() let res = execute('disass s:ScriptFuncNew') ! assert_match('\d*_ScriptFuncNew\_s*' .. ! 'let ll = \[1, "two", 333\]\_s*' .. ! '\d PUSHNR 1\_s*' .. ! '\d PUSHS "two"\_s*' .. ! '\d PUSHNR 333\_s*' .. ! '\d NEWLIST size 3\_s*
Patch 8.2.0757
Patch 8.2.0757 Problem:Vim9: no test for MEMBER instruction. Solution: Add a test. Make matches stricter. Files: src/testdir/test_vim9_disassemble.vim *** ../vim-8.2.0756/src/testdir/test_vim9_disassemble.vim 2020-05-14 22:41:10.229637563 +0200 --- src/testdir/test_vim9_disassemble.vim 2020-05-15 19:15:37.946728516 +0200 *** *** 726,743 def Test_disassemble_list_index() let instr = execute('disassemble ListIndex') ! assert_match('ListIndex.*' .. ! 'let l = \[1, 2, 3].*' .. ! '\d PUSHNR 1.*' .. ! '\d PUSHNR 2.*' .. ! '\d PUSHNR 3.*' .. ! '\d NEWLIST size 3.*' .. ! '\d STORE $0.*' .. ! 'let res = l\[1].*' .. ! '\d LOAD $0.*' .. ! '\d PUSHNR 1.*' .. ! '\d INDEX.*' .. ! '\d STORE $1.*', instr) assert_equal(2, ListIndex()) enddef --- 726,743 def Test_disassemble_list_index() let instr = execute('disassemble ListIndex') ! assert_match('ListIndex\_s*' .. ! 'let l = \[1, 2, 3]\_s*' .. ! '\d PUSHNR 1\_s*' .. ! '\d PUSHNR 2\_s*' .. ! '\d PUSHNR 3\_s*' .. ! '\d NEWLIST size 3\_s*' .. ! '\d STORE $0\_s*' .. ! 'let res = l\[1]\_s*' .. ! '\d LOAD $0\_s*' .. ! '\d PUSHNR 1\_s*' .. ! '\d INDEX\_s*' .. ! '\d STORE $1\_s*', instr) assert_equal(2, ListIndex()) enddef *** *** 745,765 def DictMember(): number let d = #{item: 1} let res = d.item return res enddef def Test_disassemble_dict_member() let instr = execute('disassemble DictMember') ! assert_match('DictMember.*' .. ! 'let d = #{item: 1}.*' .. ! '\d PUSHS "item".*' .. ! '\d PUSHNR 1.*' .. ! '\d NEWDICT size 1.*' .. ! '\d STORE $0.*' .. ! 'let res = d.item.*' .. ! '\d LOAD $0.*' .. ! '\d MEMBER item.*' .. ! '\d STORE $1.*', instr) call assert_equal(1, DictMember()) enddef --- 745,771 def DictMember(): number let d = #{item: 1} let res = d.item + res = d["item"] return res enddef def Test_disassemble_dict_member() let instr = execute('disassemble DictMember') ! assert_match('DictMember\_s*' .. ! 'let d = #{item: 1}\_s*' .. ! '\d PUSHS "item"\_s*' .. ! '\d PUSHNR 1\_s*' .. ! '\d NEWDICT size 1\_s*' .. ! '\d STORE $0\_s*' .. ! 'let res = d.item\_s*' .. ! '\d\+ LOAD $0\_s*' .. ! '\d\+ MEMBER item\_s*' .. ! '\d\+ STORE $1\_s*' .. ! 'res = d\["item"\]\_s*' .. ! '\d\+ LOAD $0\_s*' .. ! '\d\+ PUSHS "item"\_s*' .. ! '\d\+ MEMBER\_s*' .. ! '\d\+ STORE $1\_s*', instr) call assert_equal(1, DictMember()) enddef *** *** 773,789 def Test_disassemble_negate_number() let instr = execute('disassemble NegateNumber') ! assert_match('NegateNumber.*' .. ! 'let nr = 9.*' .. ! '\d STORE 9 in $0.*' .. ! 'let plus = +nr.*' .. ! '\d LOAD $0.*' .. ! '\d CHECKNR.*' .. ! '\d STORE $1.*' .. ! 'let res = -nr.*' .. ! '\d LOAD $0.*' .. ! '\d NEGATENR.*' .. ! '\d STORE $2.*', instr) call assert_equal(-9, NegateNumber()) enddef --- 779,795 def Test_disassemble_negate_number() let instr = execute('disassemble NegateNumber') ! assert_match('NegateNumber\_s*' .. ! 'let nr = 9\_s*' .. ! '\d STORE 9 in $0\_s*' .. ! 'let plus = +nr\_s*' .. ! '\d LOAD $0\_s*' .. ! '\d CHECKNR\_s*' .. ! '\d STORE $1\_s*' .. ! 'let res = -nr\_s*' .. ! '\d LOAD $0\_s*' .. ! '\d NEGATENR\_s*' .. ! '\d STORE $2\_s*', instr) call assert_equal(-9, NegateNumber()) enddef *** *** 797,814 def Test_disassemble_invert_bool() let instr = execute('disassemble InvertBool') ! assert_match('InvertBool.*' .. ! 'let flag = true.*' .. ! '\d PUSH v:true.*' .. ! '\d STORE $0.*' .. ! 'let invert = !flag.*' .. ! '\d LOAD $0.*' .. ! '\d INVERT (!val).*' .. ! '\d STORE $1.*' .. ! 'let res = !!flag.*' .. ! '\d LOAD $0.*' .. ! '\d 2BOOL (!!val).*' .. ! '\d STORE $2.*', instr) call assert_equal(true, InvertBool()) enddef --- 803,820 def Test_disassemble_invert_bool() let instr = execute('disassemble InvertBool') ! assert_match('InvertBool\_s*' .. ! 'let flag = true\_s*' .. ! '\d PUSH v:true\_s*' .. ! '\d STORE $0\_s*' .. ! 'let invert = !flag\_s*' .. ! '\d LOAD $0\_s*' .. ! '\d INVERT (!val)\_s*' .. ! '\d STORE $1\_s*' .. ! 'let res = !!flag\_s*' .. ! '\d LOAD $0\_s*' .. ! '\d 2BOOL (!!val)\_s*' .. ! '\d STORE $2\_s*',
[PATCH v3] syntax: Add command to control how foldlevel is computed for a line
On 1/30/2017 2:26 PM, Brad King wrote: On 10/17/2016 04:45 PM, Bram Moolenaar wrote: :syntax foldlevel [start | minimum] Thanks. I suppose that's the best way to do it. Here is a revised patch series that now includes tests for the new command. It also updates runtime/syntax/vim.vim to highlight the command syntax. I've posted an updated patch series as a PR: https://github.com/vim/vim/pull/6087 This message is just to connect the history of the work. Changes in v3: * Running just `syntax foldlevel` now responds with the current setting. * Adding extra arguments after `syntax foldlevel ` is now an error. * Dropped the `runtime/syntax/c.vim` patch so there is no change to default behavior in this series. Thanks, -Brad -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/ca5d69d5-a0e0-3ca0-380e-cc192aa525ad%40kitware.com.
Patch 8.2.0756
Patch 8.2.0756 (after 8.2.0249) Problem:MS-Windows: still a compiler warning. Solution: Move flag to another place in the Makefile. (Ken Takata, closes #6083) Files: src/Make_mvc.mak *** ../vim-8.2.0755/src/Make_mvc.mak2020-05-01 14:26:17.128949276 +0200 --- src/Make_mvc.mak2020-05-15 18:19:43.666396343 +0200 *** *** 675,683 CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG - ! if "$(CL)" == "/D_USING_V110_SDK71_" - RCFLAGS = $(RCFLAGS) /D_USING_V110_SDK71_ - ! endif ! ifdef USE_MSVCRT CFLAGS = $(CFLAGS) /MD LIBC = msvcrt.lib --- 675,680 *** *** 707,712 --- 704,713 ! endif !endif # DEBUG + !if "$(CL)" == "/D_USING_V110_SDK71_" + RCFLAGS = $(RCFLAGS) /D_USING_V110_SDK71_ + !endif + !if $(MSVC_MAJOR) >= 8 # Visual Studio 2005 has 'deprecated' many of the standard CRT functions CFLAGS_DEPR = /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE *** ../vim-8.2.0755/src/version.c 2020-05-15 18:17:24.590759529 +0200 --- src/version.c 2020-05-15 18:21:33.062098320 +0200 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ + 756, /**/ -- hundred-and-one symptoms of being an internet addict: 93. New mail alarm on your palmtop annoys other churchgoers. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202005151622.04FGMXRR024513%40masaka.moolenaar.net.
Patch 8.2.0755
Patch 8.2.0755 Problem:Vim9: No error when variable initializer is not a constant. Solution: Return FAIL when trying to get a variable value. Do not execute a script when an error is deteted in the first or second phase. Files: src/eval.c, src/vim9script.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.0754/src/eval.c 2020-05-14 22:41:10.225637575 +0200 --- src/eval.c 2020-05-15 17:26:38.469207375 +0200 *** *** 2695,2700 --- 2695,2702 { if (**arg == '(') // recursive! ret = eval_func(arg, s, len, rettv, flags, NULL); + else if (flags & EVAL_CONSTANT) + ret = FAIL; else if (evaluate) ret = get_var_tv(s, len, rettv, NULL, TRUE, FALSE); else *** ../vim-8.2.0754/src/vim9script.c2020-05-10 21:20:25.614465563 +0200 --- src/vim9script.c2020-05-15 17:53:13.582837887 +0200 *** *** 37,42 --- 37,43 garray_T func_ga; int idx; ufunc_T *ufunc; + int start_called_emsg = called_emsg; if (!getline_equal(eap->getline, eap->cookie, getsourceline)) { *** *** 66,72 // The types are recognized, so that they can be used when compiling a // function. gap = source_get_line_ga(eap->cookie); ! for (;;) { char_u *line; char_u *p; --- 67,73 // The types are recognized, so that they can be used when compiling a // function. gap = source_get_line_ga(eap->cookie); ! while (called_emsg == start_called_emsg) { char_u *line; char_u *p; *** *** 132,153 } else if (checkforcmd(&p, "finish", 4)) { - // TODO: this should not happen below "if false". - // Use "if cond | finish | endif as a workaround. break; } } // Compile the :def functions. ! for (idx = 0; idx < func_ga.ga_len; ++idx) { ufunc = ((ufunc_T **)(func_ga.ga_data))[idx]; compile_def_function(ufunc, FALSE, NULL); } ga_clear(&func_ga); ! // Return to process the commands at the script level. ! source_use_line_ga(eap->cookie); } /* --- 133,161 } else if (checkforcmd(&p, "finish", 4)) { break; } } // Compile the :def functions. ! for (idx = 0; idx < func_ga.ga_len && called_emsg == start_called_emsg; ++idx) { ufunc = ((ufunc_T **)(func_ga.ga_data))[idx]; compile_def_function(ufunc, FALSE, NULL); } ga_clear(&func_ga); ! if (called_emsg == start_called_emsg) ! { ! // Return to process the commands at the script level. ! source_use_line_ga(eap->cookie); ! } ! else ! { ! // If there was an error in the first or second phase then don't ! // execute the script lines. ! do_finish(eap, FALSE); ! } } /* *** ../vim-8.2.0754/src/testdir/test_vim9_script.vim2020-05-14 23:20:51.305625927 +0200 --- src/testdir/test_vim9_script.vim2020-05-15 17:56:47.638076471 +0200 *** *** 494,501 def Concat(arg: string): string return name .. arg enddef ! let g:result: string = Concat('bie') ! let g:localname = name export const CONST = 1234 export let exported = 9876 --- 494,501 def Concat(arg: string): string return name .. arg enddef ! g:result = Concat('bie') ! g:localname = name export const CONST = 1234 export let exported = 9876 *** *** 1747,1756 endfunc let val = GetValue() END ! writefile(lines, 'Xfinished') ! assert_fails('source Xfinished', 'E1091:') ! delete('Xfinished') enddef def Test_forward_declaration() --- 1747,1780 endfunc let val = GetValue() END ! CheckScriptFailure(lines, 'E1091:') ! lines =<< trim END ! vim9script ! let var = g:unkown ! END ! CheckScriptFailure(lines, 'E1091:') ! ! " TODO: eventually this would work ! lines =<< trim END ! vim9script ! let var = has('eval') ! END ! CheckScriptFailure(lines, 'E1091:') ! ! " TODO: eventually this would work ! lines =<< trim END ! vim9script ! let var = len('string') ! END ! CheckScriptFailure(lines, 'E1091:') ! ! lines =<< trim END ! vim9script ! let nr: number = 123 ! let var = nr ! END ! CheckScriptFailure(lines, 'E1091:') enddef def Test_forward_declaration() *** ../vim-8.2.0754/src/version.c 2020-05-14 23:20:51.305625927 +0200 --- src/version.c 2020-05-15 17:34:15.631568741 +0200 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ + 755, /**/ -- hundred-and-one symptoms of being an internet addict: 92. It takes you two hou
Re: [vim/vim] can't close a popup terminal window when its buffer has been replaced by "term_start()" (#5744)
Hi, I noticed the fzf.vim issue is resolved. Thank you for this! -m -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/148b5d75-ed9b-46da-8d01-f924294e6827%40googlegroups.com.
Re: Since recent commit getting E863: Not allowed for a terminal in a popup window
Hi, This issue is resolved in the latest fzf.vim commit d631c76e8d2dd18876a09d2c0919ece1a42a8721. Thank you to those involved! -m -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/5e3e146d-f19f-4525-a35d-71253320d2bb%40googlegroups.com.