start passing left/right margins everywhere

[?]
Jul 8, 2022, 10:07 PM
GK47BBCYVEZ3OEQ7ISE2WCJULAFZ35WC6EYJ5CTBYNM26RSAELOQC

Dependencies

  • [2] 5DOTWNVM right margin
  • [3] WOXIYUTL bugfix: manage screen_top and cursor when resizing
  • [4] LFMI3D7D stop scanning from start of file on every App.draw
  • [5] HOSPP2AN crisp font rendering
  • [6] CVGE3SIG I feel confident now that page-down is working.
  • [7] LERERVPH keep one screen line of overlap on pagedown
  • [8] DHI6IJCN selecting text and deleting selections
  • [9] LAW2O3NW extract variable Margin_left
  • [10] MYC7XR5Q bugfix: lines that aren't drawn from the start
  • [11] PX7DDEMO autosave slightly less aggressively
  • [12] 537TQ2QN some more logging
  • [13] JY4VK7L2 rename
  • [14] QYIFOHW3 first test!
  • [15] AYE2VEGJ extract a couple of methods
  • [16] K464QQR4 more defensive resize handling
  • [17] 4VKEE43Z bugfix
  • [18] DLQMM265 scroll past first page
  • [19] BZRRUIFQ correct location of the line width slider
  • [20] R53OF3ON one bug I've repeatedly run into while testing with Moby Dick
  • [21] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [22] 2H67P75X switch arg for a function
  • [23] XX7G2FFJ intermingle freehand line drawings with text
  • [24] WLHI7KD3 new globals: draw partial screen line up top
  • [25] 3TFEAQSW start using some globals
  • [26] IMEJA43L snapshot
  • [27] A2NV3WVO scrolling with up arrow
  • [28] 2ZRC7FUL .
  • [29] PR4KIAZD first stab at equally hacky cursor down support
  • [30] BULPIBEG beginnings of a module for the text editor
  • [31] JRGTJ2IW quite the frustrating bugfix
  • [32] MDXGMZU2 disable all debug prints
  • [33] M6TH7VSZ rip out notion of Line_width
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • replacement in text.lua at line 14
    [5.103][5.705:742]()
    function Text.draw(line, line_index)
    [5.103]
    [5.1129]
    function Text.draw(line, line_index, top, left, right)
  • replacement in text.lua at line 18
    [5.1768][5.2178:2202](),[5.2202][5.989:1013]()
    local x = Margin_left
    local y = line.starty
    [5.1768]
    [5.1802]
    local x = left
    local 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 then
    assert(x > Margin_left) -- no overfull lines
    [5.26]
    [5.1]
    --? 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 then
    assert(x > left) -- no overfull lines
  • replacement in text.lua at line 46
    [5.129][5.2256:2278]()
    x = Margin_left
    [5.129]
    [5.2198]
    x = left
  • replacement in text.lua at line 920
    [5.3998][3.3:47]()
    function Text.tweak_screen_top_and_cursor()
    [5.3998]
    [3.47]
    function Text.tweak_screen_top_and_cursor(left, right)
  • replacement in main.lua at line 194
    [3.1343][3.1343:1380]()
    Text.tweak_screen_top_and_cursor()
    [3.1343]
    [5.154]
    Text.tweak_screen_top_and_cursor(Margin_left, App.screen.height-Margin_right)
  • replacement in main.lua at line 275
    [4.1416][4.1416:1474]()
    y, Screen_bottom1.pos = Text.draw(line, line_index)
    [4.1416]
    [4.1474]
    y, Screen_bottom1.pos = Text.draw(line, line_index, line.starty, Margin_left, App.screen.width-Margin_right)