diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-08-12 15:49:47 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-08-12 15:49:47 +0200 |
commit | 976b847f43dd16eb6cd809d2dcab7dde6045e176 (patch) | |
tree | af8ba8f8f6a9ff70bf4d23f2b84367c5e4c24881 /src/ex_getln.c | |
parent | 21f990e1c22ffa2fdb66a548ebbe25e6e7194776 (diff) | |
download | vim-git-976b847f43dd16eb6cd809d2dcab7dde6045e176.tar.gz |
patch 8.1.0275: 'incsearch' with :s doesn't start at cursor linev8.1.0275
Problem: 'incsearch' with :s doesn't start at cursor line.
Solution: Set cursor before parsing address. (closes #3318)
Also accept a match at the start of the first line.
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 804013bb3..07032bb54 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -316,8 +316,8 @@ do_incsearch_highlighting(int firstc, incsearch_state_T *is_state, ea.line2 = 1; ea.cmd = ccline.cmdbuff; ea.addr_type = ADDR_LINES; - parse_cmd_address(&ea, &dummy); curwin->w_cursor = is_state->search_start; + parse_cmd_address(&ea, &dummy); if (ea.addr_count > 0) { search_first_line = ea.line1; @@ -401,6 +401,8 @@ may_do_incsearch_highlighting( #endif if (!p_hls) search_flags += SEARCH_KEEP; + if (search_first_line != 0) + search_flags += SEARCH_START; c = ccline.cmdbuff[skiplen + patlen]; ccline.cmdbuff[skiplen + patlen] = NUL; i = do_search(NULL, firstc == ':' ? '/' : firstc, |