rip out the line-width slider
[?]
Jul 1, 2022, 2:36 AM
YIQYNVD2IG27E6DFAM4CYRA4ETIOGUGCBLBJR4FYE4WBEWPQQOMACDependencies
- [2]
BZRRUIFQcorrect location of the line width slider - [3]
AMXTYDOFshow the line width when dragging the slider - [4]
YT5P6TO6bugfix: save previous file when dropping a new one on - [5]
K464QQR4more defensive resize handling - [6]
U76D4P36fix a typo - [7]
4VKEE43Zbugfix - [8]
J2SVGR2Eexperiment: blinking cursor - [9]
73OCE2MCafter much struggle, a brute-force undo - [10]
7IKRRESBlonger names for indices in long loops - [11]
2INHXC3Kposition cursor by clicking on text - [12]
OAHNWDYG. - [13]
3TTAYXPPcleanup - [14]
PX7DDEMOautosave slightly less aggressively - [15]
6J3NXBYGaffordance to adjust width for word wrap - [16]
DHCLUDCW. - [17]
BPWFKBXTnew test: dragging and dropping a file on lines.love - [18]
CE4LZV4Tdrop last couple of manual tests - [19]
MGOQ5XAVstart uppercasing globals - [20]
KVHUFUFVreorg - [21]
ZUOL7X6Vmove - [*]
OTIBCAUJlove2d 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](∅→∅)
endfunction test_adjust_line_width()io.write('\ntest_adjust_line_width')Filename = 'foo'App.screen.init{width=Margin_left+300, height=300}Line_width = 256App.draw() -- initialize buttonApp.run_after_mouse_press(256, Margin_top-3, 1)App.mouse_move(200, 37)-- no change for some timeApp.wait_fake_time(0.01)App.update(0)check_eq(Line_width, 256, 'F - test_adjust_line_width/early')-- after 0.1s the change takesApp.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
-- line-width indicatorLine_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 indicatorbutton('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 thenlove.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
endend-- update Line_width with some hysteresis while the indicator is draggedif Line_width_hover thenif App.getTime() - Line_width_hover > 0.1 thenLine_width = App.mouse_x()Text.redraw_all()if App.mouse_down(1) thenLine_width_hover = App.getTime()elseLine_width_hover = nilend - edit in main.lua at line 320
-- we seem to sometimes get phantom clicks if the mouse moves down into text while adjusting line-widthif Line_width_hover thenSelection1 = {}returnend