implement second, 'output' editor
Dependencies
- [2]
TEDSEOCWsend editor clicks to the left of the scrollbar - [3]
A5NQFECKmake scrollbar opaque - [4]
WR2WMEPEimplement 'Run' button - [5]
VP5KC4XZMerge lines.love - [6]
36Z442IVback to commit 8123959e52f without code editing - [7]
LXTTOB33extract a couple of files - [8]
BULPIBEGbeginnings of a module for the text editor - [9]
XX7G2FFJintermingle freehand line drawings with text - [10]
PJ5PQAQErecord support for multiple versions - [11]
G4TDWMNZno, make the scrollbar easier to acquire - [12]
OL7ZCZWDMerge text.love - [13]
5OVKHVY6nice way to make on.* handlers more discoverable - [14]
PRE6XPRNresponsively increase/decrease font height - [15]
RSZD5A7Gforgot to add json.lua - [16]
CZQ3NJ4NMerge text0 - [17]
T4FRZSYLdelete an ancient, unused file - [18]
K2X6G75Zstart writing some tests for drawings - [19]
57HKHZ7Zinclude the tool that's mentioned in representation.md - [20]
CE4LZV4Tdrop last couple of manual tests - [21]
JOPVPUSAediting source code from within the app - [22]
Q6RXCILQMerge text.love - [23]
SW5GN5LPsuggest a default layout for freewheeling apps - [24]
LWPFEZBIMerge lines.love - [25]
VEAVIL4Xresize handler - [26]
ED4Z6ORCcleaner API for file-system access - [27]
UEG224LHdebug animations - [28]
KMSL74GAsupport selections in the source editor - [29]
MZ3DMYPDstart sketching out a scrollbar - [30]
ZM7NOBRMnew fork: carousel shell - [31]
66X36NZNa little more prose describing manual_tests - [32]
YF2ATH2QMerge lines.love - [33]
D2TYFYG2Merge text.love - [34]
M5JXTW56Merge text.love - [35]
VLTU33KWresolve conflicts - [36]
3PSFWAILMerge lines.love - [37]
EZHO4TSWnew file-system format for freewheeling apps - [38]
5RUFNRJOstart of the visual skeleton - [39]
TVCPXAAUrename - [40]
VHUNJHXBMerge lines.love - [41]
KKQKPGCIresolve conflicts - [42]
TLOAPLBJadd a license - [43]
SGMA5JLEsave the list of tests in repo - [44]
TBTRYEBPMerge lines.love - [45]
2CFLXLIEMerge text.love - [46]
D2GCFTTTclean up repl functionality - [47]
KKMFQDR4editing source code from within the app - [48]
OGUV4HSAremove some memory leaks from rendered fragments - [49]
4SR3Z4Y3document the version of LÖVE I've been using - [50]
6RYGW5H3bugfix: output border color - [51]
2DVVKKVAflesh out Readme - [52]
R5QXEHUIsomebody stop me - [53]
VXRYVZ74Merge text.love - [54]
RU4HIK43Merge lines.love - [55]
73OCE2MCafter much struggle, a brute-force undo - [56]
OTIBCAUJlove2d scaffold - [57]
34BZ5ZKNMerge lines.love - [58]
6VJTQKW7start supporting LÖVE v12 - [59]
AVTNUQYRbasic test-enabled framework - [60]
ZLJYLPOTMerge lines.love - [61]
2L5MEZV3experiment: new edit namespace - [62]
3QNOKBFMbeginnings of a test harness - [63]
N2NUGNN4include a brief reference enabling many useful apps - [64]
FM5LDKGTMerge text.love - [65]
LBQBZT4Iround scrollbar slightly - [66]
CAG7PP5YMerge text.love - [67]
BLWAYPKVextract a module - [68]
RLZTVQN6slightly inset the scrollbar within its area - [69]
VHQCNMARseveral more modules - [70]
6LJZN727handle chords - [71]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [72]
4YDBYBA4clean up memory leak experiments - [73]
LRDM35CEapp running again - [74]
IP4LD33Dmouse events for scrollbar - [75]
VXORMHMEdelete experimental REPL - [76]
ORKN6EOBMerge lines.love - [77]
D43U7GQ4alter on-disk representation (manifest files) - [78]
FS2ITYYHrecord a known issue - [79]
QD4LOFQRMerge text.love
Change contents
- file deletion: 0037-Editor_scrollbar_top
Editor_scrollbar_top = 0 -- in pxEditor_scrollbar_bottom = 0 - file addition: 0044-Output_editor_state[5.2]
Output_editor_state = nil - replacement in 0040-on_editor_scrollbar_area at line 1
on_editor_scrollbar_area = function(x,y)if x < Editor_state.right+15 then return endif x > Editor_state.right+45 then return endif y < Editor_state.top then return endif y > Editor_state.bottom then return endon_editor_scrollbar_area = function(state, x,y)if x < state.right+15 then return endif x > state.right+45 then return endif y < state.top then return endif y > state.bottom then return end - replacement in 0038-on_editor_scrollbar at line 1
on_editor_scrollbar = function(x,y)if x < Editor_state.right+15 then return endif x > Editor_state.right+45 then return endif y < Editor_scrollbar_top then return endif y > Editor_scrollbar_bottom then return endon_editor_scrollbar = function(state, x,y)if x < state.right+15 then return endif x > state.right+45 then return endif y < state.scrollbar_top then return endif y > state.scrollbar_bottom then return end - replacement in 0036-adjust_scrollbar at line 1
adjust_scrollbar = function(y)local s = (y-Editor_state.top) / (Editor_state.bottom-Editor_state.top)local screen_line = s*Editor_state.screen_line_countadjust_scrollbar = function(state, y)local s = (y-state.top) / (state.bottom-state.top)local screen_line = s*state.screen_line_count - replacement in 0036-adjust_scrollbar at line 5
for i=1,#Editor_state.lines doif Editor_state.line_cache[i].start_screen_line_index > screen_line thenfor i=1,#state.lines doif state.line_cache[i].start_screen_line_index > screen_line then - replacement in 0036-adjust_scrollbar at line 11
Editor_state.screen_top1 = {line=line, pos=1}Editor_state.cursor1 = {line=line, pos=1}state.screen_top1 = {line=line, pos=1}state.cursor1 = {line=line, pos=1} - replacement in 0034-draw_scrollbar at line 1
draw_scrollbar = function(Editor_state)draw_scrollbar = function(state) - replacement in 0034-draw_scrollbar at line 3
love.graphics.line(Editor_state.right+30, Editor_state.top, Editor_state.right+30, Editor_state.bottom)love.graphics.line(Editor_state.right+25, Editor_state.top, Editor_state.right+35, Editor_state.top)love.graphics.line(Editor_state.right+25, Editor_state.bottom, Editor_state.right+35, Editor_state.bottom)local sbtop, sbbot = compute_scrollbar(Editor_state)local topy = Editor_state.top + sbtop*(Editor_state.bottom - Editor_state.top)local boty = Editor_state.top +sbbot*(Editor_state.bottom - Editor_state.top)love.graphics.line(state.right+30, state.top, state.right+30, state.bottom)love.graphics.line(state.right+25, state.top, state.right+35, state.top)love.graphics.line(state.right+25, state.bottom, state.right+35, state.bottom)local sbtop, sbbot = compute_scrollbar(state)local topy = state.top + sbtop*(state.bottom - state.top)local boty = state.top +sbbot*(state.bottom - state.top) - replacement in 0034-draw_scrollbar at line 10[3.32]→[5.32:132](∅→∅),[5.3030]→[5.32:132](∅→∅),[5.95]→[5.1146:1207](∅→∅),[5.132]→[5.1146:1207](∅→∅),[5.378]→[5.1146:1207](∅→∅),[5.3107]→[5.1146:1207](∅→∅)
love.graphics.rectangle('fill', Editor_state.right+15, topy+5, 30, math.max(boty-topy-10, 5), 5,5)Editor_scrollbar_top = topyEditor_scrollbar_bottom = botylove.graphics.rectangle('fill', state.right+15, topy+5, 30, math.max(boty-topy-10, 5), 5,5)state.scrollbar_top = topystate.scrollbar_bottom = boty - edit in 0031-on.resize at line 7
Output_editor_state.top = Editor_state.bottom+5+10+5Output_editor_state.right = Editor_state.rightOutput_editor_state.width = Editor_state.widthOutput_editor_state.bottom = Safe_height - 5 - replacement in 0021-draw_menu at line 20
if not status thenprint(result)print(status, result)if result then-- could be either output or errorOutput_editor_state.lines = {{data=tostring(result)},}Text.redraw_all(Output_editor_state) - replacement in 0017-on.mouse_release at line 2
if Editor_scrollbar_drag thenadjust_scrollbar(y)Editor_scrollbar_drag = nilelseif on_editor_scrollbar_area(x,y) thenadjust_scrollbar(y)if Editor_state.scrollbar_drag thenadjust_scrollbar(Editor_state, y)Editor_state.scrollbar_drag = nilelseif on_editor_scrollbar_area(Editor_state, x,y) thenadjust_scrollbar(Editor_state, y) - edit in 0017-on.mouse_release at line 9
elseif Output_editor_state.scrollbar_drag thenadjust_scrollbar(Output_editor_state, y)elseif on_editor_scrollbar_area(Output_editor_state, x,y) thenadjust_scrollbar(Output_editor_state, y) - replacement in 0016-on.mouse_press at line 5
if on_editor_scrollbar(x,y) thenEditor_scrollbar_drag = trueelseif on_editor_scrollbar_area(x,y) thenif on_editor_scrollbar(Editor_state, x,y) thenEditor_state.scrollbar_drag = trueelseif on_editor_scrollbar_area(Editor_state, x,y) then - edit in 0016-on.mouse_press at line 11
elseif on_editor_scrollbar(Output_editor_state, x,y) thenOutput_editor_state.scrollbar_drag = trueelseif on_editor_scrollbar_area(Output_editor_state, x,y) then-- nothing - edit in 0012-on.draw at line 10
edit.draw(Output_editor_state, Normal_color, --[[hide cursor]] true)draw_scrollbar(Output_editor_state) - edit in 0011-on.initialize at line 15
Output_editor_state = edit.initialize_state(Editor_state.bottom+5+10+5, -- topnil, -- buttomEditor_state.left, Editor_state.right,love.graphics.getFont():getHeight(), Line_height)Text.redraw_all(Output_editor_state) - replacement in 0004-on.update at line 3
if Editor_scrollbar_drag thenadjust_scrollbar(App.mouse_y())if Editor_state.scrollbar_drag thenadjust_scrollbar(Editor_state, App.mouse_y())elseif Output_editor_state.scrollbar_drag thenadjust_scrollbar(Output_editor_state, App.mouse_y())