comparison src/move.c @ 14317:1bc96dbb5498 v8.1.0174

patch 8.1.0174: after paging up and down fold line is wrong commit https://github.com/vim/vim/commit/907dad72ef9d29422352fb74ba156e7085a3fc71 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 10 15:07:15 2018 +0200 patch 8.1.0174: after paging up and down fold line is wrong Problem: After paging up and down fold line is wrong. Solution: Correct the computation of w_topline and w_botline. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Tue, 10 Jul 2018 15:15:07 +0200
parents 6740c499de13
children a9665096074b
comparison
equal deleted inserted replaced
14316:dec5d96125ee 14317:1bc96dbb5498
2455 check_cursor_col(); 2455 check_cursor_col();
2456 if (retval == OK) 2456 if (retval == OK)
2457 beginline(BL_SOL | BL_FIX); 2457 beginline(BL_SOL | BL_FIX);
2458 curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL); 2458 curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL);
2459 2459
2460 /* 2460 if (retval == OK && dir == FORWARD)
2461 * Avoid the screen jumping up and down when 'scrolloff' is non-zero. 2461 {
2462 * But make sure we scroll at least one line (happens with mix of long 2462 // Avoid the screen jumping up and down when 'scrolloff' is non-zero.
2463 * wrapping lines and non-wrapping line). 2463 // But make sure we scroll at least one line (happens with mix of long
2464 */ 2464 // wrapping lines and non-wrapping line).
2465 if (retval == OK && dir == FORWARD && check_top_offset()) 2465 if (check_top_offset())
2466 { 2466 {
2467 scroll_cursor_top(1, FALSE); 2467 scroll_cursor_top(1, FALSE);
2468 if (curwin->w_topline <= old_topline 2468 if (curwin->w_topline <= old_topline
2469 && old_topline < curbuf->b_ml.ml_line_count) 2469 && old_topline < curbuf->b_ml.ml_line_count)
2470 { 2470 {
2471 curwin->w_topline = old_topline + 1; 2471 curwin->w_topline = old_topline + 1;
2472 #ifdef FEAT_FOLDING 2472 #ifdef FEAT_FOLDING
2473 (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
2474 #endif
2475 }
2476 }
2477 #ifdef FEAT_FOLDING
2478 else if (curwin->w_botline > curbuf->b_ml.ml_line_count)
2473 (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL); 2479 (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
2474 #endif 2480 #endif
2475 }
2476 } 2481 }
2477 2482
2478 redraw_later(VALID); 2483 redraw_later(VALID);
2479 return retval; 2484 return retval;
2480 } 2485 }