comparison src/os_win32.c @ 16015:7e33709a3d0a v8.1.1013

patch 8.1.1013: MS-Windows: Scrolling fails when dividing the screen commit https://github.com/vim/vim/commit/3b5fef6a995f25a8a8f746896de44df49b69dfdf Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 17 14:54:53 2019 +0100 patch 8.1.1013: MS-Windows: Scrolling fails when dividing the screen Problem: MS-Windows: Scrolling fails when dividing the screen. Solution: Position the cursor before calling ScrollConsoleScreenBuffer(). (Nobuhiro Takasaki, closes #4115)
author Bram Moolenaar <Bram@vim.org>
date Sun, 17 Mar 2019 15:00:07 +0100
parents e73ed0e3faac
children 884b683d12e9
comparison
equal deleted inserted replaced
16014:e90dfd2825af 16015:7e33709a3d0a
6022 { 6022 {
6023 SMALL_RECT source, clip; 6023 SMALL_RECT source, clip;
6024 COORD dest; 6024 COORD dest;
6025 CHAR_INFO fill; 6025 CHAR_INFO fill;
6026 6026
6027 gotoxy(g_srScrollRegion.Left + 1, g_srScrollRegion.Top + 1);
6028
6027 dest.X = g_srScrollRegion.Left; 6029 dest.X = g_srScrollRegion.Left;
6028 dest.Y = g_coord.Y + cLines; 6030 dest.Y = g_coord.Y + cLines;
6029 6031
6030 source.Left = g_srScrollRegion.Left; 6032 source.Left = g_srScrollRegion.Left;
6031 source.Top = g_coord.Y; 6033 source.Top = g_coord.Y;
6035 clip.Left = g_srScrollRegion.Left; 6037 clip.Left = g_srScrollRegion.Left;
6036 clip.Top = g_coord.Y; 6038 clip.Top = g_coord.Y;
6037 clip.Right = g_srScrollRegion.Right; 6039 clip.Right = g_srScrollRegion.Right;
6038 clip.Bottom = g_srScrollRegion.Bottom; 6040 clip.Bottom = g_srScrollRegion.Bottom;
6039 6041
6040 { 6042 fill.Char.AsciiChar = ' ';
6041 fill.Char.AsciiChar = ' '; 6043 if (!USE_VTP)
6042 if (!USE_VTP) 6044 fill.Attributes = g_attrCurrent;
6043 fill.Attributes = g_attrCurrent; 6045 else
6044 else 6046 fill.Attributes = g_attrDefault;
6045 fill.Attributes = g_attrDefault; 6047
6046 6048 set_console_color_rgb();
6047 set_console_color_rgb(); 6049
6048 6050 ScrollConsoleScreenBuffer(g_hConOut, &source, &clip, dest, &fill);
6049 ScrollConsoleScreenBuffer(g_hConOut, &source, &clip, dest, &fill); 6051
6050 }
6051 // Here we have to deal with a win32 console flake: If the scroll 6052 // Here we have to deal with a win32 console flake: If the scroll
6052 // region looks like abc and we scroll c to a and fill with d we get 6053 // region looks like abc and we scroll c to a and fill with d we get
6053 // cbd... if we scroll block c one line at a time to a, we get cdd... 6054 // cbd... if we scroll block c one line at a time to a, we get cdd...
6054 // vim expects cdd consistently... So we have to deal with that 6055 // vim expects cdd consistently... So we have to deal with that
6055 // here... (this also occurs scrolling the same way in the other 6056 // here... (this also occurs scrolling the same way in the other
6079 SMALL_RECT source, clip; 6080 SMALL_RECT source, clip;
6080 COORD dest; 6081 COORD dest;
6081 CHAR_INFO fill; 6082 CHAR_INFO fill;
6082 int nb; 6083 int nb;
6083 6084
6085 gotoxy(g_srScrollRegion.Left + 1, g_srScrollRegion.Top + 1);
6086
6084 dest.X = g_srScrollRegion.Left; 6087 dest.X = g_srScrollRegion.Left;
6085 dest.Y = g_coord.Y; 6088 dest.Y = g_coord.Y;
6086 6089
6087 source.Left = g_srScrollRegion.Left; 6090 source.Left = g_srScrollRegion.Left;
6088 source.Top = g_coord.Y + cLines; 6091 source.Top = g_coord.Y + cLines;
6092 clip.Left = g_srScrollRegion.Left; 6095 clip.Left = g_srScrollRegion.Left;
6093 clip.Top = g_coord.Y; 6096 clip.Top = g_coord.Y;
6094 clip.Right = g_srScrollRegion.Right; 6097 clip.Right = g_srScrollRegion.Right;
6095 clip.Bottom = g_srScrollRegion.Bottom; 6098 clip.Bottom = g_srScrollRegion.Bottom;
6096 6099
6097 { 6100 fill.Char.AsciiChar = ' ';
6098 fill.Char.AsciiChar = ' '; 6101 if (!USE_VTP)
6099 if (!USE_VTP) 6102 fill.Attributes = g_attrCurrent;
6100 fill.Attributes = g_attrCurrent; 6103 else
6101 else 6104 fill.Attributes = g_attrDefault;
6102 fill.Attributes = g_attrDefault; 6105
6103 6106 set_console_color_rgb();
6104 set_console_color_rgb(); 6107
6105 6108 ScrollConsoleScreenBuffer(g_hConOut, &source, &clip, dest, &fill);
6106 ScrollConsoleScreenBuffer(g_hConOut, &source, &clip, dest, &fill); 6109
6107 }
6108 // Here we have to deal with a win32 console flake; See insert_lines() 6110 // Here we have to deal with a win32 console flake; See insert_lines()
6109 // above. 6111 // above.
6110 6112
6111 nb = dest.Y + (source.Bottom - source.Top) + 1; 6113 nb = dest.Y + (source.Bottom - source.Top) + 1;
6112 6114