reduce ambitions a bit: page up/down need not start screen from the middle of a line

[?]
May 21, 2022, 4:30 AM
KJKKASHZCC5JD6G6PWQ4TA42NVI2CNTAZ667GA76H272DD6KCNRQC

Dependencies

  • [2] PR4KIAZD first stab at equally hacky cursor down support
  • [3] 2KRK3OBV don't rely on defaults
  • [4] SVJZZDC3 snapshot - no, that's all wrong
  • [5] PWHZPJJM always show current filename in window title
  • [6] MGOQ5XAV start uppercasing globals
  • [7] 252M2QMD forgot to move this special case out
  • [8] JCSLDGAH beginnings of support for multiple shapes
  • [9] YKRF5V3Z starting to load/save
  • [10] DLQMM265 scroll past first page
  • [11] 242L3OQX bugfix: ensure Cursor_line is always on a text line
  • [12] OTIBCAUJ love2d scaffold
  • [13] LUNH47XX make text and drawings the same width
  • [14] IYW7X3WL left/right cursor movement, deleting characters
  • [15] M36DBSDE bit more polish to help screen
  • [16] OIB2QPRC start remembering where the cursor is drawn in px
  • [17] W4UVZETR 2 regressions:
  • [18] A2QPFRFJ move
  • [19] AVQ5MC5D finish uppercasing all globals
  • [20] 2FBLO5FH adjust window size
  • [21] WLHI7KD3 new globals: draw partial screen line up top
  • [22] 537TQ2QN some more logging
  • [23] RCDVDFJQ comment
  • [*] BULPIBEG beginnings of a module for the text editor
  • [*] XNFTJHC4 split keyboard handling between Text and Drawing

Change contents

  • edit in text.lua at line 28
    [3.110][2.1:266]()
    end
    if y > Screen_height then
    if line.screen_line_starting_pos then
    Bottom_screen_line_starting_pos = line.screen_line_starting_pos[#line.screen_line_starting_pos]
    else
    Bottom_screen_line_starting_pos = 1
    end
  • edit in text.lua at line 290
    [2.836]
    [2.836]
    print('screen top before:', Screen_top_line, Top_screen_line_starting_pos)
  • edit in text.lua at line 292
    [2.874]
    [2.874]
    print('scroll up preserving cursor')
  • edit in text.lua at line 294
    [2.922]
    [26.4899]
    print('screen top after:', Screen_top_line, Top_screen_line_starting_pos)
  • replacement in main.lua at line 41
    [3.18][3.1811:1883]()
    Cursor_pos = 15 -- in Unicode codepoints, from 1 to utf8.len(line) + 1
    [3.18]
    [3.1238]
    Cursor_pos = 1 -- in Unicode codepoints, from 1 to utf8.len(line) + 1
  • replacement in main.lua at line 50
    [3.68][3.1884:1973](),[3.1973][3.360:455](),[3.360][3.360:455]()
    Top_screen_line_starting_pos = 6 -- when top of screen starts in between a wrapped line
    Bottom_screen_line_starting_pos = 1 -- when bottom of screen starts in between a wrapped line
    [3.68]
    [3.1240]
    Top_screen_line_starting_pos = 1 -- when top of screen starts in between a wrapped line
  • replacement in main.lua at line 63
    [3.23][3.1974:2270]()
    --? love.window.setMode(0, 0) -- maximize
    --? Screen_width, Screen_height, Screen_flags = love.window.getMode()
    --? -- shrink slightly to account for window decoration
    --? Screen_width = Screen_width-100
    --? Screen_height = Screen_height-100
    Screen_width = 120
    Screen_height = 200
    [3.23]
    [3.505]
    love.window.setMode(0, 0) -- maximize
    Screen_width, Screen_height, Screen_flags = love.window.getMode()
    -- shrink slightly to account for window decoration
    Screen_width = Screen_width-100
    Screen_height = Screen_height-100
    -- for testing line wrap
    --? Screen_width = 120
    --? Screen_height = 200
  • replacement in main.lua at line 73
    [3.43][3.2271:2342]()
    Line_width = 100
    --? Line_width = math.floor(Screen_width/2/40)*40
    [3.43]
    [3.2]
    --? Line_width = 100
    Line_width = math.floor(Screen_width/2/40)*40
  • replacement in main.lua at line 181
    [3.1702][3.1702:1721]()
    Cursor_pos = 1
    [3.1702]
    [3.939]
    Top_screen_line_starting_pos = 1
    Cursor_pos = Top_screen_line_starting_pos