Skip to content

Commit a418fe8

Browse files
committed
updated for version 7.3.830
Problem: :mksession confuses bytes, columns and characters when positioning the cursor. Solution: Use w_virtcol with "|" instead of w_cursor.col with "l".
1 parent f8fa0fa commit a418fe8

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/ex_docmd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10829,24 +10829,24 @@ put_view(fd, wp, add_edit, flagp, current_arg_idx)
1082910829
{
1083010830
if (fprintf(fd,
1083110831
"let s:c = %ld - ((%ld * winwidth(0) + %ld) / %ld)",
10832-
(long)wp->w_cursor.col,
10833-
(long)(wp->w_cursor.col - wp->w_leftcol),
10832+
(long)wp->w_virtcol + 1,
10833+
(long)(wp->w_virtcol - wp->w_leftcol),
1083410834
(long)wp->w_width / 2, (long)wp->w_width) < 0
1083510835
|| put_eol(fd) == FAIL
1083610836
|| put_line(fd, "if s:c > 0") == FAIL
1083710837
|| fprintf(fd,
10838-
" exe 'normal! 0' . s:c . 'lzs' . (%ld - s:c) . 'l'",
10839-
(long)wp->w_cursor.col) < 0
10838+
" exe 'normal! ' . s:c . '|zs' . %ld . '|'",
10839+
(long)wp->w_virtcol + 1) < 0
1084010840
|| put_eol(fd) == FAIL
1084110841
|| put_line(fd, "else") == FAIL
10842-
|| fprintf(fd, " normal! 0%dl", wp->w_cursor.col) < 0
10842+
|| fprintf(fd, " normal! %d|", wp->w_virtcol + 1) < 0
1084310843
|| put_eol(fd) == FAIL
1084410844
|| put_line(fd, "endif") == FAIL)
1084510845
return FAIL;
1084610846
}
1084710847
else
1084810848
{
10849-
if (fprintf(fd, "normal! 0%dl", wp->w_cursor.col) < 0
10849+
if (fprintf(fd, "normal! 0%d|", wp->w_virtcol + 1) < 0
1085010850
|| put_eol(fd) == FAIL)
1085110851
return FAIL;
1085210852
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ static char *(features[]) =
728728

729729
static int included_patches[] =
730730
{ /* Add new patch number below this line */
731+
/**/
732+
830,
731733
/**/
732734
829,
733735
/**/

0 commit comments

Comments
 (0)