Mercurial > vim
comparison src/tag.c @ 19475:5512aa74cb62 v8.2.0295
patch 8.2.0295: highlighting for :s wrong when using different separator
Commit: https://github.com/vim/vim/commit/c036e87bd7001238ab7cc5d9e30e59bbf989a5fd
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 21 21:30:52 2020 +0100
patch 8.2.0295: highlighting for :s wrong when using different separator
Problem: Highlighting for :s wrong when using different separator.
Solution: Use separat argument for search direction and separator. (Rob
Pilling, closes #5665)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 21 Feb 2020 21:45:04 +0100 |
parents | c53dbbf3229b |
children | 5ce724c60c4c |
comparison
equal
deleted
inserted
replaced
19474:3e0b71dd3dc5 | 19475:5512aa74cb62 |
---|---|
3541 // start search before line from "line:" field | 3541 // start search before line from "line:" field |
3542 curwin->w_cursor.lnum = tagp.tagline - 1; | 3542 curwin->w_cursor.lnum = tagp.tagline - 1; |
3543 else | 3543 else |
3544 // start search before first line | 3544 // start search before first line |
3545 curwin->w_cursor.lnum = 0; | 3545 curwin->w_cursor.lnum = 0; |
3546 if (do_search(NULL, pbuf[0], pbuf + 1, (long)1, | 3546 if (do_search(NULL, pbuf[0], pbuf[0], pbuf + 1, (long)1, |
3547 search_options, NULL)) | 3547 search_options, NULL)) |
3548 retval = OK; | 3548 retval = OK; |
3549 else | 3549 else |
3550 { | 3550 { |
3551 int found = 1; | 3551 int found = 1; |
3553 | 3553 |
3554 /* | 3554 /* |
3555 * try again, ignore case now | 3555 * try again, ignore case now |
3556 */ | 3556 */ |
3557 p_ic = TRUE; | 3557 p_ic = TRUE; |
3558 if (!do_search(NULL, pbuf[0], pbuf + 1, (long)1, | 3558 if (!do_search(NULL, pbuf[0], pbuf[0], pbuf + 1, (long)1, |
3559 search_options, NULL)) | 3559 search_options, NULL)) |
3560 { | 3560 { |
3561 /* | 3561 /* |
3562 * Failed to find pattern, take a guess: "^func (" | 3562 * Failed to find pattern, take a guess: "^func (" |
3563 */ | 3563 */ |
3564 found = 2; | 3564 found = 2; |
3565 (void)test_for_static(&tagp); | 3565 (void)test_for_static(&tagp); |
3566 cc = *tagp.tagname_end; | 3566 cc = *tagp.tagname_end; |
3567 *tagp.tagname_end = NUL; | 3567 *tagp.tagname_end = NUL; |
3568 sprintf((char *)pbuf, "^%s\\s\\*(", tagp.tagname); | 3568 sprintf((char *)pbuf, "^%s\\s\\*(", tagp.tagname); |
3569 if (!do_search(NULL, '/', pbuf, (long)1, | 3569 if (!do_search(NULL, '/', '/', pbuf, (long)1, |
3570 search_options, NULL)) | 3570 search_options, NULL)) |
3571 { | 3571 { |
3572 // Guess again: "^char * \<func (" | 3572 // Guess again: "^char * \<func (" |
3573 sprintf((char *)pbuf, "^\\[#a-zA-Z_]\\.\\*\\<%s\\s\\*(", | 3573 sprintf((char *)pbuf, "^\\[#a-zA-Z_]\\.\\*\\<%s\\s\\*(", |
3574 tagp.tagname); | 3574 tagp.tagname); |
3575 if (!do_search(NULL, '/', pbuf, (long)1, | 3575 if (!do_search(NULL, '/', '/', pbuf, (long)1, |
3576 search_options, NULL)) | 3576 search_options, NULL)) |
3577 found = 0; | 3577 found = 0; |
3578 } | 3578 } |
3579 *tagp.tagname_end = cc; | 3579 *tagp.tagname_end = cc; |
3580 } | 3580 } |