Compare commits

...

4 Commits

Author SHA1 Message Date
naohiro ono
75c30e96cf patch 8.2.3537: mode() does not return the right value in 'operatorfunc'
Problem:    mode() does not return the right value in 'operatorfunc'.
Solution:   Reset finish_op while calling 'operatorfunc'.
2021-10-19 11:15:41 +01:00
Yegappan Lakshmanan
ad6b90c33c patch 8.2.3536: the do_highlight() function is way too long
Problem:    The do_highlight() function is way too long.
Solution:   Split it into several functions. (Yegappan Lakshmanan,
            closes #9011)
2021-10-18 22:13:57 +01:00
Dominique Pelle
9b0b844d25 patch 8.2.3535: if-else indenting is confusing
Problem:    If-else indenting is confusing.
Solution:   Add curly brackets and indent. (Dominique Pellé, closes #9010)
2021-10-18 20:56:39 +01:00
Bram Moolenaar
944eeb44fb patch 8.2.3534: autoread test is a bit flaky
Problem:    Autoread test is a bit flaky.
Solution:   Wait a brief moment before overwriting the file.
2021-10-18 14:37:13 +01:00
6 changed files with 983 additions and 808 deletions

View File

@@ -2305,13 +2305,15 @@ win_update(win_T *wp)
++new_rows;
else
#endif
{
#ifdef FEAT_DIFF
if (l == wp->w_topline)
new_rows += plines_win_nofill(wp, l, TRUE)
new_rows += plines_win_nofill(wp, l, TRUE)
+ wp->w_topfill;
else
else
#endif
new_rows += plines_win(wp, l, TRUE);
new_rows += plines_win(wp, l, TRUE);
}
++j;
if (new_rows > wp->w_height - row - 2)
{

File diff suppressed because it is too large Load Diff

View File

@@ -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;

View File

@@ -912,6 +912,20 @@ func Test_mode()
call assert_equal('c-ce', g:current_modes)
" How to test Ex mode?
" Test mode in operatorfunc (it used to be Operator-pending).
set operatorfunc=OperatorFunc
function OperatorFunc(_)
call Save_mode()
endfunction
execute "normal! g@l\<Esc>"
call assert_equal('n-n', g:current_modes)
execute "normal! i\<C-o>g@l\<Esc>"
call assert_equal('n-niI', g:current_modes)
execute "normal! R\<C-o>g@l\<Esc>"
call assert_equal('n-niR', g:current_modes)
execute "normal! gR\<C-o>g@l\<Esc>"
call assert_equal('n-niV', g:current_modes)
if has('terminal')
term
call feedkeys("\<C-W>N", 'xt')
@@ -924,6 +938,8 @@ func Test_mode()
iunmap <F2>
xunmap <F2>
set complete&
set operatorfunc&
delfunction OperatorFunc
endfunc
" Test for append()

View File

@@ -104,7 +104,8 @@ func Test_autoread_fast()
setlocal autoread
call setline(1, 'foo')
w!
silent !echo bar > Xautoread
sleep 10m
call writefile(['bar'], 'Xautoread')
sleep 10m
checktime
call assert_equal('bar', trim(getline(1)))

View File

@@ -757,6 +757,14 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3537,
/**/
3536,
/**/
3535,
/**/
3534,
/**/
3533,
/**/