}
changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
-#ifdef FEAT_FOLDING
- /* The cursor line is not in a closed fold */
- foldOpenCursor();
-#endif
-
if (oap->block_mode)
{
curwin->w_cursor.lnum = oap->start.lnum;
else
--curwin->w_cursor.lnum; /* put cursor on last line, for ":>" */
+#ifdef FEAT_FOLDING
+ /* The cursor line is not in a closed fold */
+ foldOpenCursor();
+#endif
+
+
if (oap->line_count > p_report)
{
if (oap->op_type == OP_RSHIFT)
quit!
endfunction
+
+function! Test_indent_fold()
+ new
+ call setline(1, ['', 'a', ' b', ' c'])
+ setl fen fdm=indent
+ 2
+ norm! >>
+ let a=map(range(1,4), 'foldclosed(v:val)')
+ call assert_equal([-1,-1,-1,-1], a)
+endfu
+
+function! Test_indent_fold()
+ new
+ call setline(1, ['', 'a', ' b', ' c'])
+ setl fen fdm=indent
+ 2
+ norm! >>
+ let a=map(range(1,4), 'foldclosed(v:val)')
+ call assert_equal([-1,-1,-1,-1], a)
+ bw!
+endfu
+
+function! Test_indent_fold2()
+ new
+ call setline(1, ['', '{{{', '}}}', '{{{', '}}}'])
+ setl fen fdm=marker
+ 2
+ norm! >>
+ let a=map(range(1,5), 'foldclosed(v:val)')
+ call assert_equal([-1,-1,-1,4,4], a)
+ bw!
+endfu