Mercurial > vim
comparison src/testdir/test_syntax.vim @ 29267:f27ec19f2034 v8.2.5152
patch 8.2.5152: search() gets stuck with "c" and skip evaluates to true
Commit: https://github.com/vim/vim/commit/180246cfd1a5842c538fa8a4a0b520f1d95c90c7
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu Jun 23 12:04:46 2022 +0100
patch 8.2.5152: search() gets stuck with "c" and skip evaluates to true
Problem: search() gets stuck with "c" and skip evaluates to true.
Solution: Reset the SEARCH_START option. (closes https://github.com/vim/vim/issues/10608)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 Jun 2022 13:15:04 +0200 |
parents | 947c8434894a |
children | 80929331a836 |
comparison
equal
deleted
inserted
replaced
29266:4a30a1116b92 | 29267:f27ec19f2034 |
---|---|
836 | 836 |
837 " Skip argument using string evaluation. | 837 " Skip argument using string evaluation. |
838 1 | 838 1 |
839 call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"') | 839 call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"') |
840 call assert_equal('Another Text for VIM', getline('.')) | 840 call assert_equal('Another Text for VIM', getline('.')) |
841 | |
841 1 | 842 1 |
842 call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") !~? "string"') | 843 call search('VIM', 'cw', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") !~? "string"') |
843 call assert_equal(' let a = "VIM"', getline('.')) | 844 call assert_equal(' let a = "VIM"', getline('.')) |
844 | 845 |
845 " Skip argument using Lambda. | 846 " Skip argument using Lambda. |
846 1 | 847 1 |
847 call search('VIM', 'w', '', 0, { -> synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"}) | 848 call search('VIM', 'w', '', 0, { -> synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"}) |
848 call assert_equal('Another Text for VIM', getline('.')) | 849 call assert_equal('Another Text for VIM', getline('.')) |
849 | 850 |
850 1 | 851 1 |
851 call search('VIM', 'w', '', 0, { -> synIDattr(synID(line("."), col("."), 1), "name") !~? "string"}) | 852 call search('VIM', 'cw', '', 0, { -> synIDattr(synID(line("."), col("."), 1), "name") !~? "string"}) |
852 call assert_equal(' let a = "VIM"', getline('.')) | 853 call assert_equal(' let a = "VIM"', getline('.')) |
853 | 854 |
854 " Skip argument using funcref. | 855 " Skip argument using funcref. |
855 func InComment() | 856 func InComment() |
856 return synIDattr(synID(line("."), col("."), 1), "name") =~? "comment" | 857 return synIDattr(synID(line("."), col("."), 1), "name") =~? "comment" |
857 endfunc | 858 endfunc |
858 func InString() | 859 func NotInString() |
859 return synIDattr(synID(line("."), col("."), 1), "name") !~? "string" | 860 return synIDattr(synID(line("."), col("."), 1), "name") !~? "string" |
860 endfunc | 861 endfunc |
862 | |
861 1 | 863 1 |
862 call search('VIM', 'w', '', 0, function('InComment')) | 864 call search('VIM', 'w', '', 0, function('InComment')) |
863 call assert_equal('Another Text for VIM', getline('.')) | 865 call assert_equal('Another Text for VIM', getline('.')) |
864 | 866 |
865 1 | 867 1 |
866 call search('VIM', 'w', '', 0, function('InString')) | 868 call search('VIM', 'cw', '', 0, function('NotInString')) |
867 call assert_equal(' let a = "VIM"', getline('.')) | 869 call assert_equal(' let a = "VIM"', getline('.')) |
868 | 870 |
869 delfunc InComment | 871 delfunc InComment |
870 delfunc InString | 872 delfunc NotInString |
871 bwipe! | 873 bwipe! |
872 endfunc | 874 endfunc |
873 | 875 |
874 func Test_syn_contained_transparent() | 876 func Test_syn_contained_transparent() |
875 " Comments starting with "Regression:" show the result when the highlighting | 877 " Comments starting with "Regression:" show the result when the highlighting |