deduce left/right from state where possible
[?]
Jul 13, 2022, 3:59 AM
MXA3RZYKUI4UF2ISY7JEF6VKX6NOPZMZH5SLLCZHRJKFIXXXDPSACDependencies
- [2]
NDHQN23Gdone passing left/right margins everywhere - [3]
MTJEVRJRadd state arg to a few functions - [4]
UHB4GARJleft/right margin -> left/right coordinates - [5]
2L5MEZV3experiment: new edit namespace - [6]
5DOTWNVMright margin - [7]
U7M4M2F7bugfix: don't rely on Screen_bottom1 while scrolling - [8]
CBPV5SSIstop handling nil screen_line_starting_pos everywhere - [9]
KECEMMMRextract couple of functions - [10]
HOSPP2ANcrisp font rendering - [11]
WLJCIXYMadd state arg to a few functions - [12]
PR4KIAZDfirst stab at equally hacky cursor down support - [13]
DRFE3B3Zmouse buttons are integers, not strings - [14]
CVSRHMJ2experiment: slightly adaptive scrolling - [15]
2RXZ3PGObeginning of a new approach to scroll+wrap - [16]
MYC7XR5Qbugfix: lines that aren't drawn from the start - [17]
2ZRC7FUL. - [18]
AYE2VEGJextract a couple of methods - [19]
2LC3BM2Nsupport other whitespace chars in word movements - [20]
ULKLJBN6couple of renames - [21]
HIKLULFQextract a function - [22]
MDXGMZU2disable all debug prints - [23]
ZZ2B5RPQextract variables for drawing padding - [24]
QCPXQ2E3add state arg to a few functions - [25]
537TQ2QNsome more logging - [26]
U52E2XZNfix a crash - [27]
CUIV2LE5some typos - [28]
A2NV3WVOscrolling with up arrow - [29]
2TQR4PSYadd args to some functions - [30]
GGJEDJOOadd args to some functions - [31]
GN3IF4WFbugfix: pasting newlines - [32]
EMRPLZPWdrop an arg from a function - [33]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [34]
AIRIP35Zcleaner - [35]
V3EABA35skip multiple consecutive whitespace - [36]
FHSZYAZ2more precise search highlighting - [37]
JRGTJ2IWquite the frustrating bugfix - [38]
F65ADDGLadd state arg to a few functions - [39]
242L3OQXbugfix: ensure Cursor_line is always on a text line - [40]
3TFEAQSWstart using some globals - [41]
KOTI3MFGbugfix in previous commit - [42]
KZ5GAYRPthis fixes the immediate regression - [43]
WOXIYUTLbugfix: manage screen_top and cursor when resizing - [44]
LERERVPHkeep one screen line of overlap on pagedown - [45]
GK47BBCYstart passing left/right margins everywhere - [46]
TRNWIQN6more precise height calculation when scrolling up as much as possible while keeping cursor on screen - [47]
QCQTMUZ7add args to some functions - [48]
QLTJG7Q3indent - [49]
QYIFOHW3first test! - [50]
LXTTOB33extract a couple of files - [51]
CCYSVZA2bugfix: BSOD in #4. - [52]
5L7K4GBDclicking to the right of a wrapped line - [53]
BZRRUIFQcorrect location of the line width slider - [54]
OYXDYPGSget rid of debug variables - [55]
HTWAM4NZbugfix: scrolling in left/right movements - [56]
LF7BWEG4group all editor globals - [57]
T57DTBX6add args to some functions - [58]
4VKEE43Zbugfix - [59]
LNUHQOGHstart passing in Editor_state explicitly - [60]
GCEF4N3Vstop repeatedly checking for line wrapping - [61]
OGUV4HSAremove some memory leaks from rendered fragments - [62]
4CXVIEBSadd args to some functions - [63]
OP643FFGmove - [64]
K4OBZSHEadd args to some functions - [65]
4KC7I3E2make colors easier to edit - [66]
MP2TBKU6bugfix: crash in Text.up() after return - [67]
S2MISTTMadd state arg to a few functions - [68]
BTKAW76Lrename - [69]
CTJ3IZGSadd args to some functions - [70]
2CH77LZCadd args to some functions - [71]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [72]
5OALPNN3add args to some functions - [73]
4J2L6JMRbugfix: deleting a selection spanning pages - [74]
SVJZZDC3snapshot - no, that's all wrong - [75]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [76]
ESETRNLBbugfix: printing the first part of a line at the bottom made it seem non-wrapping - [77]
IMEJA43Lsnapshot - [78]
CVGE3SIGI feel confident now that page-down is working. - [79]
WLHI7KD3new globals: draw partial screen line up top - [80]
3OKKTUT4up and down arrow now moving by screen line where possible - [81]
ZPUQSPQPextract a few methods - [82]
ZHLO7K3Madd args to some functions - [83]
2LOQ5ALJadd args to some functions - [84]
DHI6IJCNselecting text and deleting selections - [85]
YJJ4X4JGbugfix: avoid scrolling on 'end' - [86]
2H67P75Xswitch arg for a function - [87]
R22PA3XRfix a second BSOD in #4 :/ - [88]
BULPIBEGbeginnings of a module for the text editor - [89]
M6TH7VSZrip out notion of Line_width - [90]
UV4EWOLYadd args to some functions - [91]
4CTZOJPCstop pretending globals are local - [92]
X3F7ECSLadd state arg to some functions - [93]
Z5HLXU4Padd state arg to a few functions - [94]
KOYAJWE4extract a couple more methods - [95]
EGH7XDBKsupport non-text lines in Text.to2 - [96]
5FW7YOFThighlight selection while dragging - [97]
JY4VK7L2rename - [98]
LAW2O3NWextract variable Margin_left - [99]
62PZGSUCoptimization: moving cursor to next word - [100]
JJ7J4PUBsome unnecessary mutations
Change contents
- replacement in text.lua at line 12
function Text.draw(State, line, line_index, top, left, right)function Text.draw(State, line, line_index, top) - replacement in text.lua at line 16
local x = leftlocal x = State.left - replacement in text.lua at line 21
Text.compute_fragments(line, left, right)Text.compute_fragments(line, State.left, State.right) - replacement in text.lua at line 23
Text.populate_screen_line_starting_pos(line, left, right)Text.populate_screen_line_starting_pos(line, State.left, State.right) - replacement in text.lua at line 32
if x + frag_width > right thenassert(x > left) -- no overfull linesif x + frag_width > State.right thenassert(x > State.left) -- no overfull lines - replacement in text.lua at line 44
x = leftx = State.left - replacement in text.lua at line 50
local lo, hi = Text.clip_selection(State, line_index, pos, pos+frag_len, left, right)local lo, hi = Text.clip_selection(State, line_index, pos, pos+frag_len) - replacement in text.lua at line 354
function Text.pageup(State, left, right)function Text.pageup(State) - replacement in text.lua at line 357
local top2 = Text.to2(State, State.screen_top1, left, right)local top2 = Text.to2(State, State.screen_top1) - replacement in text.lua at line 368
top2 = Text.previous_screen_line(State, top2, left, right)top2 = Text.previous_screen_line(State, top2) - replacement in text.lua at line 373
Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State, left, right)Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State) - replacement in text.lua at line 378
function Text.pagedown(State, left, right)function Text.pagedown(State) - replacement in text.lua at line 383
local top2 = Text.to2(State, State.screen_bottom1, left, right)local top2 = Text.to2(State, State.screen_bottom1) - replacement in text.lua at line 397
Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State, left, right)Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State) - replacement in text.lua at line 403
function Text.up(State, left, right)function Text.up(State) - replacement in text.lua at line 406
local screen_line_index,screen_line_starting_pos = Text.pos_at_start_of_cursor_screen_line(State, left, right)local screen_line_index,screen_line_starting_pos = Text.pos_at_start_of_cursor_screen_line(State) - replacement in text.lua at line 416
Text.populate_screen_line_starting_pos(State.lines[State.cursor1.line], left, right)Text.populate_screen_line_starting_pos(State.lines[State.cursor1.line], State.left, State.right) - replacement in text.lua at line 430
State.cursor1.pos = screen_line_starting_pos + Text.nearest_cursor_pos(s, State.cursor_x, left) - 1State.cursor1.pos = screen_line_starting_pos + Text.nearest_cursor_pos(s, State.cursor_x, State.left) - 1 - replacement in text.lua at line 449
State.cursor1.pos = new_screen_line_starting_pos + Text.nearest_cursor_pos(s, State.cursor_x, left) - 1State.cursor1.pos = new_screen_line_starting_pos + Text.nearest_cursor_pos(s, State.cursor_x, State.left) - 1 - replacement in text.lua at line 454
function Text.down(State, left, right)function Text.down(State) - replacement in text.lua at line 457
if Text.cursor_at_final_screen_line(State, left, right) thenif Text.cursor_at_final_screen_line(State) then - replacement in text.lua at line 465
State.cursor1.pos = Text.nearest_cursor_pos(State.lines[State.cursor1.line].data, State.cursor_x, left)State.cursor1.pos = Text.nearest_cursor_pos(State.lines[State.cursor1.line].data, State.cursor_x, State.left) - replacement in text.lua at line 473
Text.snap_cursor_to_bottom_of_screen(State, left, right)Text.snap_cursor_to_bottom_of_screen(State) - replacement in text.lua at line 483
local screen_line_index, screen_line_starting_pos = Text.pos_at_start_of_cursor_screen_line(State, left, right)local screen_line_index, screen_line_starting_pos = Text.pos_at_start_of_cursor_screen_line(State) - replacement in text.lua at line 488
State.cursor1.pos = new_screen_line_starting_pos + Text.nearest_cursor_pos(s, State.cursor_x, left) - 1State.cursor1.pos = new_screen_line_starting_pos + Text.nearest_cursor_pos(s, State.cursor_x, State.left) - 1 - replacement in text.lua at line 492
Text.snap_cursor_to_bottom_of_screen(State, left, right)Text.snap_cursor_to_bottom_of_screen(State) - replacement in text.lua at line 506
function Text.end_of_line(State, left, right)function Text.end_of_line(State) - replacement in text.lua at line 508
local _,botpos = Text.pos_at_start_of_cursor_screen_line(State, left, right)local _,botpos = Text.pos_at_start_of_cursor_screen_line(State) - replacement in text.lua at line 511
Text.snap_cursor_to_bottom_of_screen(State, left, right)Text.snap_cursor_to_bottom_of_screen(State) - replacement in text.lua at line 515
function Text.word_left(State, left, right)function Text.word_left(State) - replacement in text.lua at line 524
Text.left(State, left, right)Text.left(State) - replacement in text.lua at line 528
Text.left(State, left, right)Text.left(State) - replacement in text.lua at line 539
function Text.word_right(State, left, right)function Text.word_right(State) - replacement in text.lua at line 560
Text.snap_cursor_to_bottom_of_screen(State, left, right)Text.snap_cursor_to_bottom_of_screen(State) - replacement in text.lua at line 573
function Text.left(State, left, right)function Text.left(State) - replacement in text.lua at line 589
local top2 = Text.to2(State, State.screen_top1, left, right)top2 = Text.previous_screen_line(State, top2, left, right)local top2 = Text.to2(State, State.screen_top1)top2 = Text.previous_screen_line(State, top2) - replacement in text.lua at line 595
function Text.right(State, left, right)function Text.right(State) - replacement in text.lua at line 598
Text.snap_cursor_to_bottom_of_screen(State, left, right)Text.snap_cursor_to_bottom_of_screen(State) - replacement in text.lua at line 619
function Text.pos_at_start_of_cursor_screen_line(State, left, right)Text.populate_screen_line_starting_pos(State.lines[State.cursor1.line], left, right)function Text.pos_at_start_of_cursor_screen_line(State)Text.populate_screen_line_starting_pos(State.lines[State.cursor1.line], State.left, State.right) - replacement in text.lua at line 630
function Text.cursor_at_final_screen_line(State, left, right)Text.populate_screen_line_starting_pos(State.lines[State.cursor1.line], left, right)function Text.cursor_at_final_screen_line(State)Text.populate_screen_line_starting_pos(State.lines[State.cursor1.line], State.left, State.right) - replacement in text.lua at line 637
function Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State, left, right)function Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State) - replacement in text.lua at line 655
Text.snap_cursor_to_bottom_of_screen(State, left, right)Text.snap_cursor_to_bottom_of_screen(State) - replacement in text.lua at line 660
function Text.snap_cursor_to_bottom_of_screen(State, left, right)local top2 = Text.to2(State, State.cursor1, left, right)function Text.snap_cursor_to_bottom_of_screen(State)local top2 = Text.to2(State, State.cursor1) - replacement in text.lua at line 687
top2 = Text.previous_screen_line(State, top2, left, right)top2 = Text.previous_screen_line(State, top2) - replacement in text.lua at line 695
function Text.in_line(State, line, x,y, left,right)function Text.in_line(State, line, x,y) - replacement in text.lua at line 697
if x < left then return false endif x < State.left then return false end - replacement in text.lua at line 699
Text.populate_screen_line_starting_pos(line, left, right)Text.populate_screen_line_starting_pos(line, State.left, State.right) - replacement in text.lua at line 704
function Text.to_pos_on_line(State, line, mx, my, left, right)function Text.to_pos_on_line(State, line, mx, my) - replacement in text.lua at line 706
Text.compute_fragments(line, left, right)Text.compute_fragments(line, State.left, State.right) - replacement in text.lua at line 726
--? print('return', mx, Text.nearest_cursor_pos(s, mx, left), '=>', screen_line_starting_pos + Text.nearest_cursor_pos(s, mx, left) - 1)return screen_line_starting_pos + Text.nearest_cursor_pos(s, mx, left) - 1--? print('return', mx, Text.nearest_cursor_pos(s, mx, State.left), '=>', screen_line_starting_pos + Text.nearest_cursor_pos(s, mx, State.left) - 1)return screen_line_starting_pos + Text.nearest_cursor_pos(s, mx, State.left) - 1 - replacement in text.lua at line 836
function Text.to2(State, pos1, left, right)function Text.to2(State, pos1) - replacement in text.lua at line 841
Text.populate_screen_line_starting_pos(State.lines[pos1.line], left, right)Text.populate_screen_line_starting_pos(State.lines[pos1.line], State.left, State.right) - replacement in text.lua at line 896
function Text.previous_screen_line(State, pos2, left, right)function Text.previous_screen_line(State, pos2) - replacement in text.lua at line 905
Text.populate_screen_line_starting_pos(State.lines[pos2.line-1], left, right)Text.populate_screen_line_starting_pos(State.lines[pos2.line-1], State.left, State.right) - replacement in text.lua at line 936
function Text.tweak_screen_top_and_cursor(State, left, right)function Text.tweak_screen_top_and_cursor(State) - replacement in text.lua at line 940
Text.populate_screen_line_starting_pos(line, left, right)Text.populate_screen_line_starting_pos(line, State.left, State.right) - replacement in text.lua at line 967
pos=Text.to_pos_on_line(State, line, App.screen.width-5, App.screen.height-5, left, right),pos=Text.to_pos_on_line(State, line, App.screen.width-5, App.screen.height-5), - replacement in text.lua at line 979
--? local _,botpos = Text.pos_at_start_of_cursor_screen_line(State, left, right)--? local _,botpos = Text.pos_at_start_of_cursor_screen_line(State) - replacement in select.lua at line 9
function Text.clip_selection(State, line_index, apos, bpos, left, right)function Text.clip_selection(State, line_index, apos, bpos) - replacement in select.lua at line 15
maxl,maxp = Text.mouse_pos(State, left, right)maxl,maxp = Text.mouse_pos(State) - replacement in select.lua at line 79
function Text.mouse_pos(State, left, right)function Text.mouse_pos(State) - replacement in select.lua at line 85
local line,pos = Text.to_pos(State, App.mouse_x(), App.mouse_y(), left, right)local line,pos = Text.to_pos(State, App.mouse_x(), App.mouse_y()) - replacement in select.lua at line 93
function Text.to_pos(State, x,y, left, right)function Text.to_pos(State, x,y) - replacement in select.lua at line 96
if Text.in_line(State, line, x,y, left, right) thenreturn line_index, Text.to_pos_on_line(State, line, x,y, left, right)if Text.in_line(State, line, x,y) thenreturn line_index, Text.to_pos_on_line(State, line, x,y) - replacement in select.lua at line 103
function Text.cut_selection(State, left, right)function Text.cut_selection(State) - replacement in select.lua at line 106
Text.delete_selection(State, left, right)Text.delete_selection(State) - replacement in select.lua at line 110
function Text.delete_selection(State, left, right)function Text.delete_selection(State) - replacement in select.lua at line 114
Text.delete_selection_without_undo(State, left, right)Text.delete_selection_without_undo(State) - replacement in select.lua at line 118
function Text.delete_selection_without_undo(State, left, right)function Text.delete_selection_without_undo(State) - replacement in select.lua at line 136
_,State.screen_top1.pos = Text.pos_at_start_of_cursor_screen_line(State, left, right)_,State.screen_top1.pos = Text.pos_at_start_of_cursor_screen_line(State) - replacement in edit.lua at line 167
y, State.screen_bottom1.pos = Text.draw(State, line, line_index, line.starty, State.left, State.right)y, State.screen_bottom1.pos = Text.draw(State, line, line_index, line.starty)