Mercurial > vim
diff src/ops.c @ 10486:99896ee0cac5 v8.0.0136
commit https://github.com/vim/vim/commit/54b2bfa399017ebae76ed62f21578261d1b55c1f
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 2 14:57:08 2017 +0100
patch 8.0.0136
Problem: When using indent folding and changing indent the wrong fold is
opened. (Jonathan Fudger)
Solution: Open the fold under the cursor a bit later. (Christian Brabandt)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 02 Jan 2017 15:00:04 +0100 |
parents | b2dbe79639a2 |
children | 1e700d72561d |
line wrap: on
line diff
--- a/src/ops.c +++ b/src/ops.c @@ -259,11 +259,6 @@ op_shift(oparg_T *oap, int curs_top, int } 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; @@ -277,6 +272,12 @@ op_shift(oparg_T *oap, int curs_top, int 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)