Mercurial > vim
comparison src/vim9compile.c @ 23505:bb29b09902d5 v8.2.2295
patch 8.2.2295: incsearch does not detect empty pattern properly
Commit: https://github.com/vim/vim/commit/d93a7fc1a98a58f8101ee780d4735079ad99ae35
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 4 12:42:13 2021 +0100
patch 8.2.2295: incsearch does not detect empty pattern properly
Problem: Incsearch does not detect empty pattern properly.
Solution: Return magic state when skipping over a pattern. (Christian
Brabandt, closes #7612, closes #6420)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 04 Jan 2021 12:45:05 +0100 |
parents | 2247a2ce3630 |
children | 872239543313 |
comparison
equal
deleted
inserted
replaced
23504:25d5c354a83e | 23505:bb29b09902d5 |
---|---|
7046 int len; | 7046 int len; |
7047 | 7047 |
7048 // Push v:exception, push {expr} and MATCH | 7048 // Push v:exception, push {expr} and MATCH |
7049 generate_instr_type(cctx, ISN_PUSHEXC, &t_string); | 7049 generate_instr_type(cctx, ISN_PUSHEXC, &t_string); |
7050 | 7050 |
7051 end = skip_regexp_ex(p + 1, *p, TRUE, &tofree, &dropped); | 7051 end = skip_regexp_ex(p + 1, *p, TRUE, &tofree, &dropped, NULL); |
7052 if (*end != *p) | 7052 if (*end != *p) |
7053 { | 7053 { |
7054 semsg(_(e_separator_mismatch_str), p); | 7054 semsg(_(e_separator_mismatch_str), p); |
7055 vim_free(tofree); | 7055 vim_free(tofree); |
7056 return FAIL; | 7056 return FAIL; |
7370 if ((eap->cmdidx == CMD_global || eap->cmdidx == CMD_vglobal) | 7370 if ((eap->cmdidx == CMD_global || eap->cmdidx == CMD_vglobal) |
7371 && STRLEN(eap->arg) > 4) | 7371 && STRLEN(eap->arg) > 4) |
7372 { | 7372 { |
7373 int delim = *eap->arg; | 7373 int delim = *eap->arg; |
7374 | 7374 |
7375 p = skip_regexp_ex(eap->arg + 1, delim, TRUE, NULL, NULL); | 7375 p = skip_regexp_ex(eap->arg + 1, delim, TRUE, NULL, NULL, NULL); |
7376 if (*p == delim) | 7376 if (*p == delim) |
7377 { | 7377 { |
7378 eap->arg = p + 1; | 7378 eap->arg = p + 1; |
7379 has_expr = TRUE; | 7379 has_expr = TRUE; |
7380 } | 7380 } |