editor widget now takes a bottom margin

akkartik
Nov 15, 2023, 2:14 PM
ICS45BILRVYLF7ADAON2W67YHOCRQVKMR6AMTLTJJHW7RIYIUP3AC

Dependencies

  • [2] AYS3Z3TX standardize scroll check in a few places
  • [3] R2ASHK5C fix a bad merge
  • [4] ZM7NOBRM new fork: carousel shell
  • [5] TRNWIQN6 more precise height calculation when scrolling up as much as possible while keeping cursor on screen
  • [6] 2L5MEZV3 experiment: new edit namespace
  • [7] KOYAJWE4 extract a couple more methods
  • [8] MD3W5IRA new fork: rip out drawing support
  • [9] 5OALPNN3 add args to some functions
  • [10] MXA3RZYK deduce left/right from state where possible
  • [11] LF7BWEG4 group all editor globals
  • [12] SPSW74Y5 add state arg to Text.keychord_pressed
  • [13] MDXGMZU2 disable all debug prints
  • [14] ODLKHO7B switch to line index in a function
  • [15] HOSPP2AN crisp font rendering
  • [16] EKKFWP4D bugfix: couple of margin-relative computations
  • [17] PR4KIAZD first stab at equally hacky cursor down support
  • [18] JCXL74WV bring back everything from commit a68647ae22
  • [19] OI4FPFIN support drawings in the source editor
  • [20] QCPXQ2E3 add state arg to a few functions
  • [21] UBA2ZUCP remove a duplicate print to screen
  • [22] WOXIYUTL bugfix: manage screen_top and cursor when resizing
  • [23] FKNXK2OA switch to line index in a function
  • [24] OV6FE23R Merge text0
  • [25] Z5HLXU4P add state arg to a few functions
  • [26] I64IPGJX avoid saving fragments in lines
  • [27] MXSAHZN4 Merge lines.love
  • [28] CNCYMM6A make test initializations a little more obvious
  • [29] QLTJG7Q3 indent
  • [30] KOTI3MFG bugfix in previous commit
  • [31] 3MAZEQK5 add state arg to Text.textinput
  • [32] UHB4GARJ left/right margin -> left/right coordinates
  • [33] 3TI67SEJ more bugfix
  • [34] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [35] GN3IF4WF bugfix: pasting newlines
  • [*] BULPIBEG beginnings of a module for the text editor
  • [*] HZRO5BV5 require editor margins to be ints

Change contents

  • replacement in text.lua at line 82
    [5.1081][5.1081:1118]()
    if y >= App.screen.height then
    [5.1081]
    [5.1118]
    if y >= State.bottom then
  • replacement in text.lua at line 159
    [5.37][2.3:68]()
    if State.cursor_y > App.screen.height - State.line_height then
    [5.37]
    [5.64]
    if State.cursor_y > State.bottom - State.line_height then
  • replacement in text.lua at line 183
    [5.192][2.69:136]()
    if State.cursor_y > App.screen.height - State.line_height then
    [5.192]
    [5.15259]
    if State.cursor_y > State.bottom - State.line_height then
  • replacement in text.lua at line 192
    [5.509][2.137:204]()
    if State.cursor_y > App.screen.height - State.line_height then
    [5.509]
    [5.135]
    if State.cursor_y > State.bottom - State.line_height then
  • replacement in text.lua at line 374
    [5.139][5.152:183](),[5.485][5.152:183](),[5.749][5.152:183](),[5.2662][5.152:183](),[5.66327][5.152:183](),[5.152][5.152:183](),[5.183][5.2663:2713]()
    --? print(App.screen.height)
    local y = App.screen.height - State.line_height
    [5.485]
    [5.16685]
    local y = State.bottom - State.line_height
  • replacement in text.lua at line 627
    [5.2683][5.6839:6899]()
    if State.top > App.screen.height - State.line_height then
    [5.2683]
    [5.4]
    if State.top > State.bottom - State.line_height then
  • replacement in text.lua at line 642
    [5.3208][5.3208:3258]()
    local y = App.screen.height - State.line_height
    [5.3208]
    [5.455]
    local y = State.bottom - State.line_height
  • replacement in text.lua at line 912
    [5.5776][5.3494:3599]()
    pos=Text.to_pos_on_line(State, State.screen_bottom1.line, State.right-5, App.screen.height-5),
    [5.5776]
    [5.139]
    pos=Text.to_pos_on_line(State, State.screen_bottom1.line, State.right-5, State.bottom-5),
  • replacement in edit.lua at line 20
    [5.596][5.5097:5219]()
    function edit.initialize_state(top, left, right, font_height, line_height) -- currently always draws to bottom of screen
    [5.596]
    [5.94319]
    function edit.initialize_state(top, bottom, left, right, font_height, line_height)
  • edit in edit.lua at line 61
    [5.22362]
    [38.26]
    bottom = bottom or App.screen.height,
  • replacement in edit.lua at line 126
    [3.738][3.738:802]()
    if y + State.line_height > App.screen.height then break end
    [3.738]
    [3.802]
    if y + State.line_height > State.bottom then break end
  • edit in edit.lua at line 418
    [3.10993]
    [3.10993]
    nil, -- to bottom of screen
  • replacement in 0011-on.initialize at line 5
    [4.3276][4.3276:3379]()
    Editor_state = edit.initialize_state(100, 100, 400, love.graphics.getFont():getHeight(), Line_height)
    [4.3276]
    [4.3379]
    Editor_state = edit.initialize_state(100, 300, 100, 400, love.graphics.getFont():getHeight(), Line_height)
  • replacement in 0011-on.initialize at line 7
    [4.3410][4.3410:3413]()
    end
    [4.3410]
    end