rip out the line-width slider

[?]
Jul 1, 2022, 2:36 AM
YIQYNVD2IG27E6DFAM4CYRA4ETIOGUGCBLBJR4FYE4WBEWPQQOMAC

Dependencies

  • [2] BZRRUIFQ correct location of the line width slider
  • [3] AMXTYDOF show the line width when dragging the slider
  • [4] YT5P6TO6 bugfix: save previous file when dropping a new one on
  • [5] K464QQR4 more defensive resize handling
  • [6] U76D4P36 fix a typo
  • [7] 4VKEE43Z bugfix
  • [8] J2SVGR2E experiment: blinking cursor
  • [9] 73OCE2MC after much struggle, a brute-force undo
  • [10] 7IKRRESB longer names for indices in long loops
  • [11] 2INHXC3K position cursor by clicking on text
  • [12] OAHNWDYG .
  • [13] 3TTAYXPP cleanup
  • [14] PX7DDEMO autosave slightly less aggressively
  • [15] 6J3NXBYG affordance to adjust width for word wrap
  • [16] DHCLUDCW .
  • [17] BPWFKBXT new test: dragging and dropping a file on lines.love
  • [18] CE4LZV4T drop last couple of manual tests
  • [19] MGOQ5XAV start uppercasing globals
  • [20] KVHUFUFV reorg
  • [21] ZUOL7X6V move
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • edit in main_tests.lua at line 68
    [4.1001][5.871:876](),[5.871][5.871:876](),[5.876][5.552:751](),[5.552][5.552:751](),[5.751][2.77:153](),[2.153][5.851:1120](),[5.851][5.851:1120]()
    end
    function test_adjust_line_width()
    io.write('\ntest_adjust_line_width')
    Filename = 'foo'
    App.screen.init{width=Margin_left+300, height=300}
    Line_width = 256
    App.draw() -- initialize button
    App.run_after_mouse_press(256, Margin_top-3, 1)
    App.mouse_move(200, 37)
    -- no change for some time
    App.wait_fake_time(0.01)
    App.update(0)
    check_eq(Line_width, 256, 'F - test_adjust_line_width/early')
    -- after 0.1s the change takes
    App.wait_fake_time(0.1)
    App.update(0)
    check_eq(Line_width, 200, 'F - test_adjust_line_width')
  • edit in main.lua at line 98
    [5.240][5.7:55]()
    -- line-width indicator
    Line_width_hover = nil
  • edit in main.lua at line 227
    [5.448][5.56:82](),[5.82][2.155:237](),[2.237][5.176:273](),[5.176][5.176:273](),[5.273][3.8:159](),[3.159][5.273:274](),[5.273][5.273:274]()
    -- line-width indicator
    button('line-width', {x=Line_width-4,y=Margin_top-10, w=10,h=10, color={1,1,1},
    icon = icon.line_width,
    onpress1 = function() Line_width_hover = App.getTime() end,
    })
    if Line_width_hover then
    love.graphics.setColor(0.7,0.7,0.7)
    love.graphics.line(Line_width,Margin_top+2, Line_width,App.screen.height)
    end
  • edit in main.lua at line 294
    [5.621][5.343:510](),[5.510][2.238:271](),[2.271][5.557:706](),[5.557][5.557:706]()
    end
    end
    -- update Line_width with some hysteresis while the indicator is dragged
    if Line_width_hover then
    if App.getTime() - Line_width_hover > 0.1 then
    Line_width = App.mouse_x()
    Text.redraw_all()
    if App.mouse_down(1) then
    Line_width_hover = App.getTime()
    else
    Line_width_hover = nil
    end
  • edit in main.lua at line 320
    [5.2][5.707:877]()
    -- we seem to sometimes get phantom clicks if the mouse moves down into text while adjusting line-width
    if Line_width_hover then
    Selection1 = {}
    return
    end