bring back everything from commit a68647ae22
[?]
Nov 6, 2022, 4:53 PM
JCXL74WVQ23V53EOCKA2NXQIYA5NNOXGN5WYC7ZW42EI2I6D5IJACDependencies
- [2]
36Z442IVback to commit 8123959e52f without code editing - [3]
CVSRHMJ2experiment: slightly adaptive scrolling - [4]
MXA3RZYKdeduce left/right from state where possible - [5]
QCPXQ2E3add state arg to a few functions - [6]
YT5P6TO6bugfix: save previous file when dropping a new one on - [7]
UPCIYZEUdrop an unnecessary level of indent - [8]
ATQO62TFMerge lines.love - [9]
KOYAJWE4extract a couple more methods - [10]
AMOPICKVbugfix: check after cursor on same line when searching upwards - [11]
MD3W5IRAnew fork: rip out drawing support - [12]
M6TH7VSZrip out notion of Line_width - [13]
VSBSWTE4bugfix: where cursor is drawn - [14]
LLAOOMULbugfix: search upwards - [15]
4QQBMWLLregression: typing uppercase letters in text - [16]
LF7BWEG4group all editor globals - [17]
ZPUQSPQPextract a few methods - [18]
2RXZ3PGObeginning of a new approach to scroll+wrap - [19]
KZ5GAYRPthis fixes the immediate regression - [20]
UHB4GARJleft/right margin -> left/right coordinates - [21]
HGC5RGJPswitch to line index in a function - [22]
2L5MEZV3experiment: new edit namespace - [23]
3HDWCPDIbugfix: include shift keys in modifier_down - [24]
QSKWIEU3support special chars like '(' in search - [25]
E4HEHLRTextract a variable - [26]
Z5HLXU4Padd state arg to a few functions - [27]
MUJTM6REbring back a level of wrapping - [28]
QYIFOHW3first test! - [29]
5DOTWNVMright margin - [30]
EETIR4GXbugfix: skip over drawings when searching - [31]
VHQCNMARseveral more modules - [32]
JOPVPUSAediting source code from within the app - [33]
LSYLEVBDdrop some redundant args when clearing the cache - [34]
ETM7ENJRsome helpers - [35]
PX3736DXbetter error message - [36]
2CTN2IEFMerge lines.love - [37]
7EQLPB3Obugfix: don't delete selection when moving cursor - [38]
CNCYMM6Amake test initializations a little more obvious - [39]
TGHAJBESuse line cache for drawings as well - [40]
PFT5Y2ZYmove - [41]
CE4LZV4Tdrop last couple of manual tests - [42]
EAEGCJV5rename - [43]
KKMFQDR4editing source code from within the app - [44]
ILOA5BYFseparate data structure for each line's cache data - [45]
RXNR3U5EMerge text.love - [46]
ZJOSQFN6bugfix: path munging on Windows - [47]
LXTTOB33extract a couple of files - [48]
HOSPP2ANcrisp font rendering - [49]
5ZA3BRNYadd state arg to a few functions - [50]
MSOQI3A5bugfix: check before cursor on same line - [51]
TGZAJUEFbring back a set of constants - [52]
OI4FPFINsupport drawings in the source editor - [53]
NDHQN23Gdone passing left/right margins everywhere - [54]
V7LATJC7bugfix: resize - [55]
7PZ4CQFVsearch: transparently handle drawings everywhere - [56]
SPNMXTYRhave file API operate on state object - [57]
ZLJGZYQGselect text with shift + mouseclick - [58]
3PSFWAILMerge lines.love - [59]
LNUHQOGHstart passing in Editor_state explicitly - [60]
2WGHUWE6self-documenting 0 Test_right_margin - [*]
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