vim-patch:9.0.0677: breakindent test accepts wrong result

Problem:    Breakindent test accepts wrong result.
Solution:   Fix the number column and adjust the expected text.

06618f94f1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Luuk van Baal 2023-04-26 18:08:55 +02:00
parent d95697d6d4
commit 7dc2c087e7
2 changed files with 16 additions and 18 deletions

View File

@ -596,8 +596,7 @@ static void handle_lnum_col(win_T *wp, winlinevars_T *wlv, int num_signs, int si
int sign_num_attr, int sign_cul_attr) int sign_num_attr, int sign_cul_attr)
{ {
if ((wp->w_p_nu || wp->w_p_rnu) if ((wp->w_p_nu || wp->w_p_rnu)
&& ((wlv->row == wlv->startrow + wlv->filler_lines && (wlv->row == wlv->startrow + wlv->filler_lines
&& (wp->w_skipcol == 0 || wlv->row > wp->w_winrow))
|| vim_strchr(p_cpo, CPO_NUMCOL) == NULL)) { || vim_strchr(p_cpo, CPO_NUMCOL) == NULL)) {
// If 'signcolumn' is set to 'number' and a sign is present // If 'signcolumn' is set to 'number' and a sign is present
// in "lnum", then display the sign instead of the line // in "lnum", then display the sign instead of the line
@ -606,7 +605,8 @@ static void handle_lnum_col(win_T *wp, winlinevars_T *wlv, int num_signs, int si
get_sign_display_info(true, wp, wlv, sign_idx, sign_cul_attr); get_sign_display_info(true, wp, wlv, sign_idx, sign_cul_attr);
} else { } else {
// Draw the line number (empty space after wrapping). // Draw the line number (empty space after wrapping).
if (wlv->row == wlv->startrow + wlv->filler_lines) { if (wlv->row == wlv->startrow + wlv->filler_lines
&& (wp->w_skipcol == 0 || wlv->row > wp->w_winrow)) {
get_line_number_str(wp, wlv->lnum, wlv->extra, sizeof(wlv->extra)); get_line_number_str(wp, wlv->lnum, wlv->extra, sizeof(wlv->extra));
if (wp->w_skipcol > 0 && wlv->startrow == 0) { if (wp->w_skipcol > 0 && wlv->startrow == 0) {
for (wlv->p_extra = wlv->extra; *wlv->p_extra == ' '; wlv->p_extra++) { for (wlv->p_extra = wlv->extra; *wlv->p_extra == ' '; wlv->p_extra++) {

View File

@ -711,14 +711,14 @@ endfunc
func Test_breakindent20_cpo_n_nextpage() func Test_breakindent20_cpo_n_nextpage()
let s:input = "" let s:input = ""
call s:test_windows('setl breakindent briopt=min:14 cpo+=n number') call s:test_windows('setl breakindent briopt=min:14 cpo+=n number')
call setline(1, repeat('a', 200)) call setline(1, repeat('abcdefghijklmnopqrst', 10))
norm! 1gg norm! 1gg
redraw! redraw!
let lines = s:screen_lines(1, 20) let lines = s:screen_lines(1, 20)
let expect = [ let expect = [
\ " 1 aaaaaaaaaaaaaaaa", \ " 1 abcdefghijklmnop",
\ " aaaaaaaaaaaaaaaa", \ " qrstabcdefghijkl",
\ " aaaaaaaaaaaaaaaa", \ " mnopqrstabcdefgh",
\ ] \ ]
call s:compare_lines(expect, lines) call s:compare_lines(expect, lines)
" Scroll down one screen line " Scroll down one screen line
@ -726,11 +726,10 @@ func Test_breakindent20_cpo_n_nextpage()
norm! 5gj norm! 5gj
redraw! redraw!
let lines = s:screen_lines(1, 20) let lines = s:screen_lines(1, 20)
" FIXME: this is not the right result
let expect = [ let expect = [
\ "<<<aaaaaaaaaaaaaaaaa", \ "<<< qrstabcdefghijkl",
\ " aaaaaaaaaaaaaaaa", \ " mnopqrstabcdefgh",
\ " aaaaaaaaaaaaaaaa", \ " ijklmnopqrstabcd",
\ ] \ ]
call s:compare_lines(expect, lines) call s:compare_lines(expect, lines)
@ -738,19 +737,18 @@ func Test_breakindent20_cpo_n_nextpage()
norm! 1gg norm! 1gg
let lines = s:screen_lines(1, 20) let lines = s:screen_lines(1, 20)
let expect = [ let expect = [
\ " 1 aaaaaaaaaaaaaaaa", \ " 1 abcdefghijklmnop",
\ " aaaaaaaaaaaaaa", \ " qrstabcdefghij",
\ " aaaaaaaaaaaaaa", \ " klmnopqrstabcd",
\ ] \ ]
call s:compare_lines(expect, lines) call s:compare_lines(expect, lines)
" Scroll down one screen line " Scroll down one screen line
norm! 5gj norm! 5gj
let lines = s:screen_lines(1, 20) let lines = s:screen_lines(1, 20)
+ " FIXME: this is not the right result
let expect = [ let expect = [
\ "<<<aaaaaaaaaaaaaaaaa", \ "<<< qrstabcdefghij",
\ " aaaaaaaaaaaaaa", \ " klmnopqrstabcd",
\ " aaaaaaaaaaaaaa", \ " efghijklmnopqr",
\ ] \ ]
call s:compare_lines(expect, lines) call s:compare_lines(expect, lines)