bugfix
[?]
Mar 18, 2023, 4:52 AM
LK4ZW4BBDD5LC4JK4XK5DJESSDFAIRVFPDM324S7SCAUXEXYVTLQCDependencies
- [2]
2LEXWUW3get rid of some ridiculous code - [3]
ORRSP7FVdeduce test names on failures - [4]
ZPUQSPQPextract a few methods - [5]
JJDT2X4Funnecessary args - [6]
MXA3RZYKdeduce left/right from state where possible - [7]
KMSL74GAsupport selections in the source editor - [8]
KKMFQDR4editing source code from within the app - [9]
QCPXQ2E3add state arg to a few functions - [10]
UHB4GARJleft/right margin -> left/right coordinates - [11]
SPSW74Y5add state arg to Text.keychord_pressed - [12]
KECEMMMRextract couple of functions - [13]
HMODUNJEscroll on backspace - [14]
62JEPVQ3bugfix: backspace from start of final line - [15]
XNFTJHC4split keyboard handling between Text and Drawing - [16]
OI4FPFINsupport drawings in the source editor - [17]
F65ADDGLadd state arg to a few functions - [18]
HTWAM4NZbugfix: scrolling in left/right movements - [19]
G54H3YG2get rid of all bifold text - [*]
LXTTOB33extract a couple of files - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- edit in text_tests.lua at line 1282
endfunction test_up_arrow_scrolls_up_by_one_line_skipping_drawing()-- display lines 3/4/5 with a drawing just off screen at line 2App.screen.init{width=120, height=60}Editor_state = edit.initialize_test_state()Editor_state.lines = load_array{'abc', '```lines', '```', 'def', 'ghi', 'jkl'}Text.redraw_all(Editor_state)Editor_state.cursor1 = {line=3, pos=1}Editor_state.screen_top1 = {line=3, pos=1}Editor_state.screen_bottom1 = {}edit.draw(Editor_state)local y = Editor_state.topApp.screen.check(y, 'def', 'baseline/screen:1')y = y + Editor_state.line_heightApp.screen.check(y, 'ghi', 'baseline/screen:2')y = y + Editor_state.line_heightApp.screen.check(y, 'jkl', 'baseline/screen:3')-- after hitting the up arrow the screen scrolls up to previous text lineedit.run_after_keychord(Editor_state, 'up')check_eq(Editor_state.screen_top1.line, 1, 'screen_top')check_eq(Editor_state.cursor1.line, 1, 'cursor') - replacement in text.lua at line 233[4.1154]→[4.3:57](∅→∅),[4.2510]→[4.3:57](∅→∅),[4.57]→[4.15654:15731](∅→∅),[4.15654]→[4.15654:15731](∅→∅),[4.15731]→[4.540:588](∅→∅),[4.540]→[4.540:588](∅→∅)
local top2 = Text.to2(State, State.screen_top1)top2 = Text.previous_screen_line(State, top2, State.left, State.right)State.screen_top1 = Text.to1(State, top2)State.screen_top1 = {line=State.cursor1.line,pos=Text.pos_at_start_of_screen_line(State, State.cursor1),} - replacement in text.lua at line 452
local top2 = Text.to2(State, State.screen_top1)top2 = Text.previous_screen_line(State, top2)State.screen_top1 = Text.to1(State, top2)State.screen_top1 = {line=State.cursor1.line,pos=Text.pos_at_start_of_screen_line(State, State.cursor1),}Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks - replacement in text.lua at line 595
local top2 = Text.to2(State, State.screen_top1)top2 = Text.previous_screen_line(State, top2)State.screen_top1 = Text.to1(State, top2)State.screen_top1 = {line=State.cursor1.line,pos=Text.pos_at_start_of_screen_line(State, State.cursor1),}Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks - edit in source_text_tests.lua at line 1252
endfunction test_up_arrow_scrolls_up_by_one_line_skipping_drawing()-- display lines 3/4/5 with a drawing just off screen at line 2App.screen.init{width=120, height=60}Editor_state = edit.initialize_test_state()Editor_state.lines = load_array{'abc', '```lines', '```', 'def', 'ghi', 'jkl'}Text.redraw_all(Editor_state)Editor_state.cursor1 = {line=3, pos=1}Editor_state.screen_top1 = {line=3, pos=1}Editor_state.screen_bottom1 = {}edit.draw(Editor_state)local y = Editor_state.topApp.screen.check(y, 'def', 'baseline/screen:1')y = y + Editor_state.line_heightApp.screen.check(y, 'ghi', 'baseline/screen:2')y = y + Editor_state.line_heightApp.screen.check(y, 'jkl', 'baseline/screen:3')-- after hitting the up arrow the screen scrolls up to previous text lineedit.run_after_keychord(Editor_state, 'up')check_eq(Editor_state.screen_top1.line, 1, 'screen_top')check_eq(Editor_state.cursor1.line, 1, 'cursor') - replacement in source_text.lua at line 250
local top2 = Text.to2(State, State.screen_top1)top2 = Text.previous_screen_line(State, top2, State.left, State.right)State.screen_top1 = Text.to1(State, top2)State.screen_top1 = {line=State.cursor1.line,pos=Text.pos_at_start_of_screen_line(State, State.cursor1),} - replacement in source_text.lua at line 469
local top2 = Text.to2(State, State.screen_top1)top2 = Text.previous_screen_line(State, top2)State.screen_top1 = Text.to1(State, top2)State.screen_top1 = {line=State.cursor1.line,pos=Text.pos_at_start_of_screen_line(State, State.cursor1),}Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks - replacement in source_text.lua at line 612
local top2 = Text.to2(State, State.screen_top1)top2 = Text.previous_screen_line(State, top2)State.screen_top1 = Text.to1(State, top2)State.screen_top1 = {line=State.cursor1.line,pos=Text.pos_at_start_of_screen_line(State, State.cursor1),}Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks