diff options
author | erw7 <erw7.github@gmail.com> | 2019-05-27 16:34:03 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2019-06-05 09:57:38 +0900 |
commit | 2d567ac47ea48019e5e70c8b01b8be0be863a1ca (patch) | |
tree | 055e4d685d42e95acfcf31d93eee8dba248dad60 | |
parent | 68202520c621ec9e58474576272df1456921047f (diff) | |
download | rneovim-2d567ac47ea48019e5e70c8b01b8be0be863a1ca.tar.gz rneovim-2d567ac47ea48019e5e70c8b01b8be0be863a1ca.tar.bz2 rneovim-2d567ac47ea48019e5e70c8b01b8be0be863a1ca.zip |
vim-patch:8.1.1350: "W" for wrapping not shown when more than 99 matches
Problem: "W" for wrapping not shown when more than 99 matches.
Solution: Adjust check for length. (Masato Nishihata, closes vim/vim#4388)
https://github.com/vim/vim/commit/dc6855af974f2ef553aceee619fadcb858e25d39
-rw-r--r-- | src/nvim/search.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_search_stat.vim | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c index 35875e1cd6..e1465258ed 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -4286,7 +4286,7 @@ static void search_stat(int dirc, pos_T *pos, } len = STRLEN(t); - if (show_top_bot_msg && len + 3 < SEARCH_STAT_BUF_LEN) { + if (show_top_bot_msg && len + 2 < SEARCH_STAT_BUF_LEN) { STRCPY(t + len, " W"); len += 2; } diff --git a/src/nvim/testdir/test_search_stat.vim b/src/nvim/testdir/test_search_stat.vim index 107cd54a0e..322d137e2e 100644 --- a/src/nvim/testdir/test_search_stat.vim +++ b/src/nvim/testdir/test_search_stat.vim @@ -40,12 +40,20 @@ func! Test_search_stat() let g:a = execute(':unsilent :norm! n') let stat = '\[>99/>99\]' call assert_match(pat .. stat, g:a) + call cursor(line('$'), 1) + let g:a = execute(':unsilent :norm! n') + let stat = '\[1/>99\] W' + call assert_match(pat .. stat, g:a) " 5) Many matches call cursor(1, 1) let g:a = execute(':unsilent :norm! n') let stat = '\[2/>99\]' call assert_match(pat .. stat, g:a) + call cursor(1, 1) + let g:a = execute(':unsilent :norm! N') + let stat = '\[>99/>99\] W' + call assert_match(pat .. stat, g:a) " 6) right-left if exists("+rightleft") |