/*
* Return the number of window lines occupied by buffer line "lnum".
+ * Includes any filler lines.
*/
int
plines(linenr_T lnum)
return plines_win_nofill(wp, lnum, winheight) + diff_check_fill(wp, lnum);
}
+/*
+ * Return the number of window lines occupied by buffer line "lnum".
+ * Does not include filler lines.
+ */
int
plines_nofill(linenr_T lnum)
{
char_u curr_mode[MODE_MAX_LENGTH];
char_u pattern_buf[2 * MODE_MAX_LENGTH];
- if (!has_modechanged())
+ // Skip this when got_int is set, the autocommand will not be executed.
+ // Better trigger it next time.
+ if (!has_modechanged() || got_int)
return;
get_mode(curr_mode);
unlet g:n_to_c
unlet g:c_to_n
+ let g:n_to_v = 0
+ au ModeChanged n:v let g:n_to_v += 1
+ let g:v_to_n = 0
+ au ModeChanged v:n let g:v_to_n += 1
+ let g:mode_seq += ['v', 'n']
+ call feedkeys("v\<C-C>", 'tnix')
+ call assert_equal(len(g:mode_seq) - 1, g:index)
+ call assert_equal(1, g:n_to_v)
+ call assert_equal(1, g:v_to_n)
+ unlet g:n_to_v
+ unlet g:v_to_n
+
au! ModeChanged
delfunc TestMode
unlet! g:mode_seq