comparison src/normal.c @ 9315:1b4946fa3777 v7.4.1940

commit https://github.com/vim/vim/commit/23c60f21b07b04351d846e6fbf4f4abd9aa09345 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 15 22:03:48 2016 +0200 patch 7.4.1940 Problem: "gd" hangs in some situations. (Eric Biggers) Solution: Remove the SEARCH_START flag when looping. Add a test.
author Christian Brabandt <cb@256bit.org>
date Wed, 15 Jun 2016 22:15:06 +0200
parents 0d52ddff8db4
children 43b8570abbec
comparison
equal deleted inserted replaced
9314:1df449de5199 9315:1b4946fa3777
4248 find_decl( 4248 find_decl(
4249 char_u *ptr, 4249 char_u *ptr,
4250 int len, 4250 int len,
4251 int locally, 4251 int locally,
4252 int thisblock, 4252 int thisblock,
4253 int searchflags) /* flags passed to searchit() */ 4253 int flags_arg) /* flags passed to searchit() */
4254 { 4254 {
4255 char_u *pat; 4255 char_u *pat;
4256 pos_T old_pos; 4256 pos_T old_pos;
4257 pos_T par_pos; 4257 pos_T par_pos;
4258 pos_T found_pos; 4258 pos_T found_pos;
4259 int t; 4259 int t;
4260 int save_p_ws; 4260 int save_p_ws;
4261 int save_p_scs; 4261 int save_p_scs;
4262 int retval = OK; 4262 int retval = OK;
4263 int incll; 4263 int incll;
4264 int searchflags = flags_arg;
4264 4265
4265 if ((pat = alloc(len + 7)) == NULL) 4266 if ((pat = alloc(len + 7)) == NULL)
4266 return FAIL; 4267 return FAIL;
4267 4268
4268 /* Put "\V" before the pattern to avoid that the special meaning of "." 4269 /* Put "\V" before the pattern to avoid that the special meaning of "."
4344 break; 4345 break;
4345 } 4346 }
4346 4347
4347 /* For finding a local variable and the match is before the "{" search 4348 /* For finding a local variable and the match is before the "{" search
4348 * to find a later match. For K&R style function declarations this 4349 * to find a later match. For K&R style function declarations this
4349 * skips the function header without types. */ 4350 * skips the function header without types. Remove SEARCH_START from
4351 * flags to avoid getting stuck at one position. */
4350 found_pos = curwin->w_cursor; 4352 found_pos = curwin->w_cursor;
4353 searchflags &= ~SEARCH_START;
4351 } 4354 }
4352 4355
4353 if (t == FAIL) 4356 if (t == FAIL)
4354 { 4357 {
4355 retval = FAIL; 4358 retval = FAIL;