Problem: "1gd" may hang.
Solution: Don't get stuck in one position. (Christian Brabandt, closes #1643)
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)
break;
#endif
+ /* "g<": show scrollback text */
case '<':
show_sb_text();
break;
set nocursorline
endfunc
+func Test_gd_local_block()
+ let lines = [
+ \ ' int main()',
+ \ '{',
+ \ ' char *a = "NOT NULL";',
+ \ ' if(a)',
+ \ ' {',
+ \ ' char *b = a;',
+ \ ' printf("%s\n", b);',
+ \ ' }',
+ \ ' else',
+ \ ' {',
+ \ ' char *b = "NULL";',
+ \ ' return b;',
+ \ ' }',
+ \ '',
+ \ ' return 0;',
+ \ '}',
+ \ ]
+ call XTest_goto_decl('1gd', lines, 11, 11)
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 568,
/**/
567,
/**/