find text
[?]
Jun 3, 2022, 5:53 AM
Z4XRNDTRTGSZHNB65WNHOVUBFW4QWQABLVSK4RM3QJHGK33DMRJACDependencies
- [2]
ULKLJBN6couple of renames - [3]
73OCE2MCafter much struggle, a brute-force undo - [4]
OTIBCAUJlove2d scaffold - [5]
3TFEAQSWstart using some globals - [6]
BULPIBEGbeginnings of a module for the text editor - [7]
XX7G2FFJintermingle freehand line drawings with text - [8]
B3IWYWSRdelete another arg that can be deduced - [9]
EWMPYCDObugfix - [10]
5DOC2CBMextract a function - [11]
AVTNUQYRbasic test-enabled framework - [12]
XNFTJHC4split keyboard handling between Text and Drawing - [13]
252M2QMDforgot to move this special case out - [14]
CVGE3SIGI feel confident now that page-down is working. - [15]
DLQMM265scroll past first page - [16]
XVR2O5PIchange text cursor shape - [17]
MDXGMZU2disable all debug prints - [18]
OYXDYPGSget rid of debug variables - [19]
6LJZN727handle chords - [20]
QU7NHFOVshow cursor - [21]
3CS5KKCIup/down cursor movement - [22]
2RXZ3PGObeginning of a new approach to scroll+wrap - [23]
BYG5CEMVsupport for naming points - [24]
YTSPVDZHfirst successful pagedown test, first bug found by test - [25]
242L3OQXbugfix: ensure Cursor_line is always on a text line - [26]
JCSLDGAHbeginnings of support for multiple shapes - [27]
Y36LOGR5bugfix: show cursor when past end of line - [28]
ESETRNLBbugfix: printing the first part of a line at the bottom made it seem non-wrapping - [29]
U7M4M2F7bugfix: don't rely on Screen_bottom1 while scrolling - [30]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [*]
DHI6IJCNselecting text and deleting selections - [*]
OAHNWDYG. - [*]
6DE7RBZ6move mouse_released events to Drawing
Change contents
- replacement in text.lua at line 79
Text.draw_cursor(x+Text.x(frag, Cursor1.pos-pos+1), y)if Search_term thenif Lines[Cursor1.line].data:sub(Cursor1.pos, Cursor1.pos+utf8.len(Search_term)-1) == Search_term thenif Search_text == nil thenSearch_text = App.newText(love.graphics.getFont(), Search_term)endlove.graphics.setColor(0.7,1,1)love.graphics.rectangle('fill', x,y, math.floor(App.width(Search_text)*Zoom),math.floor(15*Zoom))love.graphics.setColor(0,0,0)love.graphics.print(Search_term, x,y, 0, Zoom)endelseText.draw_cursor(x+Text.x(frag, Cursor1.pos-pos+1), y)end - replacement in text.lua at line 97[4.37]→[4.398:458](∅→∅),[4.59]→[4.72:99](∅→∅),[4.282]→[4.72:99](∅→∅),[4.458]→[4.72:99](∅→∅),[4.29]→[4.72:99](∅→∅)
if line_index == Cursor1.line and Cursor1.pos == pos thenText.draw_cursor(x, y)if Search_term == nil thenif line_index == Cursor1.line and Cursor1.pos == pos thenText.draw_cursor(x, y)end - edit in text.lua at line 106
function Text.draw_search_bar()local h = math.floor(15*Zoom)+2local y = App.screen.height-hlove.graphics.setColor(0.9,0.9,0.9)love.graphics.rectangle('fill', 0, y-10, App.screen.width-1, h+8)love.graphics.setColor(0.6,0.6,0.6)love.graphics.line(0, y-10, App.screen.width-1, y-10)love.graphics.setColor(1,1,1)love.graphics.rectangle('fill', 20, y-6, App.screen.width-40, h+2, 2,2)love.graphics.setColor(0.6,0.6,0.6)love.graphics.rectangle('line', 20, y-6, App.screen.width-40, h+2, 2,2)love.graphics.setColor(0,0,0)App.screen.print(Search_term, 25,y-5, 0, Zoom)love.graphics.setColor(1,0,0)if Search_text == nil thenSearch_text = App.newText(love.graphics.getFont(), Search_term)endlove.graphics.circle('fill', 25+math.floor(App.width(Search_text)*Zoom),y-5+h, 2)love.graphics.setColor(0,0,0)endfunction Text.search_next()-- search current linelocal pos = Lines[Cursor1.line].data:find(Search_term, Cursor1.pos)if pos thenCursor1.pos = posendif pos == nil thenfor i=Cursor1.line+1,#Lines dopos = Lines[i].data:find(Search_term)if pos thenCursor1.line = iCursor1.pos = posbreakendendendif pos == nil then-- wrap aroundfor i=1,Cursor1.line-1 dopos = Lines[i].data:find(Search_term)if pos thenCursor1.line = iCursor1.pos = posbreakendendendif pos == nil thenCursor1.line = Search_backup_cursor1.lineCursor1.pos = Search_backup_cursor1.posendif Text.lt1(Cursor1, Screen_top1) or Text.lt1(Screen_bottom1, Cursor1) thenScreen_top1.line = Cursor1.linelocal _, pos = Text.pos_at_start_of_cursor_screen_line()Screen_top1.pos = posendend - edit in text.lua at line 1899
--? if Cursor1.line > Screen_bottom1.line then - edit in main.lua at line 71
-- searchSearch_term = nilSearch_text = nilSearch_backup_cursor1 = nil -- where to position the cursor if search term was not found - replacement in main.lua at line 156
if line_index == Cursor1.line thenText.draw_cursor(25, y)if Search_term == nil thenif line_index == Cursor1.line thenText.draw_cursor(25, y)end - replacement in main.lua at line 177
--? os.exit(1)if Search_term thenText.draw_search_bar()end - edit in main.lua at line 187
if Search_term then return end - edit in main.lua at line 213[4.1485][34.3]
if Search_term then return end - replacement in main.lua at line 218
if Current_drawing_mode == 'name' thenif Search_term thenSearch_term = Search_term..tSearch_text = nilText.search_next()elseif Current_drawing_mode == 'name' then - replacement in main.lua at line 233
if love.mouse.isDown('1') or chord:sub(1,2) == 'C-' thenif Search_term thenif chord == 'escape' thenSearch_term = nilSearch_text = nilCursor1 = Search_backup_cursor1Search_backup_cursor1 = nilelseif chord == 'return' thenSearch_term = nilSearch_text = nilelseif chord == 'backspace' thenlocal len = utf8.len(Search_term)local byte_offset = utf8.offset(Search_term, len)Search_term = string.sub(Search_term, 1, byte_offset-1)Search_text = nilelseif chord == 'down' thenCursor1.pos = Cursor1.pos+1Text.search_next()endreturnelseif chord == 'C-f' thenSearch_term = ''Search_backup_cursor1 = {line=Cursor1.line, pos=Cursor1.pos}assert(Search_text == nil)elseif love.mouse.isDown('1') or chord:sub(1,2) == 'C-' then