Mercurial > vim
comparison src/ex_getln.c @ 14538:213f1a519378 v8.1.0282
patch 8.1.0282: 'incsearch' does not work with command modifiers
commit https://github.com/vim/vim/commit/33c4dbb74bdf41aadd193a704f597d4df20f0e47
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 14 16:06:16 2018 +0200
patch 8.1.0282: 'incsearch' does not work with command modifiers
Problem: 'incsearch' does not work with command modifiers.
Solution: Skip command modifiers.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 14 Aug 2018 16:15:04 +0200 |
parents | 8fa7f5ff2649 |
children | 116a01c73fd8 |
comparison
equal
deleted
inserted
replaced
14537:2e7cca4372f3 | 14538:213f1a519378 |
---|---|
281 | 281 |
282 if (firstc == '/' || firstc == '?') | 282 if (firstc == '/' || firstc == '?') |
283 return TRUE; | 283 return TRUE; |
284 if (firstc == ':') | 284 if (firstc == ':') |
285 { | 285 { |
286 char_u *cmd = skip_range(ccline.cmdbuff, NULL); | 286 char_u *cmd; |
287 char_u *p; | 287 cmdmod_T save_cmdmod = cmdmod; |
288 int delim; | 288 char_u *p; |
289 char_u *end; | 289 int delim; |
290 | 290 char_u *end; |
291 char_u *dummy; | |
292 exarg_T ea; | |
293 | |
294 vim_memset(&ea, 0, sizeof(ea)); | |
295 ea.line1 = 1; | |
296 ea.line2 = 1; | |
297 ea.cmd = ccline.cmdbuff; | |
298 ea.addr_type = ADDR_LINES; | |
299 | |
300 parse_command_modifiers(&ea, &dummy, TRUE); | |
301 cmdmod = save_cmdmod; | |
302 | |
303 cmd = skip_range(ea.cmd, NULL); | |
291 if (*cmd == 's' || *cmd == 'g' || *cmd == 'v') | 304 if (*cmd == 's' || *cmd == 'g' || *cmd == 'v') |
292 { | 305 { |
293 // Skip over "substitute" to find the pattern separator. | 306 // Skip over "substitute" to find the pattern separator. |
294 for (p = cmd; ASCII_ISALPHA(*p); ++p) | 307 for (p = cmd; ASCII_ISALPHA(*p); ++p) |
295 ; | 308 ; |
308 p = skipwhite(p); | 321 p = skipwhite(p); |
309 delim = *p++; | 322 delim = *p++; |
310 end = skip_regexp(p, delim, p_magic, NULL); | 323 end = skip_regexp(p, delim, p_magic, NULL); |
311 if (end > p || *end == delim) | 324 if (end > p || *end == delim) |
312 { | 325 { |
313 char_u *dummy; | |
314 exarg_T ea; | |
315 pos_T save_cursor = curwin->w_cursor; | 326 pos_T save_cursor = curwin->w_cursor; |
316 | 327 |
317 // found a non-empty pattern | 328 // found a non-empty pattern |
318 *skiplen = (int)(p - ccline.cmdbuff); | 329 *skiplen = (int)(p - ccline.cmdbuff); |
319 *patlen = (int)(end - p); | 330 *patlen = (int)(end - p); |
320 | 331 |
321 // parse the address range | 332 // parse the address range |
322 vim_memset(&ea, 0, sizeof(ea)); | |
323 ea.line1 = 1; | |
324 ea.line2 = 1; | |
325 ea.cmd = ccline.cmdbuff; | |
326 ea.addr_type = ADDR_LINES; | |
327 curwin->w_cursor = is_state->search_start; | 333 curwin->w_cursor = is_state->search_start; |
328 parse_cmd_address(&ea, &dummy); | 334 parse_cmd_address(&ea, &dummy); |
329 if (ea.addr_count > 0) | 335 if (ea.addr_count > 0) |
330 { | 336 { |
331 // Allow for reverse match. | 337 // Allow for reverse match. |