rename
[?]
Aug 12, 2022, 2:34 AM
EAEGCJV5JOW46KCZKKPBFKZ4Z3SDB3X4R7TLNXFWCIQN5UCNSXFQCDependencies
- [2]
VSBSWTE4bugfix: where cursor is drawn - [3]
TGHAJBESuse line cache for drawings as well - [4]
IMEJA43Lsnapshot - [5]
2H67P75Xswitch arg for a function - [6]
QYIFOHW3first test! - [7]
ESETRNLBbugfix: printing the first part of a line at the bottom made it seem non-wrapping - [8]
ULKLJBN6couple of renames - [9]
4CTZOJPCstop pretending globals are local - [10]
QCPXQ2E3add state arg to a few functions - [11]
HOSPP2ANcrisp font rendering - [12]
AYE2VEGJextract a couple of methods - [13]
3OKKTUT4up and down arrow now moving by screen line where possible - [14]
BULPIBEGbeginnings of a module for the text editor - [15]
KZ5GAYRPthis fixes the immediate regression - [16]
UV4EWOLYadd args to some functions - [17]
ILOA5BYFseparate data structure for each line's cache data - [18]
2CH77LZCadd args to some functions - [19]
EGH7XDBKsupport non-text lines in Text.to2 - [20]
MP2TBKU6bugfix: crash in Text.up() after return - [21]
5OALPNN3add args to some functions - [22]
MXA3RZYKdeduce left/right from state where possible - [23]
ODLKHO7Bswitch to line index in a function - [24]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [25]
LF7BWEG4group all editor globals - [26]
356GY7IQunify two similar functions - [27]
2RXZ3PGObeginning of a new approach to scroll+wrap - [28]
CBPV5SSIstop handling nil screen_line_starting_pos everywhere
Change contents
- replacement in text.lua at line 849[2.1439]→[4.3394:3425](∅→∅),[4.3295]→[4.3394:3425](∅→∅),[4.3425]→[4.4206:4257](∅→∅),[4.4206]→[4.4206:4257](∅→∅),[4.4257]→[4.46:103](∅→∅),[4.76697]→[4.46:103](∅→∅),[4.46]→[4.46:103](∅→∅)
function Text.to2(State, pos1)if State.lines[pos1.line].mode == 'drawing' thenreturn {line=pos1.line, screen_line=1, screen_pos=1}function Text.to2(State, loc1)if State.lines[loc1.line].mode == 'drawing' thenreturn {line=loc1.line, screen_line=1, screen_pos=1} - replacement in text.lua at line 853[4.109]→[4.7759:7808](∅→∅),[4.1204]→[4.7759:7808](∅→∅),[4.7759]→[4.7759:7808](∅→∅),[4.7808]→[4.482:541](∅→∅),[4.541]→[3.1130:1273](∅→∅),[3.1273]→[4.352:381](∅→∅),[4.4469]→[4.352:381](∅→∅),[4.6605]→[4.352:381](∅→∅),[4.76930]→[4.352:381](∅→∅),[4.352]→[4.352:381](∅→∅)
local result = {line=pos1.line, screen_line=1}Text.populate_screen_line_starting_pos(State, pos1.line)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]if spos <= pos1.pos thenlocal result = {line=loc1.line, screen_line=1}Text.populate_screen_line_starting_pos(State, loc1.line)for i=#State.line_cache[loc1.line].screen_line_starting_pos,1,-1 dolocal spos = State.line_cache[loc1.line].screen_line_starting_pos[i]if spos <= loc1.pos then - replacement in text.lua at line 859
result.screen_pos = pos1.pos - spos + 1result.screen_pos = loc1.pos - spos + 1 - replacement in text.lua at line 867[4.8216]→[4.4470:4501](∅→∅),[4.4501]→[4.8240:8326](∅→∅),[4.8240]→[4.8240:8326](∅→∅),[4.8326]→[3.1274:1384](∅→∅)
function Text.to1(State, pos2)local result = {line=pos2.line, pos=pos2.screen_pos}if pos2.screen_line > 1 thenresult.pos = State.line_cache[pos2.line].screen_line_starting_pos[pos2.screen_line] + pos2.screen_pos - 1function Text.to1(State, loc2)local result = {line=loc2.line, pos=loc2.screen_pos}if loc2.screen_line > 1 thenresult.pos = State.line_cache[loc2.line].screen_line_starting_pos[loc2.screen_line] + loc2.screen_pos - 1 - replacement in text.lua at line 909[4.564]→[4.3517:3565](∅→∅),[4.318]→[4.1432:1582](∅→∅),[4.3565]→[4.1432:1582](∅→∅),[4.4669]→[4.1432:1582](∅→∅),[4.1432]→[4.1432:1582](∅→∅),[4.1582]→[4.4670:4727](∅→∅),[4.4727]→[4.1633:1692](∅→∅),[4.77277]→[4.1633:1692](∅→∅),[4.1633]→[4.1633:1692](∅→∅)
function Text.previous_screen_line(State, pos2)if pos2.screen_line > 1 thenreturn {line=pos2.line, screen_line=pos2.screen_line-1, screen_pos=1}elseif pos2.line == 1 thenreturn pos2elseif State.lines[pos2.line-1].mode == 'drawing' thenreturn {line=pos2.line-1, screen_line=1, screen_pos=1}function Text.previous_screen_line(State, loc2)if loc2.screen_line > 1 thenreturn {line=loc2.line, screen_line=loc2.screen_line-1, screen_pos=1}elseif loc2.line == 1 thenreturn loc2elseif State.lines[loc2.line-1].mode == 'drawing' thenreturn {line=loc2.line-1, screen_line=1, screen_pos=1} - replacement in text.lua at line 917
local l = State.lines[pos2.line-1]Text.populate_screen_line_starting_pos(State, pos2.line-1)return {line=pos2.line-1, screen_line=#State.line_cache[pos2.line-1].screen_line_starting_pos, screen_pos=1}local l = State.lines[loc2.line-1]Text.populate_screen_line_starting_pos(State, loc2.line-1)return {line=loc2.line-1, screen_line=#State.line_cache[loc2.line-1].screen_line_starting_pos, screen_pos=1}