Hi char101!
On Mi, 20 Feb 2013, char101 wrote:
> Hi,
>
> I believe some change in patch 7.3.769 causes showmatch behaviour to change
>
> Test case
>
> - Start with an empty buffer
> - Type ) in line &lines + 10 (the number of lines visible + 10)
> - Go to line 1
> - Type ( in line 5
>
> - The screen will scroll so that line 5 is now the first visible line
Hm, I don't remember messing with that. I think, this happens, because
before 7.3.769 we only jumped when closing braces were inserted and now
we jump also on opening braces. Anyways, here is a patch, that makes
sure a jump is only done, when the matching brace is visible on the
screen.
diff --git a/src/search.c b/src/search.c
--- a/src/search.c
+++ b/src/search.c
@@ -2451,8 +2451,9 @@
if ((lpos = findmatch(NULL, NUL)) == NULL) /* no match, so beep */
vim_beep();
- else if (lpos->lnum >= curwin->w_topline)
+ else if (lpos->lnum >= curwin->w_topline && lpos->lnum < curwin->w_topline
+ curwin->w_height)
{
+ /* only jump to the matching brace, if it is within the current screen
*/
if (!curwin->w_p_wrap)
getvcol(curwin, lpos, NULL, &vcol, NULL);
if (curwin->w_p_wrap || (vcol >= curwin->w_leftcol
Mit freundlichen Grüßen
Christian
--
Was es alles gibt, was ich nicht brauche!
-- Aristoteles, 384-322 v. Chr.
--
--
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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.