mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
vim-patch:9.1.1395: search_stat not reset when pattern differs in case (#34058)
Problem: search_stat not reset when pattern differs in case (tahzibijafar) Solution: use STRNCMP instead of MB_STRNICMP macro There was a long standing todo comment, that using MB_STRNICMP is wrong. So let's change it to STRNCMP() instead. Even if it not handle multi-byte characters correctly, then Vim will rather recompute the search stat, instead of re-using the old (and possibly wrong) value. fixes: vim/vim#17312 closes: vim/vim#17314670d0c1468
Co-authored-by: Christian Brabandt <cb@256bit.org> (cherry picked from commitec5f054dc9
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
a242902430
commit
917f496f75
@@ -184,4 +184,28 @@ describe('search stat', function()
|
||||
{19:search hit TOP, continuing at BOTTOM} |
|
||||
]])
|
||||
end)
|
||||
|
||||
-- oldtest: Test_search_stat_smartcase_ignorecase()
|
||||
it('when changing case of pattern', function()
|
||||
exec([[
|
||||
set shm-=S ignorecase smartcase
|
||||
call setline(1, [' MainmainmainmmmainmAin', ''])
|
||||
]])
|
||||
|
||||
feed('/main<cr>nnnn')
|
||||
screen:expect([[
|
||||
{10:Mainmainmain}mm{10:main^mAin} |
|
||||
|
|
||||
{1:~ }|*7
|
||||
/main [5/5] |
|
||||
]])
|
||||
|
||||
feed('/mAin<cr>')
|
||||
screen:expect([[
|
||||
Mainmainmainmmmain{10:^mAin} |
|
||||
|
|
||||
{1:~ }|*7
|
||||
/mAin [1/1] |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user