Skip to content

Commit 2313b61

Browse files
committed
patch 8.1.2085: MS-Windows: draw error moving cursor over double-cell char
Problem: MS-Windows: draw error moving cursor over double-cell character. Solution: Move the cursor to the left edge if needed. (Nobuhiro Takasaki, closes #4986)
1 parent 5e8e967 commit 2313b61

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

src/os_win32.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5831,7 +5831,7 @@ delete_lines(unsigned cLines)
58315831

58325832

58335833
/*
5834-
* Set the cursor position
5834+
* Set the cursor position to (x,y) (1-based).
58355835
*/
58365836
static void
58375837
gotoxy(
@@ -5841,14 +5841,25 @@ gotoxy(
58415841
if (x < 1 || x > (unsigned)Columns || y < 1 || y > (unsigned)Rows)
58425842
return;
58435843

5844-
/* external cursor coords are 1-based; internal are 0-based */
5845-
g_coord.X = x - 1;
5846-
g_coord.Y = y - 1;
5847-
58485844
if (!USE_VTP)
5845+
{
5846+
// external cursor coords are 1-based; internal are 0-based
5847+
g_coord.X = x - 1;
5848+
g_coord.Y = y - 1;
58495849
SetConsoleCursorPosition(g_hConOut, g_coord);
5850+
}
58505851
else
5852+
{
5853+
// Move the cursor to the left edge of the screen to prevent screen
5854+
// destruction. Insider build bug.
5855+
if (conpty_type == 3)
5856+
vtp_printf("\033[%d;%dH", g_coord.Y + 1, 1);
5857+
58515858
vtp_printf("\033[%d;%dH", y, x);
5859+
5860+
g_coord.X = x - 1;
5861+
g_coord.Y = y - 1;
5862+
}
58525863
}
58535864

58545865

@@ -7266,7 +7277,7 @@ mch_setenv(char *var, char *value, int x UNUSED)
72667277
* Confirm until this version. Also the logic changes.
72677278
* insider preview.
72687279
*/
7269-
#define CONPTY_INSIDER_BUILD MAKE_VER(10, 0, 18898)
7280+
#define CONPTY_INSIDER_BUILD MAKE_VER(10, 0, 18990)
72707281

72717282
/*
72727283
* Not stable now.

src/version.c

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

758758
static int included_patches[] =
759759
{ /* Add new patch number below this line */
760+
/**/
761+
2085,
760762
/**/
761763
2084,
762764
/**/

0 commit comments

Comments
 (0)