Merge text.love
[?]
Sep 20, 2023, 9:49 PM
5ML5VGOCYH4OBKCYJ72BYEN4W3H2NF423AFH6B3VJKJY3K7K2J7ACDependencies
- [2]
OTYGZVPWMerge text.love - [3]
YXQOITYSMerge lines.love - [4]
TVCPXAAUrename - [5]
Q6RXCILQMerge text.love - [6]
SGMA5JLEsave the list of tests in repo - [7]
VHQCNMARseveral more modules - [8]
WB6SIB7HMerge lines.love - [9]
ORKN6EOBMerge lines.love - [10]
2344TV56Merge lines.love - [11]
73OCE2MCafter much struggle, a brute-force undo - [12]
BULPIBEGbeginnings of a module for the text editor - [13]
36Z442IVback to commit 8123959e52f without code editing - [14]
ONHKBLLCMerge lines.love - [15]
R5QXEHUIsomebody stop me - [16]
2L5MEZV3experiment: new edit namespace - [17]
A4BSGS2CMerge lines.love - [18]
RU4HIK43Merge lines.love - [19]
LXFHXL2NMerge text.love - [20]
K74U4BAUMerge lines.love - [21]
FS2ITYYHrecord a known issue - [22]
4YDBYBA4clean up memory leak experiments - [23]
AVTNUQYRbasic test-enabled framework - [24]
TLOAPLBJadd a license - [25]
N2NUGNN4include a brief reference enabling many useful apps - [26]
VHUNJHXBMerge lines.love - [27]
4SR3Z4Y3document the version of LÖVE I've been using - [28]
2TQUKHBCMerge lines.love - [29]
B6DS4GZCMerge lines.love - [30]
VOU73AK6Merge lines.love - [31]
T4FRZSYLdelete an ancient, unused file - [32]
PJ5PQAQErecord support for multiple versions - [33]
ZLJYLPOTMerge lines.love - [34]
3PSFWAILMerge lines.love - [35]
MD3W5IRAnew fork: rip out drawing support - [36]
LXTTOB33extract a couple of files - [37]
RSZD5A7Gforgot to add json.lua - [38]
X43ZIKR3Merge text.love - [39]
RO35V4H4Merge text.love - [40]
34BZ5ZKNMerge lines.love - [41]
IGBTDA6YMerge text.love - [42]
KKMFQDR4editing source code from within the app - [43]
ED4Z6ORCcleaner API for file-system access - [44]
BLWAYPKVextract a module - [45]
OGUV4HSAremove some memory leaks from rendered fragments - [46]
QD4LOFQRMerge text.love - [47]
3QNOKBFMbeginnings of a test harness - [48]
2CFLXLIEMerge text.love - [49]
KMSL74GAsupport selections in the source editor - [50]
LWPFEZBIMerge lines.love - [51]
VXRYVZ74Merge text.love - [52]
M5JXTW56Merge text.love - [53]
XX7G2FFJintermingle freehand line drawings with text - [54]
D2GCFTTTclean up repl functionality - [55]
6LJZN727handle chords - [56]
VP5KC4XZMerge lines.love - [57]
2CTN2IEFMerge lines.love - [58]
UAYCSFSKMerge text.love - [59]
OTIBCAUJlove2d scaffold - [60]
VXORMHMEdelete experimental REPL - [61]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [62]
2JLMNZZIMerge text.love - [63]
3G723RV5Merge text.love - [64]
JOPVPUSAediting source code from within the app - [65]
K2X6G75Zstart writing some tests for drawings - [66]
FM5LDKGTMerge text.love - [67]
66X36NZNa little more prose describing manual_tests - [68]
ECBDENZ4Merge text.love - [69]
C3GUE45IMerge text.love - [70]
CE4LZV4Tdrop last couple of manual tests - [71]
D4B52CQ2Merge lines.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),}