start passing left/right margins everywhere
[?]
Jul 8, 2022, 10:07 PM
GK47BBCYVEZ3OEQ7ISE2WCJULAFZ35WC6EYJ5CTBYNM26RSAELOQCDependencies
- [2]
5DOTWNVMright margin - [3]
WOXIYUTLbugfix: manage screen_top and cursor when resizing - [4]
LFMI3D7Dstop scanning from start of file on every App.draw - [5]
HOSPP2ANcrisp font rendering - [6]
CVGE3SIGI feel confident now that page-down is working. - [7]
LERERVPHkeep one screen line of overlap on pagedown - [8]
DHI6IJCNselecting text and deleting selections - [9]
LAW2O3NWextract variable Margin_left - [10]
MYC7XR5Qbugfix: lines that aren't drawn from the start - [11]
PX7DDEMOautosave slightly less aggressively - [12]
537TQ2QNsome more logging - [13]
JY4VK7L2rename - [14]
QYIFOHW3first test! - [15]
AYE2VEGJextract a couple of methods - [16]
K464QQR4more defensive resize handling - [17]
4VKEE43Zbugfix - [18]
DLQMM265scroll past first page - [19]
BZRRUIFQcorrect location of the line width slider - [20]
R53OF3ONone bug I've repeatedly run into while testing with Moby Dick - [21]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [22]
2H67P75Xswitch arg for a function - [23]
XX7G2FFJintermingle freehand line drawings with text - [24]
WLHI7KD3new globals: draw partial screen line up top - [25]
3TFEAQSWstart using some globals - [26]
IMEJA43Lsnapshot - [27]
A2NV3WVOscrolling with up arrow - [28]
2ZRC7FUL. - [29]
PR4KIAZDfirst stab at equally hacky cursor down support - [30]
BULPIBEGbeginnings of a module for the text editor - [31]
JRGTJ2IWquite the frustrating bugfix - [32]
MDXGMZU2disable all debug prints - [33]
M6TH7VSZrip out notion of Line_width - [*]
OTIBCAUJlove2d scaffold
Change contents
- replacement in text.lua at line 14
function Text.draw(line, line_index)function Text.draw(line, line_index, top, left, right) - replacement in text.lua at line 18
local x = Margin_leftlocal y = line.startylocal x = leftlocal y = top - replacement in text.lua at line 33[5.26]→[2.3411:3738](∅→∅),[5.1078]→[5.2203:2255](∅→∅),[2.3738]→[5.2203:2255](∅→∅),[5.2108]→[5.2203:2255](∅→∅)
--? print('('..s(x)..','..s(y)..') '..frag..'('..s(frag_width)..' vs '..s(App.screen.width-Margin_right)..') '..s(line_index)..' vs '..s(Screen_top1.line)..'; '..s(pos)..' vs '..s(Screen_top1.pos)..'; bottom: '..s(Screen_bottom1.line)..'/'..s(Screen_bottom1.pos))if x + frag_width > App.screen.width-Margin_right thenassert(x > Margin_left) -- no overfull lines--? print('('..s(x)..','..s(y)..') '..frag..'('..s(frag_width)..' vs '..s(right)..') '..s(line_index)..' vs '..s(Screen_top1.line)..'; '..s(pos)..' vs '..s(Screen_top1.pos)..'; bottom: '..s(Screen_bottom1.line)..'/'..s(Screen_bottom1.pos))if x + frag_width > right thenassert(x > left) -- no overfull lines - replacement in text.lua at line 46
x = Margin_leftx = left - replacement in text.lua at line 920
function Text.tweak_screen_top_and_cursor()function Text.tweak_screen_top_and_cursor(left, right) - replacement in main.lua at line 194
Text.tweak_screen_top_and_cursor()Text.tweak_screen_top_and_cursor(Margin_left, App.screen.height-Margin_right) - replacement in main.lua at line 275
y, Screen_bottom1.pos = Text.draw(line, line_index)y, Screen_bottom1.pos = Text.draw(line, line_index, line.starty, Margin_left, App.screen.width-Margin_right)