use line cache for drawings as well
[?]
Jul 20, 2022, 11:34 PM
TGHAJBESCIEGWUE2D3FGLNOIAYT4D2IRGZKRXRMTUFW7QZETC7OACDependencies
- [2]
ILOA5BYFseparate data structure for each line's cache data - [3]
UV4EWOLYadd args to some functions - [4]
ODLKHO7Bswitch to line index in a function - [5]
BW2IUB3Kkeep all text cache writes inside text.lua - [6]
BULPIBEGbeginnings of a module for the text editor - [7]
WOXIYUTLbugfix: manage screen_top and cursor when resizing - [8]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [9]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [10]
XNFTJHC4split keyboard handling between Text and Drawing - [11]
U52E2XZNfix a crash - [12]
2H67P75Xswitch arg for a function - [13]
LNUHQOGHstart passing in Editor_state explicitly - [14]
MYC7XR5Qbugfix: lines that aren't drawn from the start - [15]
GN3IF4WFbugfix: pasting newlines - [16]
3OKKTUT4up and down arrow now moving by screen line where possible - [17]
R53OF3ONone bug I've repeatedly run into while testing with Moby Dick - [18]
S2MISTTMadd state arg to a few functions - [19]
3ZSUBI57drop some redundant args from Text.draw - [20]
WLWNS6FBa bug I've never run into - [21]
WJBZZQE4fold together two largely similar cases - [22]
PTDO2SOTadd state arg to schedule_save - [23]
MTJEVRJRadd state arg to a few functions - [24]
QCPXQ2E3add state arg to a few functions - [25]
52ZZ5TIEswitch to line index in a function - [26]
HGC5RGJPswitch to line index in a function - [27]
KURLAXXIclean up some prints - [28]
IWYLK45Kclicking to the right of a line within line width - [29]
5FW7YOFThighlight selection while dragging - [30]
P66MRF3Ubugfix: don't append metadata when it already exists - [31]
SPSW74Y5add state arg to Text.keychord_pressed - [32]
Z5HLXU4Padd state arg to a few functions - [33]
LF7BWEG4group all editor globals - [34]
LSYLEVBDdrop some redundant args when clearing the cache - [35]
242L3OQXbugfix: ensure Cursor_line is always on a text line - [36]
KZ5GAYRPthis fixes the immediate regression - [37]
ZPUQSPQPextract a few methods - [38]
HOSPP2ANcrisp font rendering - [39]
PLKNHYZ4extract a function - [40]
PR4KIAZDfirst stab at equally hacky cursor down support - [41]
2L5MEZV3experiment: new edit namespace - [42]
4KC7I3E2make colors easier to edit - [43]
WZFMGVDTswitch to line index in a function - [44]
PFT5Y2ZYmove - [45]
2RXZ3PGObeginning of a new approach to scroll+wrap - [46]
WLJCIXYMadd state arg to a few functions - [47]
FKNXK2OAswitch to line index in a function - [48]
LXTTOB33extract a couple of files - [49]
MXA3RZYKdeduce left/right from state where possible
Change contents
- replacement in text.lua at line 14
local line_cache = State.text_line_cache[line_index]local line_cache = State.line_cache[line_index] - replacement in text.lua at line 91
local line_cache = State.text_line_cache[line_index]local line_cache = State.line_cache[line_index] - replacement in text.lua at line 199
table.remove(State.text_line_cache, State.cursor1.line-1)table.remove(State.line_cache, State.cursor1.line-1) - replacement in text.lua at line 205
table.remove(State.text_line_cache, State.cursor1.line)table.remove(State.line_cache, State.cursor1.line) - replacement in text.lua at line 248
table.remove(State.text_line_cache, State.cursor1.line+1)table.remove(State.line_cache, State.cursor1.line+1) - replacement in text.lua at line 341
table.insert(State.text_line_cache, State.cursor1.line+1, {})table.insert(State.line_cache, State.cursor1.line+1, {}) - replacement in text.lua at line 413
local screen_line_starting_pos = State.text_line_cache[State.cursor1.line].screen_line_starting_poslocal screen_line_starting_pos = State.line_cache[State.cursor1.line].screen_line_starting_pos - replacement in text.lua at line 435
new_screen_line_starting_pos = State.text_line_cache[State.cursor1.line].screen_line_starting_pos[screen_line_index-1]new_screen_line_starting_pos = State.line_cache[State.cursor1.line].screen_line_starting_pos[screen_line_index-1] - replacement in text.lua at line 478
new_screen_line_starting_pos = State.text_line_cache[State.cursor1.line].screen_line_starting_pos[screen_line_index+1]new_screen_line_starting_pos = State.line_cache[State.cursor1.line].screen_line_starting_pos[screen_line_index+1] - replacement in text.lua at line 615
for i=#State.text_line_cache[State.cursor1.line].screen_line_starting_pos,1,-1 dolocal spos = State.text_line_cache[State.cursor1.line].screen_line_starting_pos[i]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] - replacement in text.lua at line 626
local screen_lines = State.text_line_cache[State.cursor1.line].screen_line_starting_poslocal screen_lines = State.line_cache[State.cursor1.line].screen_line_starting_pos - replacement in text.lua at line 645
table.insert(State.text_line_cache, {})table.insert(State.line_cache, {}) - replacement in text.lua at line 692
local line_cache = State.text_line_cache[line_index]local line_cache = State.line_cache[line_index] - replacement in text.lua at line 703
local line_cache = State.text_line_cache[line_index]local line_cache = State.line_cache[line_index] - replacement in text.lua at line 735
local line_cache = State.text_line_cache[line_index]local line_cache = State.line_cache[line_index] - replacement in text.lua at line 852
for i=#State.text_line_cache[pos1.line].screen_line_starting_pos,1,-1 dolocal spos = State.text_line_cache[pos1.line].screen_line_starting_pos[i]for i=#State.line_cache[pos1.line].screen_line_starting_pos,1,-1 dolocal spos = State.line_cache[pos1.line].screen_line_starting_pos[i] - replacement in text.lua at line 867
result.pos = State.text_line_cache[pos2.line].screen_line_starting_pos[pos2.screen_line] + pos2.screen_pos - 1result.pos = State.line_cache[pos2.line].screen_line_starting_pos[pos2.screen_line] + pos2.screen_pos - 1 - replacement in text.lua at line 916
return {line=pos2.line-1, screen_line=#State.text_line_cache[pos2.line-1].screen_line_starting_pos, screen_pos=1}return {line=pos2.line-1, screen_line=#State.line_cache[pos2.line-1].screen_line_starting_pos, screen_pos=1} - replacement in text.lua at line 922
local line_cache = State.text_line_cache[line_index]local line_cache = State.line_cache[line_index] - replacement in text.lua at line 953
local line_cache = State.text_line_cache[State.screen_top1.line]local line_cache = State.line_cache[State.screen_top1.line] - replacement in text.lua at line 998
State.text_line_cache = {}State.line_cache = {} - replacement in text.lua at line 1000
State.text_line_cache[i] = {}State.line_cache[i] = {} - replacement in text.lua at line 1005
State.text_line_cache[line_index].fragments = nilState.text_line_cache[line_index].screen_line_starting_pos = nilState.line_cache[line_index].fragments = nilState.line_cache[line_index].screen_line_starting_pos = nil - replacement in select.lua at line 152
table.remove(State.text_line_cache, i)table.remove(State.line_cache, i) - replacement in edit.lua at line 67
text_line_cache = {},line_cache = {}, - replacement in edit.lua at line 124
assert(#State.lines == #State.text_line_cache)assert(#State.lines == #State.line_cache) - replacement in edit.lua at line 147
table.insert(State.text_line_cache, line_index, {})table.insert(State.line_cache, line_index, {}) - replacement in edit.lua at line 350
patch_placeholders(State.text_line_cache, event.after, event.before)patch_placeholders(State.line_cache, event.after, event.before)