Mercurial > vim
comparison src/search.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 | 79fd5217b125 |
children | b0e7fa957cd1 |
comparison
equal
deleted
inserted
replaced
23504:25d5c354a83e | 23505:bb29b09902d5 |
---|---|
1340 * Find end of regular expression. | 1340 * Find end of regular expression. |
1341 * If there is a matching '/' or '?', toss it. | 1341 * If there is a matching '/' or '?', toss it. |
1342 */ | 1342 */ |
1343 ps = strcopy; | 1343 ps = strcopy; |
1344 p = skip_regexp_ex(pat, search_delim, magic_isset(), | 1344 p = skip_regexp_ex(pat, search_delim, magic_isset(), |
1345 &strcopy, NULL); | 1345 &strcopy, NULL, NULL); |
1346 if (strcopy != ps) | 1346 if (strcopy != ps) |
1347 { | 1347 { |
1348 // made a copy of "pat" to change "\?" to "?" | 1348 // made a copy of "pat" to change "\?" to "?" |
1349 searchcmdlen += (int)(STRLEN(pat) - STRLEN(strcopy)); | 1349 searchcmdlen += (int)(STRLEN(pat) - STRLEN(strcopy)); |
1350 pat = strcopy; | 1350 pat = strcopy; |