Patch 8.0.0568
Problem:    "1gd" may hang.
Solution:   Don't get stuck in one position. (Christian Brabandt, closes #1643)
Files:      src/testdir/test_goto.vim, src/normal.c


*** ../vim-8.0.0567/src/testdir/test_goto.vim   2016-12-03 15:13:16.415147422 
+0100
--- src/testdir/test_goto.vim   2017-04-20 18:35:04.512173611 +0200
***************
*** 288,290 ****
--- 288,311 ----
    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
*** ../vim-8.0.0567/src/normal.c        2017-03-16 17:23:26.827815840 +0100
--- src/normal.c        2017-04-20 18:47:09.035633462 +0200
***************
*** 4371,4377 ****
--- 4371,4382 ----
            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,8316 ****
--- 8316,8322 ----
        break;
  #endif
  
+     /* "g<": show scrollback text */
      case '<':
        show_sb_text();
        break;
*** ../vim-8.0.0567/src/version.c       2017-04-18 18:51:30.063844106 +0200
--- src/version.c       2017-04-20 18:36:30.811632413 +0200
***************
*** 766,767 ****
--- 766,769 ----
  {   /* Add new patch number below this line */
+ /**/
+     568,
  /**/

-- 
Individualists unite!

 /// 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

--- 
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/d/optout.

Raspunde prin e-mail lui