summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-04-20 18:54:50 +0200
committerBram Moolenaar <Bram@vim.org>2017-04-20 18:54:50 +0200
commit60402d68da09997cacdeec71fd22c9344f8f40d5 (patch)
tree1552a02d40e8641654264b42ce8f8470aa6faa93 /src/normal.c
parentfc8f1118e7ccd65b0537e47e6323c93a1df6a61a (diff)
downloadvim-git-60402d68da09997cacdeec71fd22c9344f8f40d5.tar.gz
patch 8.0.0568: 1gd may hangv8.0.0568
Problem: "1gd" may hang. Solution: Don't get stuck in one position. (Christian Brabandt, closes #1643)
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/normal.c b/src/normal.c
index 53bda6cc7..25c0986b4 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -4371,7 +4371,12 @@ find_decl(
if ((pos = findmatchlimit(NULL, '}', FM_FORWARD,
(int)(old_pos.lnum - curwin->w_cursor.lnum + 1))) != NULL
&& pos->lnum < old_pos.lnum)
+ {
+ /* There can't be a useful match before the end of this block.
+ * Skip to the end. */
+ curwin->w_cursor = *pos;
continue;
+ }
}
if (t == FAIL)
@@ -8311,6 +8316,7 @@ nv_g_cmd(cmdarg_T *cap)
break;
#endif
+ /* "g<": show scrollback text */
case '<':
show_sb_text();
break;