rename

[?]
Aug 12, 2022, 2:34 AM
EAEGCJV5JOW46KCZKKPBFKZ4Z3SDB3X4R7TLNXFWCIQN5UCNSXFQC

Dependencies

  • [2] VSBSWTE4 bugfix: where cursor is drawn
  • [3] TGHAJBES use line cache for drawings as well
  • [4] IMEJA43L snapshot
  • [5] 2H67P75X switch arg for a function
  • [6] QYIFOHW3 first test!
  • [7] ESETRNLB bugfix: printing the first part of a line at the bottom made it seem non-wrapping
  • [8] ULKLJBN6 couple of renames
  • [9] 4CTZOJPC stop pretending globals are local
  • [10] QCPXQ2E3 add state arg to a few functions
  • [11] HOSPP2AN crisp font rendering
  • [12] AYE2VEGJ extract a couple of methods
  • [13] 3OKKTUT4 up and down arrow now moving by screen line where possible
  • [14] BULPIBEG beginnings of a module for the text editor
  • [15] KZ5GAYRP this fixes the immediate regression
  • [16] UV4EWOLY add args to some functions
  • [17] ILOA5BYF separate data structure for each line's cache data
  • [18] 2CH77LZC add args to some functions
  • [19] EGH7XDBK support non-text lines in Text.to2
  • [20] MP2TBKU6 bugfix: crash in Text.up() after return
  • [21] 5OALPNN3 add args to some functions
  • [22] MXA3RZYK deduce left/right from state where possible
  • [23] ODLKHO7B switch to line index in a function
  • [24] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [25] LF7BWEG4 group all editor globals
  • [26] 356GY7IQ unify two similar functions
  • [27] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [28] CBPV5SSI stop 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' then
    return {line=pos1.line, screen_line=1, screen_pos=1}
    [2.1439]
    [4.103]
    function Text.to2(State, loc1)
    if State.lines[loc1.line].mode == 'drawing' then
    return {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 do
    local spos = State.line_cache[pos1.line].screen_line_starting_pos[i]
    if spos <= pos1.pos then
    [4.109]
    [4.381]
    local 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 do
    local spos = State.line_cache[loc1.line].screen_line_starting_pos[i]
    if spos <= loc1.pos then
  • replacement in text.lua at line 859
    [4.410][4.410:456]()
    result.screen_pos = pos1.pos - spos + 1
    [4.410]
    [4.456]
    result.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 then
    result.pos = State.line_cache[pos2.line].screen_line_starting_pos[pos2.screen_line] + pos2.screen_pos - 1
    [4.8216]
    [4.8421]
    function Text.to1(State, loc2)
    local result = {line=loc2.line, pos=loc2.screen_pos}
    if loc2.screen_line > 1 then
    result.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 then
    return {line=pos2.line, screen_line=pos2.screen_line-1, screen_pos=1}
    elseif pos2.line == 1 then
    return pos2
    elseif State.lines[pos2.line-1].mode == 'drawing' then
    return {line=pos2.line-1, screen_line=1, screen_pos=1}
    [4.564]
    [4.1692]
    function Text.previous_screen_line(State, loc2)
    if loc2.screen_line > 1 then
    return {line=loc2.line, screen_line=loc2.screen_line-1, screen_pos=1}
    elseif loc2.line == 1 then
    return loc2
    elseif State.lines[loc2.line-1].mode == 'drawing' then
    return {line=loc2.line-1, screen_line=1, screen_pos=1}
  • replacement in text.lua at line 917
    [4.1699][4.4728:4767](),[4.4767][4.542:605](),[4.605][3.1385:1498]()
    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}
    [4.1699]
    [4.1960]
    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}