Mercurial > vim
comparison src/search.c @ 12722:7749260f261c v8.0.1239
patch 8.0.1239: cannot use a lambda for the skip argument to searchpair()
commit https://github.com/vim/vim/commit/48570488f17e397183ea7d5c7ca67d6e4ffb013d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 30 21:48:41 2017 +0100
patch 8.0.1239: cannot use a lambda for the skip argument to searchpair()
Problem: Cannot use a lambda for the skip argument to searchpair().
Solution: Evaluate a partial, funcref and lambda. (LemonBoy, closes https://github.com/vim/vim/issues/1454,
closes #2265)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 30 Oct 2017 22:00:05 +0100 |
parents | 37c384802df4 |
children | 91222b3123ba |
comparison
equal
deleted
inserted
replaced
12721:e6b964b3856d | 12722:7749260f261c |
---|---|
4013 */ | 4013 */ |
4014 for (n = 0; n < count; ++n) | 4014 for (n = 0; n < count; ++n) |
4015 { | 4015 { |
4016 if (do_searchpair((char_u *)"<[^ \t>/!]\\+\\%(\\_s\\_[^>]\\{-}[^/]>\\|$\\|\\_s\\=>\\)", | 4016 if (do_searchpair((char_u *)"<[^ \t>/!]\\+\\%(\\_s\\_[^>]\\{-}[^/]>\\|$\\|\\_s\\=>\\)", |
4017 (char_u *)"", | 4017 (char_u *)"", |
4018 (char_u *)"</[^>]*>", BACKWARD, (char_u *)"", 0, | 4018 (char_u *)"</[^>]*>", BACKWARD, NULL, 0, |
4019 NULL, (linenr_T)0, 0L) <= 0) | 4019 NULL, (linenr_T)0, 0L) <= 0) |
4020 { | 4020 { |
4021 curwin->w_cursor = old_pos; | 4021 curwin->w_cursor = old_pos; |
4022 goto theend; | 4022 goto theend; |
4023 } | 4023 } |
4047 goto theend; | 4047 goto theend; |
4048 } | 4048 } |
4049 sprintf((char *)spat, "<%.*s\\>\\%%(\\s\\_[^>]\\{-}[^/]>\\|>\\)\\c", len, p); | 4049 sprintf((char *)spat, "<%.*s\\>\\%%(\\s\\_[^>]\\{-}[^/]>\\|>\\)\\c", len, p); |
4050 sprintf((char *)epat, "</%.*s>\\c", len, p); | 4050 sprintf((char *)epat, "</%.*s>\\c", len, p); |
4051 | 4051 |
4052 r = do_searchpair(spat, (char_u *)"", epat, FORWARD, (char_u *)"", | 4052 r = do_searchpair(spat, (char_u *)"", epat, FORWARD, NULL, |
4053 0, NULL, (linenr_T)0, 0L); | 4053 0, NULL, (linenr_T)0, 0L); |
4054 | 4054 |
4055 vim_free(spat); | 4055 vim_free(spat); |
4056 vim_free(epat); | 4056 vim_free(epat); |
4057 | 4057 |