diff options
author | lonerover <pathfinder1644@yahoo.com> | 2017-01-01 00:30:04 +0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-12-31 17:30:04 +0100 |
commit | b37da9c66425464aa6a44eeffe9f05173dc42254 (patch) | |
tree | f8f7fb3d8bf1a024fbcc82ee77b2c4b6626449aa /src/nvim/normal.c | |
parent | aa35cd9af0a3909ae79403e56639c1b3212583a9 (diff) | |
download | rneovim-b37da9c66425464aa6a44eeffe9f05173dc42254.tar.gz rneovim-b37da9c66425464aa6a44eeffe9f05173dc42254.tar.bz2 rneovim-b37da9c66425464aa6a44eeffe9f05173dc42254.zip |
vim-patch:7.4.1940 (#5849)
Problem: "gd" hangs in some situations. (Eric Biggers)
Solution: Remove the SEARCH_START flag when looping. Add a test.
https://github.com/vim/vim/commit/23c60f21b07b04351d846e6fbf4f4abd9aa09345
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 88ebdef9b3..227bfbe779 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -3666,7 +3666,7 @@ find_decl ( size_t len, bool locally, bool thisblock, - int searchflags /* flags passed to searchit() */ + int flags_arg // flags passed to searchit() ) { char_u *pat; @@ -3678,6 +3678,7 @@ find_decl ( bool save_p_scs; bool retval = true; bool incll; + int searchflags = flags_arg; pat = xmalloc(len + 7); @@ -3751,10 +3752,12 @@ find_decl ( break; } - /* For finding a local variable and the match is before the "{" search - * to find a later match. For K&R style function declarations this - * skips the function header without types. */ + // For finding a local variable and the match is before the "{" search + // to find a later match. For K&R style function declarations this + // skips the function header without types. Remove SEARCH_START from + // flags to avoid getting stuck at one position. found_pos = curwin->w_cursor; + searchflags &= ~SEARCH_START; } if (t == false) { |