bring back everything from commit a68647ae22
[?]
Nov 6, 2022, 4:53 PM
JCXL74WVQ23V53EOCKA2NXQIYA5NNOXGN5WYC7ZW42EI2I6D5IJACDependencies
- [2]
36Z442IVback to commit 8123959e52f without code editing - [3]
CE4LZV4Tdrop last couple of manual tests - [4]
M6TH7VSZrip out notion of Line_width - [5]
7PZ4CQFVsearch: transparently handle drawings everywhere - [6]
2CTN2IEFMerge lines.love - [7]
KZ5GAYRPthis fixes the immediate regression - [8]
QSKWIEU3support special chars like '(' in search - [9]
RXNR3U5EMerge text.love - [10]
LF7BWEG4group all editor globals - [11]
ILOA5BYFseparate data structure for each line's cache data - [12]
3HDWCPDIbugfix: include shift keys in modifier_down - [13]
5ZA3BRNYadd state arg to a few functions - [14]
OI4FPFINsupport drawings in the source editor - [15]
LNUHQOGHstart passing in Editor_state explicitly - [16]
5DOTWNVMright margin - [17]
MD3W5IRAnew fork: rip out drawing support - [18]
LXTTOB33extract a couple of files - [19]
UHB4GARJleft/right margin -> left/right coordinates - [20]
EAEGCJV5rename - [21]
SPNMXTYRhave file API operate on state object - [22]
VHQCNMARseveral more modules - [23]
2RXZ3PGObeginning of a new approach to scroll+wrap - [24]
VSBSWTE4bugfix: where cursor is drawn - [25]
3PSFWAILMerge lines.love - [26]
KOYAJWE4extract a couple more methods - [27]
ETM7ENJRsome helpers - [28]
ZLJGZYQGselect text with shift + mouseclick - [29]
CVSRHMJ2experiment: slightly adaptive scrolling - [30]
2WGHUWE6self-documenting 0 Test_right_margin - [31]
ATQO62TFMerge lines.love - [32]
7EQLPB3Obugfix: don't delete selection when moving cursor - [33]
JOPVPUSAediting source code from within the app - [34]
HOSPP2ANcrisp font rendering - [35]
PX3736DXbetter error message - [36]
HGC5RGJPswitch to line index in a function - [37]
Z5HLXU4Padd state arg to a few functions - [38]
QYIFOHW3first test! - [39]
4QQBMWLLregression: typing uppercase letters in text - [40]
2L5MEZV3experiment: new edit namespace - [41]
QCPXQ2E3add state arg to a few functions - [42]
UPCIYZEUdrop an unnecessary level of indent - [43]
PFT5Y2ZYmove - [44]
ZPUQSPQPextract a few methods - [45]
V7LATJC7bugfix: resize - [46]
LLAOOMULbugfix: search upwards - [47]
LSYLEVBDdrop some redundant args when clearing the cache - [48]
TGZAJUEFbring back a set of constants - [49]
EETIR4GXbugfix: skip over drawings when searching - [50]
TGHAJBESuse line cache for drawings as well - [51]
MSOQI3A5bugfix: check before cursor on same line - [52]
MXA3RZYKdeduce left/right from state where possible - [53]
NDHQN23Gdone passing left/right margins everywhere - [54]
CNCYMM6Amake test initializations a little more obvious - [55]
E4HEHLRTextract a variable - [56]
ZJOSQFN6bugfix: path munging on Windows - [57]
AMOPICKVbugfix: check after cursor on same line when searching upwards - [58]
KKMFQDR4editing source code from within the app - [59]
YT5P6TO6bugfix: save previous file when dropping a new one on - [60]
MUJTM6REbring back a level of wrapping - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
GNQC72UXgeneralize a function - [*]
KV7GGVERcouple of accidental globals - [*]
KOTI3MFGbugfix in previous commit - [*]
OTIBCAUJlove2d scaffold - [*]
6LJZN727handle chords - [*]
3QNOKBFMbeginnings of a test harness - [*]
AVTNUQYRbasic test-enabled framework - [*]
JMUD7T3Oget rid of ugly side-effects in tests - [*]
4KC7I3E2make colors easier to edit - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing
Change contents
- replacement in text.lua at line 121
--? print('x: '..tostring(x)..'; '..tostring(State.right-x)..'px to go')--? print('x: '..tostring(x)..'; frag_width: '..tostring(frag_width)..'; '..tostring(State.right-x)..'px to go') - replacement in text.lua at line 364
State.cursor1.line = State.cursor1.line+1State.cursor1.pos = 1State.cursor1 = {line=State.cursor1.line+1, pos=1} - replacement in text.lua at line 380
State.cursor1.line = State.screen_top1.lineState.cursor1.pos = State.screen_top1.posState.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos} - replacement in text.lua at line 399
State.screen_top1.line = State.screen_bottom1.lineState.screen_top1.pos = State.screen_bottom1.posState.screen_top1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos} - replacement in text.lua at line 402
State.cursor1.line = State.screen_top1.lineState.cursor1.pos = State.screen_top1.posState.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos} - edit in text.lua at line 467
Text.populate_screen_line_starting_pos(State, State.cursor1.line) - edit in text.lua at line 613
--? print('to2:', State.cursor1.line, State.cursor1.pos) - edit in text.lua at line 615
--? print('to2: =>', top2.line, top2.screen_line, top2.screen_pos)-- slide to start of screen line - edit in text.lua at line 618
--? print('snap', State.screen_top1.line, State.screen_top1.pos, State.screen_top1.posB, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos) - edit in text.lua at line 635
--? print('snap =>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos) - replacement in text.lua at line 792
local result = {line=loc1.line, screen_line=1}local result = {line=loc1.line} - replacement in search.lua at line 24
local pos = find(State.lines[State.cursor1.line].data, State.search_term, State.cursor1.pos)local pos = find(State.lines[State.cursor1.line].data, State.search_term, State.cursor1.pos, --[[literal]] true) - replacement in search.lua at line 31
pos = find(State.lines[i].data, State.search_term)pos = find(State.lines[i].data, State.search_term, --[[from start]] nil, --[[literal]] true) - replacement in search.lua at line 33
State.cursor1.line = iState.cursor1.pos = posState.cursor1 = {line=i, pos=pos} - replacement in search.lua at line 41
pos = find(State.lines[i].data, State.search_term)pos = find(State.lines[i].data, State.search_term, --[[from start]] nil, --[[literal]] true) - replacement in search.lua at line 43
State.cursor1.line = iState.cursor1.pos = posState.cursor1 = {line=i, pos=pos} - replacement in search.lua at line 50
pos = find(State.lines[State.cursor1.line].data, State.search_term)pos = find(State.lines[State.cursor1.line].data, State.search_term, --[[from start]] nil, --[[literal]] true) - replacement in search.lua at line 70
local pos = rfind(State.lines[State.cursor1.line].data, State.search_term, State.cursor1.pos-1)local pos = rfind(State.lines[State.cursor1.line].data, State.search_term, State.cursor1.pos-1, --[[literal]] true) - replacement in search.lua at line 77
pos = rfind(State.lines[i].data, State.search_term)pos = rfind(State.lines[i].data, State.search_term, --[[from end]] nil, --[[literal]] true) - replacement in search.lua at line 79
State.cursor1.line = iState.cursor1.pos = posState.cursor1 = {line=i, pos=pos} - replacement in search.lua at line 87
pos = rfind(State.lines[i].data, State.search_term)pos = rfind(State.lines[i].data, State.search_term, --[[from end]] nil, --[[literal]] true) - replacement in search.lua at line 89
State.cursor1.line = iState.cursor1.pos = posState.cursor1 = {line=i, pos=pos} - replacement in search.lua at line 96
pos = rfind(State.lines[State.cursor1.line].data, State.search_term)pos = rfind(State.lines[State.cursor1.line].data, State.search_term, --[[from end]] nil, --[[literal]] true) - replacement in search.lua at line 114
function find(s, pat, i)function find(s, pat, i, plain) - replacement in search.lua at line 116
return s:find(pat, i)return s:find(pat, i, plain) - replacement in search.lua at line 119
function rfind(s, pat, i)function rfind(s, pat, i, plain) - replacement in search.lua at line 125
local rendpos = rs:find(rpat, ri)local rendpos = rs:find(rpat, ri, plain) - edit in main_tests.lua at line 9
check_eq(Editor_state.right, 300 - Test_margin_right, 'F - test_resize_window/baseline/left_margin') - edit in main_tests.lua at line 11
-- ugly; resize switches to real, non-test margins - replacement in main_tests.lua at line 14
check_eq(Editor_state.left, Test_margin_left, 'F - test_resize_window/left_margin')-- ugly; right margin switches from 0 after resizecheck_eq(Editor_state.left, Margin_left, 'F - test_resize_window/left_margin') - replacement in main_tests.lua at line 16
check_eq(Editor_state.width, 200-Test_margin_left-Margin_right, 'F - test_resize_window/drawing_width')check_eq(Editor_state.width, 200-Margin_left-Margin_right, 'F - test_resize_window/drawing_width') - edit in main.lua at line 73
love.window.setPosition(settings.x, settings.y, settings.displayindex) - edit in main.lua at line 78
love.window.setPosition(settings.x, settings.y, settings.displayindex) - replacement in main.lua at line 154
if filename:sub(1,1) ~= '/' thenif is_relative_path(filename) then - replacement in keychord.lua at line 59
for i,x in ipairs(arr) doif x == elem thenreturn iif type(elem) == 'function' thenfor i,x in ipairs(arr) doif elem(x) thenreturn iend - edit in keychord.lua at line 65
elsefor i,x in ipairs(arr) doif x == elem thenreturn iendend - replacement in file.lua at line 40
outfile:write(line.data, '\n')outfile:write(line.data)outfile:write('\n') - edit in file.lua at line 61[3.18211]
function is_absolute_path(path)local os_path_separator = package.config:sub(1,1)if os_path_separator == '/' then-- POSIX systems permit backslashes in filenamesreturn path:sub(1,1) == '/'elseif os_path_separator == '\\' thenif path:sub(2,2) == ':' then return true end -- DOS drive letter followed by volume separatorlocal f = path:sub(1,1)return f == '/' or f == '\\'elseerror('What OS is this? LÖVE reports that the path separator is "'..os_path_separator..'"')endendfunction is_relative_path(path)return not is_absolute_path(path)end - replacement in edit.lua at line 67
filename = love.filesystem.getUserDirectory()..'/lines.txt',filename = love.filesystem.getUserDirectory()..'/lines.txt', -- '/' should work even on Windows - replacement in edit.lua at line 97
State.screen_bottom1.line = line_indexState.screen_bottom1 = {line=line_index, pos=nil} - replacement in edit.lua at line 234
State.search_backup = {cursor={line=State.cursor1.line, pos=State.cursor1.pos}, screen_top={line=State.screen_top1.line, pos=State.screen_top1.pos}}State.search_backup = {cursor={line=State.cursor1.line, pos=State.cursor1.pos},screen_top={line=State.screen_top1.line, pos=State.screen_top1.pos},} - edit in edit.lua at line 330
-- Insulate tests from some key globals so I don't have to change the vast-- majority of tests when they're modified for the real app. - edit in edit.lua at line 333
Test_margin_right = 0 - replacement in edit.lua at line 340
App.screen.width, -- right margin = 0App.screen.width - Test_margin_right, - edit in app.lua at line 14
App.snapshot_love() - edit in app.lua at line 127
-- save/restore various framework globals we care about -- only on very first loadfunction App.snapshot_love()if Love_snapshot then return endLove_snapshot = {}-- save the entire initial font; it doesn't seem reliably recreated using newFontLove_snapshot.initial_font = love.graphics.getFont()endfunction App.undo_initialize()love.graphics.setFont(Love_snapshot.initial_font)end - edit in app.lua at line 151
end-- operations on the LÖVE window within the monitor/displayfunction App.screen.resize(width, height, flags)App.screen.width = widthApp.screen.height = heightApp.screen.flags = flagsendfunction App.screen.size()return App.screen.width, App.screen.height, App.screen.flags - edit in app.lua at line 164
function App.screen.move(x,y, displayindex)App.screen.x = xApp.screen.y = yApp.screen.displayindex = displayindexendfunction App.screen.position()return App.screen.x, App.screen.y, App.screen.displayindexend - edit in app.lua at line 191
endfunction colortable(app_color)return {app_color.r, app_color.g, app_color.b, app_color.a} - edit in app.lua at line 403
App.screen.resize = love.window.setModeApp.screen.size = love.window.getModeApp.screen.move = love.window.setPositionApp.screen.position = love.window.getPosition - edit in Manual_tests.md at line 6
Startup:- terminal log shows unit tests running