diff options
author | naohiro ono <obcat@icloud.com> | 2021-10-19 11:15:41 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-19 11:15:41 +0100 |
commit | 75c30e96cf280a8cc01ac01c41a9252db3e503cc (patch) | |
tree | 772920dcede7279046602574c24221e9645360a9 /src/ops.c | |
parent | ad6b90c33cc239794a6694ef53e8baeee2ed97bd (diff) | |
download | vim-git-75c30e96cf280a8cc01ac01c41a9252db3e503cc.tar.gz |
patch 8.2.3537: mode() does not return the right value in 'operatorfunc'v8.2.3537
Problem: mode() does not return the right value in 'operatorfunc'.
Solution: Reset finish_op while calling 'operatorfunc'.
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3314,6 +3314,7 @@ op_function(oparg_T *oap UNUSED) #ifdef FEAT_EVAL typval_T argv[2]; int save_virtual_op = virtual_op; + int save_finish_op = finish_op; pos_T orig_start = curbuf->b_op_start; pos_T orig_end = curbuf->b_op_end; @@ -3341,9 +3342,13 @@ op_function(oparg_T *oap UNUSED) // function. virtual_op = MAYBE; + // Reset finish_op so that mode() returns the right value. + finish_op = FALSE; + (void)call_func_noret(p_opfunc, 1, argv); virtual_op = save_virtual_op; + finish_op = save_finish_op; if (cmdmod.cmod_flags & CMOD_LOCKMARKS) { curbuf->b_op_start = orig_start; |