Merge text.love
[?]
Sep 20, 2023, 9:49 PM
5ML5VGOCYH4OBKCYJ72BYEN4W3H2NF423AFH6B3VJKJY3K7K2J7ACDependencies
- [2]
OTYGZVPWMerge text.love - [3]
YXQOITYSMerge lines.love - [4]
2CFLXLIEMerge text.love - [5]
KKMFQDR4editing source code from within the app - [6]
D4B52CQ2Merge lines.love - [7]
VP5KC4XZMerge lines.love - [8]
MD3W5IRAnew fork: rip out drawing support - [9]
AVTNUQYRbasic test-enabled framework - [10]
IGBTDA6YMerge text.love - [11]
34BZ5ZKNMerge lines.love - [12]
LXFHXL2NMerge text.love - [13]
OTIBCAUJlove2d scaffold - [14]
VHQCNMARseveral more modules - [15]
Q6RXCILQMerge text.love - [16]
X43ZIKR3Merge text.love - [17]
4YDBYBA4clean up memory leak experiments - [18]
KMSL74GAsupport selections in the source editor - [19]
3PSFWAILMerge lines.love - [20]
BLWAYPKVextract a module - [21]
RSZD5A7Gforgot to add json.lua - [22]
T4FRZSYLdelete an ancient, unused file - [23]
36Z442IVback to commit 8123959e52f without code editing - [24]
RO35V4H4Merge text.love - [25]
3QNOKBFMbeginnings of a test harness - [26]
3G723RV5Merge text.love - [27]
B6DS4GZCMerge lines.love - [28]
CE4LZV4Tdrop last couple of manual tests - [29]
PJ5PQAQErecord support for multiple versions - [30]
VOU73AK6Merge lines.love - [31]
66X36NZNa little more prose describing manual_tests - [32]
73OCE2MCafter much struggle, a brute-force undo - [33]
R5QXEHUIsomebody stop me - [34]
VXRYVZ74Merge text.love - [35]
2TQUKHBCMerge lines.love - [36]
SGMA5JLEsave the list of tests in repo - [37]
2L5MEZV3experiment: new edit namespace - [38]
K74U4BAUMerge lines.love - [39]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [40]
2344TV56Merge lines.love - [41]
LWPFEZBIMerge lines.love - [42]
FM5LDKGTMerge text.love - [43]
6LJZN727handle chords - [44]
VXORMHMEdelete experimental REPL - [45]
JOPVPUSAediting source code from within the app - [46]
OGUV4HSAremove some memory leaks from rendered fragments - [47]
VHUNJHXBMerge lines.love - [48]
RU4HIK43Merge lines.love - [49]
4SR3Z4Y3document the version of LÖVE I've been using - [50]
2JLMNZZIMerge text.love - [51]
ECBDENZ4Merge text.love - [52]
N2NUGNN4include a brief reference enabling many useful apps - [53]
TVCPXAAUrename - [54]
ORKN6EOBMerge lines.love - [55]
UAYCSFSKMerge text.love - [56]
QD4LOFQRMerge text.love - [57]
ZLJYLPOTMerge lines.love - [58]
ED4Z6ORCcleaner API for file-system access - [59]
FS2ITYYHrecord a known issue - [60]
TLOAPLBJadd a license - [61]
XX7G2FFJintermingle freehand line drawings with text - [62]
WB6SIB7HMerge lines.love - [63]
BULPIBEGbeginnings of a module for the text editor - [64]
D2GCFTTTclean up repl functionality - [65]
2CTN2IEFMerge lines.love - [66]
A4BSGS2CMerge lines.love - [67]
ONHKBLLCMerge lines.love - [68]
K2X6G75Zstart writing some tests for drawings - [69]
C3GUE45IMerge text.love - [70]
LXTTOB33extract a couple of files - [71]
M5JXTW56Merge text.love
Change contents
- file deletion: source_text_tests.lua source_text_tests.lua
-- selection remains emptycheck_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')endfunction test_draw_text()check_eq(Editor_state.cursor1.line, 1, 'cursor')-- selection remains emptycheck_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')endfunction test_click_below_all_lines()-- display one lineApp.screen.init{width=50, height=80}Editor_state = edit.initialize_test_state()Editor_state.lines = load_array{'abc'}Text.redraw_all(Editor_state)Editor_state.cursor1 = {line=1, pos=1}Editor_state.screen_top1 = {line=1, pos=1}Editor_state.screen_bottom1 = {}Editor_state.selection1 = {}-- click below first lineedit.draw(Editor_state)edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+50, 1)-- cursor doesn't movecheck_eq(Editor_state.cursor1.line, 1, 'cursor')Editor_state.selection1 = {}-- click on the empty lineedit.draw(Editor_state)edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)-- cursor movesEditor_state.selection1 = {}-- click on the other lineedit.draw(Editor_state)edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+5, 1)-- cursor movesEditor_state.selection1 = {}-- click to the left of the lineedit.draw(Editor_state)edit.run_after_mouse_click(Editor_state, Editor_state.left-4,Editor_state.top+5, 1)-- cursor moves to start of line - file deletion: source_edit.lua source_edit.lua
State.old_cursor1, State.old_selection1, State.mousepress_shift = nilif eq(State.cursor1, State.selection1) thenState.selection1 = {}endendfunction edit.mouse_wheel_move(State, dx,dy)if dy > 0 thenState.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}endendfunction edit.clean_up_mouse_press(State)if State.mousepress_shift thenif State.old_selection1.line == nil thenState.selection1 = State.old_cursor1elseState.selection1 = State.old_selection1endend-- still here? mouse release is below all screen linesState.cursor1.line, State.cursor1.pos = State.screen_bottom1.line, Text.pos_at_end_of_screen_line(State, State.screen_bottom1)edit.clean_up_mouse_press(State)--? print_and_log(('edit.mouse_release: finally selection %s,%s cursor %d,%d'):format(tostring(State.selection1.line), tostring(State.selection1.pos), State.cursor1.line, State.cursor1.pos))edit.clean_up_mouse_press(State)returnendendendif y < State.top thenState.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}edit.clean_up_mouse_press(State)returnendfor line_index,line in ipairs(State.lines) doif line.mode == 'text' thenif Text.in_line(State, line_index, x,y) then-- still here? mouse press is below all screen linesState.old_cursor1 = State.cursor1State.old_selection1 = State.selection1State.mousepress_shift = App.shift_down()State.selection1 = {line=State.screen_bottom1.line,pos=Text.pos_at_end_of_screen_line(State, State.screen_bottom1),}