This bug was introduced in commit 528c64d690 on 2022-09-05 :/
SWZAQHGRX3T5MZVM7YZ4EACZX5ON2NUZG5YXLWVEXLL3WZUZYAFQC
ORRSP7FVCHI2TF5GXBRGQYYJAA3JFYXZBM3T663BKSBV22FCZVCAC
LXTTOB33N2HCUZFIUDRQGGBVHK2HODRG4NBLH6RXRQZDCHF27BSAC
ZPUQSPQPQFVRUIHGLAWW3IDBYODIWDHO62HAC3WWF5TM3CIJGHNQC
OI4FPFINEROK6GNDEMOBTGSPYIULCLRGGT5W3H7VLM7VFH22GMWQC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
ODLKHO7BO2AODYO2OEQ6D4NSNBT5GR3CKLUXWMDLRYXL7DJOI7BAC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
end
function test_down_arrow_skips_drawing()
-- some lines of text with a drawing intermixed
local drawing_width = 50
App.screen.init{width=Editor_state.left+drawing_width, height=100}
Editor_state = edit.initialize_test_state()
Editor_state.lines = load_array{'abc', -- height 15
'```lines', '```', -- height 25
'ghi'}
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=1, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.screen_bottom1 = {}
edit.draw(Editor_state)
local y = Editor_state.top
App.screen.check(y, 'abc', 'baseline/screen:1')
y = y + Editor_state.line_height
local drawing_height = Drawing_padding_height + drawing_width/2 -- default
y = y + drawing_height
App.screen.check(y, 'ghi', 'baseline/screen:3')
check(Editor_state.cursor_x, 'baseline/cursor_x')
-- after hitting the down arrow the cursor moves down by 2 lines, skipping the drawing
edit.run_after_keychord(Editor_state, 'down')
check_eq(Editor_state.cursor1.line, 3, 'cursor')
function test_up_arrow_skips_drawing()
-- some lines of text with a drawing intermixed
local drawing_width = 50
App.screen.init{width=Editor_state.left+drawing_width, height=100}
Editor_state = edit.initialize_test_state()
Editor_state.lines = load_array{'abc', -- height 15
'```lines', '```', -- height 25
'ghi'}
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=3, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.screen_bottom1 = {}
edit.draw(Editor_state)
local y = Editor_state.top
App.screen.check(y, 'abc', 'baseline/screen:1')
y = y + Editor_state.line_height
local drawing_height = Drawing_padding_height + drawing_width/2 -- default
y = y + drawing_height
App.screen.check(y, 'ghi', 'baseline/screen:3')
check(Editor_state.cursor_x, 'baseline/cursor_x')
-- after hitting the up arrow the cursor moves up by 2 lines, skipping the drawing
edit.run_after_keychord(Editor_state, 'up')
check_eq(Editor_state.cursor1.line, 1, 'cursor')
end
end
function test_down_arrow_skips_drawing()
-- some lines of text with a drawing intermixed
local drawing_width = 50
App.screen.init{width=Editor_state.left+drawing_width, height=100}
Editor_state = edit.initialize_test_state()
Editor_state.lines = load_array{'abc', -- height 15
'```lines', '```', -- height 25
'ghi'}
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=1, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.screen_bottom1 = {}
edit.draw(Editor_state)
local y = Editor_state.top
App.screen.check(y, 'abc', 'baseline/screen:1')
y = y + Editor_state.line_height
local drawing_height = Drawing_padding_height + drawing_width/2 -- default
y = y + drawing_height
App.screen.check(y, 'ghi', 'baseline/screen:3')
check(Editor_state.cursor_x, 'baseline/cursor_x')
-- after hitting the down arrow the cursor moves down by 2 lines, skipping the drawing
edit.run_after_keychord(Editor_state, 'down')
check_eq(Editor_state.cursor1.line, 3, 'cursor')
function test_up_arrow_skips_drawing()
-- some lines of text with a drawing intermixed
local drawing_width = 50
App.screen.init{width=Editor_state.left+drawing_width, height=100}
Editor_state = edit.initialize_test_state()
Editor_state.lines = load_array{'abc', -- height 15
'```lines', '```', -- height 25
'ghi'}
Text.redraw_all(Editor_state)
Editor_state.cursor1 = {line=3, pos=1}
Editor_state.screen_top1 = {line=1, pos=1}
Editor_state.screen_bottom1 = {}
edit.draw(Editor_state)
local y = Editor_state.top
App.screen.check(y, 'abc', 'baseline/screen:1')
y = y + Editor_state.line_height
local drawing_height = Drawing_padding_height + drawing_width/2 -- default
y = y + drawing_height
App.screen.check(y, 'ghi', 'baseline/screen:3')
check(Editor_state.cursor_x, 'baseline/cursor_x')
-- after hitting the up arrow the cursor moves up by 2 lines, skipping the drawing
edit.run_after_keychord(Editor_state, 'up')
check_eq(Editor_state.cursor1.line, 1, 'cursor')
end