comparison src/ex_getln.c @ 14524:e36d6e01708c v8.1.0275

patch 8.1.0275: 'incsearch' with :s doesn't start at cursor line commit https://github.com/vim/vim/commit/976b847f43dd16eb6cd809d2dcab7dde6045e176 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 12 15:49:47 2018 +0200 patch 8.1.0275: 'incsearch' with :s doesn't start at cursor line Problem: 'incsearch' with :s doesn't start at cursor line. Solution: Set cursor before parsing address. (closes https://github.com/vim/vim/issues/3318) Also accept a match at the start of the first line.
author Christian Brabandt <cb@256bit.org>
date Sun, 12 Aug 2018 16:00:06 +0200
parents 97641c4f5687
children 58ca11610819
comparison
equal deleted inserted replaced
14523:f67a38a09c6d 14524:e36d6e01708c
314 vim_memset(&ea, 0, sizeof(ea)); 314 vim_memset(&ea, 0, sizeof(ea));
315 ea.line1 = 1; 315 ea.line1 = 1;
316 ea.line2 = 1; 316 ea.line2 = 1;
317 ea.cmd = ccline.cmdbuff; 317 ea.cmd = ccline.cmdbuff;
318 ea.addr_type = ADDR_LINES; 318 ea.addr_type = ADDR_LINES;
319 curwin->w_cursor = is_state->search_start;
319 parse_cmd_address(&ea, &dummy); 320 parse_cmd_address(&ea, &dummy);
320 curwin->w_cursor = is_state->search_start;
321 if (ea.addr_count > 0) 321 if (ea.addr_count > 0)
322 { 322 {
323 search_first_line = ea.line1; 323 search_first_line = ea.line1;
324 search_last_line = ea.line2; 324 search_last_line = ea.line2;
325 } 325 }
399 // Set the time limit to half a second. 399 // Set the time limit to half a second.
400 profile_setlimit(500L, &tm); 400 profile_setlimit(500L, &tm);
401 #endif 401 #endif
402 if (!p_hls) 402 if (!p_hls)
403 search_flags += SEARCH_KEEP; 403 search_flags += SEARCH_KEEP;
404 if (search_first_line != 0)
405 search_flags += SEARCH_START;
404 c = ccline.cmdbuff[skiplen + patlen]; 406 c = ccline.cmdbuff[skiplen + patlen];
405 ccline.cmdbuff[skiplen + patlen] = NUL; 407 ccline.cmdbuff[skiplen + patlen] = NUL;
406 i = do_search(NULL, firstc == ':' ? '/' : firstc, 408 i = do_search(NULL, firstc == ':' ? '/' : firstc,
407 ccline.cmdbuff + skiplen, count, search_flags, 409 ccline.cmdbuff + skiplen, count, search_flags,
408 #ifdef FEAT_RELTIME 410 #ifdef FEAT_RELTIME