add args to some functions

[?]
Jul 8, 2022, 11:11 PM
T57DTBX6J7E7FVEX4LQWXNKR7YXIHJW4HBCHUOYA5PTJUOEYHTEAC

Dependencies

  • [2] IWYLK45K clicking to the right of a line within line width
  • [3] KCLRP4VW rename a couple of variables
  • [4] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [5] ULKLJBN6 couple of renames
  • [6] 76AIXR7H bugfix
  • [7] ZPUQSPQP extract a few methods
  • [8] 4VKEE43Z bugfix
  • [9] MP2TBKU6 bugfix: crash in Text.up() after return
  • [10] DAENUOGV eliminate assumptions that line length == size in bytes
  • [11] V5MJRFOZ bugfix: down arrow doesn't scroll up unnecessarily
  • [12] LAW2O3NW extract variable Margin_left
  • [13] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [14] CPZGQT72 go through and fix similar issues
  • [15] MYC7XR5Q bugfix: lines that aren't drawn from the start
  • [16] ZHLO7K3M add args to some functions
  • [17] 5Q6NIG66 bugfix
  • [18] 5L7K4GBD clicking to the right of a wrapped line
  • [19] IMEJA43L snapshot
  • [20] BULPIBEG beginnings of a module for the text editor
  • [21] DFSDPDO7 bugfix
  • [22] 5FW7YOFT highlight selection while dragging
  • [23] CUIV2LE5 some typos
  • [24] GGJEDJOO add args to some functions

Change contents

  • replacement in text.lua at line 432
    [4.254][4.1601:1691](),[4.1601][4.1601:1691]()
    Cursor1.pos = screen_line_starting_pos + Text.nearest_cursor_pos(s, Cursor_x) - 1
    [4.254]
    [4.1691]
    Cursor1.pos = screen_line_starting_pos + Text.nearest_cursor_pos(s, Cursor_x, left) - 1
  • replacement in text.lua at line 451
    [4.510][4.2522:2612](),[4.2522][4.2522:2612]()
    Cursor1.pos = new_screen_line_starting_pos + Text.nearest_cursor_pos(s, Cursor_x) - 1
    [4.510]
    [4.2612]
    Cursor1.pos = new_screen_line_starting_pos + Text.nearest_cursor_pos(s, Cursor_x, left) - 1
  • replacement in text.lua at line 467
    [4.3229][4.3229:3311]()
    Cursor1.pos = Text.nearest_cursor_pos(Lines[Cursor1.line].data, Cursor_x)
    [4.3229]
    [4.3311]
    Cursor1.pos = Text.nearest_cursor_pos(Lines[Cursor1.line].data, Cursor_x, left)
  • replacement in text.lua at line 490
    [4.766][4.4419:4509](),[4.4419][4.4419:4509]()
    Cursor1.pos = new_screen_line_starting_pos + Text.nearest_cursor_pos(s, Cursor_x) - 1
    [4.766]
    [4.4509]
    Cursor1.pos = new_screen_line_starting_pos + Text.nearest_cursor_pos(s, Cursor_x, left) - 1
  • replacement in text.lua at line 697
    [4.1751][4.1751:1882](),[4.1882][4.1312:1387](),[4.1185][4.1312:1387]()
    --? print('return', mx, Text.nearest_cursor_pos(s, mx), '=>', screen_line_starting_pos + Text.nearest_cursor_pos(s, mx) - 1)
    return screen_line_starting_pos + Text.nearest_cursor_pos(s, mx) - 1
    [4.1751]
    [4.1279]
    --? print('return', mx, Text.nearest_cursor_pos(s, mx, left), '=>', screen_line_starting_pos + Text.nearest_cursor_pos(s, mx, left) - 1)
    return screen_line_starting_pos + Text.nearest_cursor_pos(s, mx, left) - 1
  • replacement in text.lua at line 742
    [2.1649][4.7085:7154](),[4.469][4.7085:7154]()
    function Text.nearest_cursor_pos(line, x) -- x includes left margin
    [2.1649]
    [4.517]
    -- convert x pixel coordinate to pos
    -- oblivious to wrapping
    function Text.nearest_cursor_pos(line, x, left)
  • replacement in text.lua at line 749
    [4.383][4.2386:2434]()
    local max_x = Margin_left+Text.x(line, len+1)
    [4.383]
    [4.598]
    local max_x = left+Text.x(line, len+1)
  • replacement in text.lua at line 761
    [3.208][4.2435:2541](),[4.914][4.2435:2541]()
    local currxmin = Margin_left+Text.x(line, curr)
    local currxmax = Margin_left+Text.x(line, curr+1)
    [3.208]
    [3.209]
    local currxmin = left+Text.x(line, curr)
    local currxmax = left+Text.x(line, curr+1)