diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-03-17 14:54:53 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-03-17 14:54:53 +0100 |
commit | 3b5fef6a995f25a8a8f746896de44df49b69dfdf (patch) | |
tree | bd38493f56b5c5653010ecd75cc098dd33930b8d /src/os_win32.c | |
parent | ab89d7ab89a1dd7e40cc28df96c71c11b5ab9089 (diff) | |
download | vim-git-3b5fef6a995f25a8a8f746896de44df49b69dfdf.tar.gz |
patch 8.1.1013: MS-Windows: Scrolling fails when dividing the screenv8.1.1013
Problem: MS-Windows: Scrolling fails when dividing the screen.
Solution: Position the cursor before calling ScrollConsoleScreenBuffer().
(Nobuhiro Takasaki, closes #4115)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r-- | src/os_win32.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/os_win32.c b/src/os_win32.c index 876a7a409..ff1177722 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -6024,6 +6024,8 @@ insert_lines(unsigned cLines) COORD dest; CHAR_INFO fill; + gotoxy(g_srScrollRegion.Left + 1, g_srScrollRegion.Top + 1); + dest.X = g_srScrollRegion.Left; dest.Y = g_coord.Y + cLines; @@ -6037,17 +6039,16 @@ insert_lines(unsigned cLines) clip.Right = g_srScrollRegion.Right; clip.Bottom = g_srScrollRegion.Bottom; - { - fill.Char.AsciiChar = ' '; - if (!USE_VTP) - fill.Attributes = g_attrCurrent; - else - fill.Attributes = g_attrDefault; + fill.Char.AsciiChar = ' '; + if (!USE_VTP) + fill.Attributes = g_attrCurrent; + else + fill.Attributes = g_attrDefault; - set_console_color_rgb(); + set_console_color_rgb(); + + ScrollConsoleScreenBuffer(g_hConOut, &source, &clip, dest, &fill); - ScrollConsoleScreenBuffer(g_hConOut, &source, &clip, dest, &fill); - } // Here we have to deal with a win32 console flake: If the scroll // region looks like abc and we scroll c to a and fill with d we get // cbd... if we scroll block c one line at a time to a, we get cdd... @@ -6081,6 +6082,8 @@ delete_lines(unsigned cLines) CHAR_INFO fill; int nb; + gotoxy(g_srScrollRegion.Left + 1, g_srScrollRegion.Top + 1); + dest.X = g_srScrollRegion.Left; dest.Y = g_coord.Y; @@ -6094,17 +6097,16 @@ delete_lines(unsigned cLines) clip.Right = g_srScrollRegion.Right; clip.Bottom = g_srScrollRegion.Bottom; - { - fill.Char.AsciiChar = ' '; - if (!USE_VTP) - fill.Attributes = g_attrCurrent; - else - fill.Attributes = g_attrDefault; + fill.Char.AsciiChar = ' '; + if (!USE_VTP) + fill.Attributes = g_attrCurrent; + else + fill.Attributes = g_attrDefault; - set_console_color_rgb(); + set_console_color_rgb(); + + ScrollConsoleScreenBuffer(g_hConOut, &source, &clip, dest, &fill); - ScrollConsoleScreenBuffer(g_hConOut, &source, &clip, dest, &fill); - } // Here we have to deal with a win32 console flake; See insert_lines() // above. |