generalize a function
[?]
Aug 18, 2022, 5:22 PM
GNQC72UXBU6KYXW6MXLNRGTLXV2VPQXMVCLYMJT6POTFXSF5ASJACDependencies
- [2]
ZW3JGTEOdrop some obsolete args - [3]
SVJZZDC3snapshot - no, that's all wrong - [4]
ZPUQSPQPextract a few methods - [5]
4J2L6JMRbugfix: deleting a selection spanning pages - [6]
ILOA5BYFseparate data structure for each line's cache data - [7]
ELJNEPW2simplify cursor-on-screen check - [8]
MXA3RZYKdeduce left/right from state where possible - [9]
2EKE4XLLsimplify - [10]
2TQR4PSYadd args to some functions - [11]
KOYAJWE4extract a couple more methods - [12]
LF7BWEG4group all editor globals - [13]
UHB4GARJleft/right margin -> left/right coordinates - [14]
XNFTJHC4split keyboard handling between Text and Drawing - [15]
ODLKHO7Bswitch to line index in a function - [16]
S2MISTTMadd state arg to a few functions - [17]
NHNP76LGswap return values - [18]
LXTTOB33extract a couple of files - [19]
YJJ4X4JGbugfix: avoid scrolling on 'end' - [20]
5ZA3BRNYadd state arg to a few functions - [21]
WOXIYUTLbugfix: manage screen_top and cursor when resizing - [22]
HTWAM4NZbugfix: scrolling in left/right movements - [23]
Z5HLXU4Padd state arg to a few functions - [24]
TGHAJBESuse line cache for drawings as well - [25]
WLJCIXYMadd state arg to a few functions - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- replacement in text.lua at line 429
local screen_line_starting_pos, screen_line_index = Text.pos_at_start_of_cursor_screen_line(State)local screen_line_starting_pos, screen_line_index = Text.pos_at_start_of_screen_line(State, State.cursor1) - replacement in text.lua at line 503
local screen_line_starting_pos, screen_line_index = Text.pos_at_start_of_cursor_screen_line(State)local screen_line_starting_pos, screen_line_index = Text.pos_at_start_of_screen_line(State, State.cursor1) - replacement in text.lua at line 528
local botpos = Text.pos_at_start_of_cursor_screen_line(State)local botpos = Text.pos_at_start_of_screen_line(State, State.cursor1) - replacement in text.lua at line 639[3.1332]→[3.2287:2343](∅→∅),[3.2343]→[3.283:351](∅→∅),[3.351]→[3.689:850](∅→∅),[3.850]→[3.768:806](∅→∅),[3.5047]→[3.768:806](∅→∅),[3.768]→[3.768:806](∅→∅)
function Text.pos_at_start_of_cursor_screen_line(State)Text.populate_screen_line_starting_pos(State, State.cursor1.line)for i=#State.line_cache[State.cursor1.line].screen_line_starting_pos,1,-1 dolocal spos = State.line_cache[State.cursor1.line].screen_line_starting_pos[i]if spos <= State.cursor1.pos thenfunction Text.pos_at_start_of_screen_line(State, loc1)Text.populate_screen_line_starting_pos(State, loc1.line)local line_cache = State.line_cache[loc1.line]for i=#line_cache.screen_line_starting_pos,1,-1 dolocal spos = line_cache.screen_line_starting_pos[i]if spos <= loc1.pos then - replacement in text.lua at line 988
--? local botpos = Text.pos_at_start_of_cursor_screen_line(State)--? local botpos = Text.pos_at_start_of_screen_line(State, State.cursor1) - replacement in select.lua at line 133
State.screen_top1.pos = Text.pos_at_start_of_cursor_screen_line(State)State.screen_top1.pos = Text.pos_at_start_of_screen_line(State, State.cursor1) - replacement in search.lua at line 65
local pos = Text.pos_at_start_of_cursor_screen_line(State)local pos = Text.pos_at_start_of_screen_line(State, State.cursor1) - replacement in search.lua at line 113
local pos = Text.pos_at_start_of_cursor_screen_line(State)local pos = Text.pos_at_start_of_screen_line(State, State.cursor1)