Christian Brabandt wrote:
> I find it irritating, that folds open on horizontal movements depending
> on where the cursor is.
>
> For example open fold.c, move the cursor to a closed fold, Move the
> cursor to the end of the line ('$'), now the fold opens. Close the fold
> and press 'l'. The closed fold does not open, because the cursor did not
> move.
>
> This happens sometimes to me and I find this confusing, that
> sometimes the fold does not open and sometimes it does.
>
> So here is a small patch, that fixes it.
>
> diff --git a/src/normal.c b/src/normal.c
> --- a/src/normal.c
> +++ b/src/normal.c
> @@ -6081,7 +6081,7 @@
> #endif
> }
> #ifdef FEAT_FOLDING
> - if (n != cap->count1 && (fdo_flags & FDO_HOR) && KeyTyped
> + if (n <= cap->count1 && (fdo_flags & FDO_HOR) && KeyTyped
> && cap->oap->op_type == OP_NOP)
> foldOpenCursor();
> #endif
> @@ -6151,7 +6151,7 @@
> }
> }
> #ifdef FEAT_FOLDING
> - if (n != cap->count1 && (fdo_flags & FDO_HOR) && KeyTyped
> + if (n <= cap->count1 && (fdo_flags & FDO_HOR) && KeyTyped
> && cap->oap->op_type == OP_NOP)
> foldOpenCursor();
> #endif
I'm not sure we need this change. It's actually not because the cursor
didn't move. If you use a command that fails, such as using "l" when
already at the end of the line, nothing happens. If you want to open a
fold intentionally, use "0", that never fails. Is there a good reason
to change this behavior?
--
BEDEVERE: Wait. Wait ... tell me, what also floats on water?
ALL: Bread? No, no, no. Apples .... gravy ... very small rocks ...
ARTHUR: A duck.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php