diff options
author | Aufar Gilbran <aufargilbran@gmail.com> | 2020-08-10 19:15:57 +0800 |
---|---|---|
committer | Aufar Gilbran <aufargilbran@gmail.com> | 2020-09-11 10:31:41 +0800 |
commit | dd08f6367b9ecd231028ee19b479b5ad723458e4 (patch) | |
tree | 8a3dc449a0d3bdfb6ae24d72c573ae90d5eddaa4 /src/nvim/ex_getln.c | |
parent | 9e834a89df6a24c78bcc9d7c69175dd3ae684bdd (diff) | |
download | rneovim-dd08f6367b9ecd231028ee19b479b5ad723458e4.tar.gz rneovim-dd08f6367b9ecd231028ee19b479b5ad723458e4.tar.bz2 rneovim-dd08f6367b9ecd231028ee19b479b5ad723458e4.zip |
vim-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 vim/vim#3318)
Also accept a match at the start of the first line.
https://github.com/vim/vim/commit/976b847f43dd16eb6cd809d2dcab7dde6045e176
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 6023b8d26b..54be8dd590 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -316,8 +316,8 @@ static bool do_incsearch_highlighting(int firstc, incsearch_state_T *s, ea.line2 = 1; ea.cmd = ccline.cmdbuff; ea.addr_type = ADDR_LINES; - parse_cmd_address(&ea, &dummy); curwin->w_cursor = s->search_start; + parse_cmd_address(&ea, &dummy); if (ea.addr_count > 0) { search_first_line = ea.line1; search_last_line = ea.line2; @@ -385,6 +385,9 @@ static void may_do_incsearch_highlighting(int firstc, long count, 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; memset(&sia, 0, sizeof(sia)); |