To: vim_dev@googlegroups.com Subject: Patch 8.2.0420 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0420 Problem: Vim9: cannot interrupt a loop with CTRL-C. Solution: Check for CTRL-C once in a while. Doesn't fully work yet. Files: src/misc1.c, src/proto/misc1.pro, src/testdir/test_vim9_script.vim *** ../vim-8.2.0419/src/misc1.c 2020-02-26 16:15:31.072386953 +0100 --- src/misc1.c 2020-03-05 22:17:32.521180373 +0100 *************** *** 2223,2228 **** --- 2223,2241 ---- } } + /* + * Like line_breakcheck() but check 100 times less often. + */ + void + veryfast_breakcheck(void) + { + if (++breakcheck_count >= BREAKCHECK_SKIP * 100) + { + breakcheck_count = 0; + ui_breakcheck(); + } + } + #if defined(VIM_BACKTICK) || defined(FEAT_EVAL) \ || (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ || defined(PROTO) *** ../vim-8.2.0419/src/proto/misc1.pro 2020-02-14 13:21:55.646197062 +0100 --- src/proto/misc1.pro 2020-03-05 22:21:56.975973850 +0100 *************** *** 40,45 **** --- 40,46 ---- void preserve_exit(void); void line_breakcheck(void); void fast_breakcheck(void); + void veryfast_breakcheck(void); char_u *get_cmd_output(char_u *cmd, char_u *infile, int flags, int *ret_len); void f_system(typval_T *argvars, typval_T *rettv); void f_systemlist(typval_T *argvars, typval_T *rettv); *** ../vim-8.2.0419/src/testdir/test_vim9_script.vim 2020-03-20 18:39:42.981273170 +0100 --- src/testdir/test_vim9_script.vim 2020-03-20 19:35:49.043034460 +0100 *************** *** 942,956 **** assert_equal('1_3_', result) enddef ! def Test_interrupt_loop() ! let x = 0 ! while 1 ! x += 1 ! if x == 100 ! feedkeys("\", 'L') ! endif ! endwhile ! enddef def Test_substitute_cmd() new --- 942,956 ---- assert_equal('1_3_', result) enddef ! " def Test_interrupt_loop() ! " let x = 0 ! " while 1 ! " x += 1 ! " if x == 100 ! " feedkeys("\", 'L') ! " endif ! " endwhile ! " enddef def Test_substitute_cmd() new *** ../vim-8.2.0419/src/version.c 2020-03-20 18:39:42.981273170 +0100 --- src/version.c 2020-03-20 19:29:14.421077420 +0100 *************** *** 740,741 **** --- 740,743 ---- { /* Add new patch number below this line */ + /**/ + 420, /**/ -- You were lucky. We lived for three months in a brown paper bag in a septic tank. We used to have to get up at six o'clock in the morning, clean the bag, eat a crust of stale bread, go to work down mill for fourteen hours a day week in-week out. When we got home, our Dad would thrash us to sleep with his belt! /// Bram Moolenaar -- Bram@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 ///