view src/libvterm/t/63screen_resize.test @ 29247:5f314b2ed494 v8.2.5142

patch 8.2.5142: startup test fails if there is a status bar Commit: https://github.com/vim/vim/commit/fa04eae5a5b9394079bde2d37ce6f9f8a5567d48 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 21 14:38:40 2022 +0100 patch 8.2.5142: startup test fails if there is a status bar Problem: Startup test fails if there is a status bar at the top of the screen. (Ernie Rael) Solution: Use a larger vertical offset in the test.
author Bram Moolenaar <Bram@vim.org>
date Tue, 21 Jun 2022 18:45:07 +0200
parents f5206c704403
children 2d2758ffd959
line wrap: on
line source

INIT
WANTSTATE
WANTSCREEN

!Resize wider preserves cells
RESET
RESIZE 25,80
PUSH "AB\r\nCD"
  ?screen_chars 0,0,1,80 = "AB"
  ?screen_chars 1,0,2,80 = "CD"
RESIZE 25,100
  ?screen_chars 0,0,1,100 = "AB"
  ?screen_chars 1,0,2,100 = "CD"

!Resize wider allows print in new area
RESET
RESIZE 25,80
PUSH "AB\e[79GCD"
  ?screen_chars 0,0,1,2 = "AB"
  ?screen_chars 0,78,1,80 = "CD"
RESIZE 25,100
  ?screen_chars 0,0,1,2 = "AB"
  ?screen_chars 0,78,1,80 = "CD"
PUSH "E"
  ?screen_chars 0,78,1,81 = "CDE"

!Resize shorter with blanks just truncates
RESET
RESIZE 25,80
PUSH "Top\e[10HLine 10"
  ?screen_chars 0,0,1,80 = "Top"
  ?screen_chars 9,0,10,80 = "Line 10"
  ?cursor = 9,7
RESIZE 20,80
  ?screen_chars 0,0,1,80 = "Top"
  ?screen_chars 9,0,10,80 = "Line 10"
  ?cursor = 9,7

!Resize shorter with content must scroll
RESET
RESIZE 25,80
PUSH "Top\e[25HLine 25\e[15H"
  ?screen_chars 0,0,1,80 = "Top"
  ?screen_chars 24,0,25,80 = "Line 25"
  ?cursor = 14,0
WANTSCREEN b
RESIZE 20,80
  sb_pushline 80 = 54 6F 70
  sb_pushline 80 =
  sb_pushline 80 =
  sb_pushline 80 =
  sb_pushline 80 =
  ?screen_chars 0,0,1,80 = 
  ?screen_chars 19,0,20,80 = "Line 25"
  ?cursor = 9,0

!Resize shorter does not lose line with cursor
# See also https://github.com/neovim/libvterm/commit/1b745d29d45623aa8d22a7b9288c7b0e331c7088
RESET
WANTSCREEN -b
RESIZE 25,80
WANTSCREEN b
PUSH "\e[24HLine 24\r\nLine 25\r\n"
  sb_pushline 80 =
  ?screen_chars 23,0,24,10 = "Line 25"
  ?cursor = 24,0
RESIZE 24,80
  sb_pushline 80 =
  ?screen_chars 22,0,23,10 = "Line 25"
  ?cursor = 23,0

!Resize shorter does not send the cursor to a negative row
# See also https://github.com/vim/vim/pull/6141
RESET
WANTSCREEN -b
RESIZE 25,80
WANTSCREEN b
PUSH "\e[24HLine 24\r\nLine 25\e[H"
  ?cursor = 0,0
RESIZE 20,80
  sb_pushline 80 =
  sb_pushline 80 =
  sb_pushline 80 =
  sb_pushline 80 =
  sb_pushline 80 =
  ?cursor = 0,0

!Resize taller attempts to pop scrollback
RESET
WANTSCREEN -b
RESIZE 25,80
PUSH "Line 1\e[25HBottom\e[15H"
  ?screen_chars 0,0,1,80 = "Line 1"
  ?screen_chars 24,0,25,80 = "Bottom"
  ?cursor = 14,0
WANTSCREEN b
RESIZE 30,80
  sb_popline 80
  sb_popline 80
  sb_popline 80
  sb_popline 80
  sb_popline 80
  ?screen_chars 0,0,1,80 = "ABCDE"
  ?screen_chars 5,0,6,80 = "Line 1"
  ?screen_chars 29,0,30,80 = "Bottom"
  ?cursor = 19,0
WANTSCREEN -b

!Resize can operate on altscreen
RESET
WANTSCREEN a
RESIZE 25,80
PUSH "Main screen\e[?1049h\e[HAlt screen"
RESIZE 30,80
  ?screen_chars 0,0,1,3 = "Alt"
PUSH "\e[?1049l"
  ?screen_chars 0,0,1,3 = "Mai"