switch to line index in a function
[?]
Jul 17, 2022, 4:30 PM
HGC5RGJPK34K5HRPG6FB7VIKOT6VTWVEC3CBYS5QVH5LVKAL6WGQCDependencies
- [2]
ODLKHO7Bswitch to line index in a function - [3]
XNFTJHC4split keyboard handling between Text and Drawing - [4]
BOFNXP5Gclicking now moves the cursor even on long, wrapped lines - [5]
PFT5Y2ZYmove - [6]
QYIFOHW3first test! - [7]
DGK5BPVIbugfix: UTF-8 in compute_fragments - [8]
4VKEE43Zbugfix - [9]
LAW2O3NWextract variable Margin_left - [10]
M6TH7VSZrip out notion of Line_width - [11]
HOSPP2ANcrisp font rendering - [12]
BYG5CEMVsupport for naming points - [13]
5DOC2CBMextract a function - [14]
MDXGMZU2disable all debug prints - [15]
FKNXK2OAswitch to line index in a function - [16]
HYEAFRZ2split mouse_pressed events between Text and Drawing - [17]
CVGE3SIGI feel confident now that page-down is working. - [18]
QCPXQ2E3add state arg to a few functions - [19]
IMEJA43Lsnapshot - [20]
P66MRF3Ubugfix: don't append metadata when it already exists - [21]
LERERVPHkeep one screen line of overlap on pagedown - [22]
5FW7YOFThighlight selection while dragging - [23]
NDHQN23Gdone passing left/right margins everywhere - [24]
K4OBZSHEadd args to some functions - [25]
R53OF3ONone bug I've repeatedly run into while testing with Moby Dick - [26]
MXA3RZYKdeduce left/right from state where possible - [27]
U52E2XZNfix a crash - [28]
PESSMQBJno, make sure to compute line width after screen dimensions - [29]
LXTTOB33extract a couple of files - [30]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [31]
5DOTWNVMright margin - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- replacement in text.lua at line 22
Text.compute_fragments(line, State.left, State.right)Text.compute_fragments(State, line_index) - replacement in text.lua at line 95
function Text.compute_fragments(line, left, right)--? print('compute_fragments', right)function Text.compute_fragments(State, line_index)--? print('compute_fragments', State.right)local line = State.lines[line_index] - replacement in text.lua at line 99
local x = leftlocal x = State.left - replacement in text.lua at line 104
--? print('x: '..tostring(x)..'; '..tostring(right-x)..'px to go')--? print('x: '..tostring(x)..'; '..tostring(State.right-x)..'px to go') - replacement in text.lua at line 106
if x + frag_width > right thenwhile x + frag_width > right do--? print(x, frag, frag_width, right)if x < 0.8*right then--? print(frag, x, frag_width, right)if x + frag_width > State.right thenwhile x + frag_width > State.right do--? print(x, frag, frag_width, State.right)if x < 0.8*State.right then--? print(frag, x, frag_width, State.right) - replacement in text.lua at line 113
local bpos = Text.nearest_pos_less_than(frag, right - x)local bpos = Text.nearest_pos_less_than(frag, State.right - x) - replacement in text.lua at line 120
--? print(frag, x, frag1_width, right)assert(x + frag1_width <= right)--? print(frag, x, frag1_width, State.right)assert(x + frag1_width <= State.right) - replacement in text.lua at line 128
x = left -- new linex = State.left -- new line - replacement in text.lua at line 710
Text.compute_fragments(line, State.left, State.right)Text.compute_fragments(State, line_index) - replacement in text.lua at line 921
Text.compute_fragments(line, State.left, State.right)Text.compute_fragments(State, line_index)