comparison src/option.c @ 33690:09d88190c05c v9.0.2081

patch 9.0.2081: smoothscroll may result in wrong cursor position Commit: https://github.com/vim/vim/commit/1bf1bf569b96d2f9b28e0cce0968ffbf2fb80aac Author: Luuk van Baal <luukvbaal@gmail.com> Date: Sat Oct 28 21:43:31 2023 +0200 patch 9.0.2081: smoothscroll may result in wrong cursor position Problem: With 'smoothscroll' set, "w_skipcol" is not reset when unsetting 'wrap'. Resulting in incorrect calculation of the cursor position. Solution: Reset "w_skipcol" when unsetting 'wrap'. fixes: #12970 closes: #13439 Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 28 Oct 2023 22:00:04 +0200
parents 403d57b06231
children 26a3250fa5b2
comparison
equal deleted inserted replaced
33689:9e9aebc5f971 33690:09d88190c05c
4079 * Process the updated 'smoothscroll' option value. 4079 * Process the updated 'smoothscroll' option value.
4080 */ 4080 */
4081 char * 4081 char *
4082 did_set_smoothscroll(optset_T *args UNUSED) 4082 did_set_smoothscroll(optset_T *args UNUSED)
4083 { 4083 {
4084 if (curwin->w_p_sms) 4084 if (!curwin->w_p_sms)
4085 return NULL; 4085 curwin->w_skipcol = 0;
4086 4086
4087 curwin->w_skipcol = 0;
4088 changed_line_abv_curs();
4089 return NULL; 4087 return NULL;
4090 } 4088 }
4091 4089
4092 #if defined(FEAT_SPELL) || defined(PROTO) 4090 #if defined(FEAT_SPELL) || defined(PROTO)
4093 /* 4091 /*
4533 * Process the updated 'wrap' option value. 4531 * Process the updated 'wrap' option value.
4534 */ 4532 */
4535 char * 4533 char *
4536 did_set_wrap(optset_T *args UNUSED) 4534 did_set_wrap(optset_T *args UNUSED)
4537 { 4535 {
4538 // If 'wrap' is set, set w_leftcol to zero. 4536 // Set w_leftcol or w_skipcol to zero.
4539 if (curwin->w_p_wrap) 4537 if (curwin->w_p_wrap)
4540 curwin->w_leftcol = 0; 4538 curwin->w_leftcol = 0;
4539 else
4540 curwin->w_skipcol = 0;
4541
4541 return NULL; 4542 return NULL;
4542 } 4543 }
4543 4544
4544 /* 4545 /*
4545 * Set the value of a boolean option, and take care of side effects. 4546 * Set the value of a boolean option, and take care of side effects.