comparison src/misc2.c @ 15713:ad8b2c109b22 v8.1.0864

patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff' commit https://github.com/vim/vim/commit/375e3390078e740d3c83b0c118c50d9a920036c7 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 31 18:26:10 2019 +0100 patch 8.1.0864: cannot have a local value for 'scrolloff' and 'sidescrolloff' Problem: Cannot have a local value for 'scrolloff' and 'sidescrolloff'. (Gary Holloway) Solution: Make 'scrolloff' and 'sidescrolloff' global-local. (mostly by Aron Widforss, closes #3539)
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Jan 2019 18:30:08 +0100
parents 01890a3caefd
children 99ebf78686a9
comparison
equal deleted inserted replaced
15712:bc1989f9bd37 15713:ad8b2c109b22
641 leftcol_changed(void) 641 leftcol_changed(void)
642 { 642 {
643 long lastcol; 643 long lastcol;
644 colnr_T s, e; 644 colnr_T s, e;
645 int retval = FALSE; 645 int retval = FALSE;
646 long siso = get_sidescrolloff_value();
646 647
647 changed_cline_bef_curs(); 648 changed_cline_bef_curs();
648 lastcol = curwin->w_leftcol + curwin->w_width - curwin_col_off() - 1; 649 lastcol = curwin->w_leftcol + curwin->w_width - curwin_col_off() - 1;
649 validate_virtcol(); 650 validate_virtcol();
650 651
651 /* 652 /*
652 * If the cursor is right or left of the screen, move it to last or first 653 * If the cursor is right or left of the screen, move it to last or first
653 * character. 654 * character.
654 */ 655 */
655 if (curwin->w_virtcol > (colnr_T)(lastcol - p_siso)) 656 if (curwin->w_virtcol > (colnr_T)(lastcol - siso))
656 { 657 {
657 retval = TRUE; 658 retval = TRUE;
658 coladvance((colnr_T)(lastcol - p_siso)); 659 coladvance((colnr_T)(lastcol - siso));
659 } 660 }
660 else if (curwin->w_virtcol < curwin->w_leftcol + p_siso) 661 else if (curwin->w_virtcol < curwin->w_leftcol + siso)
661 { 662 {
662 retval = TRUE; 663 retval = TRUE;
663 (void)coladvance((colnr_T)(curwin->w_leftcol + p_siso)); 664 (void)coladvance((colnr_T)(curwin->w_leftcol + siso));
664 } 665 }
665 666
666 /* 667 /*
667 * If the start of the character under the cursor is not on the screen, 668 * If the start of the character under the cursor is not on the screen,
668 * advance the cursor one more char. If this fails (last char of the 669 * advance the cursor one more char. If this fails (last char of the