1
0
forked from aniani/vim

patch 9.1.0759: screenpos() may return invalid position

Problem:  screenpos() may return invalid position
          after switching buffers (Greg Hurrell)
Solution: reset w_leftcol if wrapping has been set
          after copying wrap option

fixes: #15792
closes: #15803

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2024-10-05 17:30:22 +02:00
parent 7c3f9af0ed
commit b065a10e24
3 changed files with 22 additions and 0 deletions

View File

@@ -6737,6 +6737,11 @@ win_copy_options(win_T *wp_from, win_T *wp_to)
void
after_copy_winopt(win_T *wp)
{
// Set w_leftcol or w_skipcol to zero.
if (wp->w_p_wrap)
wp->w_leftcol = 0;
else
wp->w_skipcol = 0;
#ifdef FEAT_LINEBREAK
briopt_check(wp);
#endif