To: vim_dev@googlegroups.com Subject: Patch 8.1.1992 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1992 Problem: The search stat moves when wrapping at the end of the buffer. Solution: Put the "W" in front instead of at the end. Files: src/search.c, src/testdir/test_search_stat.vim *** ../vim-8.1.1991/src/search.c 2019-09-03 22:23:34.484284108 +0200 --- src/search.c 2019-09-06 20:30:36.097143035 +0200 *************** *** 5011,5017 **** len = STRLEN(t); if (show_top_bot_msg && len + 2 < SEARCH_STAT_BUF_LEN) { ! STRCPY(t + len, " W"); len += 2; } --- 5011,5019 ---- len = STRLEN(t); if (show_top_bot_msg && len + 2 < SEARCH_STAT_BUF_LEN) { ! mch_memmove(t + 2, t, len); ! t[0] = 'W'; ! t[1] = ' '; len += 2; } *** ../vim-8.1.1991/src/testdir/test_search_stat.vim 2019-09-04 16:32:19.748321815 +0200 --- src/testdir/test_search_stat.vim 2019-09-06 20:36:49.279933761 +0200 *************** *** 43,49 **** 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) " Many matches --- 43,49 ---- call assert_match(pat .. stat, g:a) call cursor(line('$'), 1) let g:a = execute(':unsilent :norm! n') ! let stat = 'W \[1/>99\]' call assert_match(pat .. stat, g:a) " Many matches *************** *** 53,59 **** 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) " right-left --- 53,59 ---- call assert_match(pat .. stat, g:a) call cursor(1, 1) let g:a = execute(':unsilent :norm! N') ! let stat = 'W \[>99/>99\]' call assert_match(pat .. stat, g:a) " right-left *************** *** 85,91 **** call cursor('$',1) let pat = 'raboof/\s\+' let g:a = execute(':unsilent :norm! n') ! let stat = '\[20/1\]' call assert_match(pat .. stat, g:a) call assert_match('search hit BOTTOM, continuing at TOP', g:a) set norl --- 85,91 ---- call cursor('$',1) let pat = 'raboof/\s\+' let g:a = execute(':unsilent :norm! n') ! let stat = 'W \[20/1\]' call assert_match(pat .. stat, g:a) call assert_match('search hit BOTTOM, continuing at TOP', g:a) set norl *************** *** 96,105 **** let @/ = 'foobar' let pat = '?foobar\s\+' let g:a = execute(':unsilent :norm! N') ! let stat = '\[20/20\]' call assert_match(pat .. stat, g:a) call assert_match('search hit TOP, continuing at BOTTOM', g:a) ! call assert_match('\[20/20\] W', Screenline(&lines)) " normal, no match call cursor(1,1) --- 96,105 ---- let @/ = 'foobar' let pat = '?foobar\s\+' let g:a = execute(':unsilent :norm! N') ! let stat = 'W \[20/20\]' call assert_match(pat .. stat, g:a) call assert_match('search hit TOP, continuing at BOTTOM', g:a) ! call assert_match('W \[20/20\]', Screenline(&lines)) " normal, no match call cursor(1,1) *** ../vim-8.1.1991/src/version.c 2019-09-05 23:03:58.938177885 +0200 --- src/version.c 2019-09-06 20:33:02.188680483 +0200 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 1992, /**/ -- hundred-and-one symptoms of being an internet addict: 200. You really believe in the concept of a "paperless" office. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///