bugfix: never use utf8 pos in string.sub
[?]
May 6, 2023, 3:54 PM
ZPQI5UL3V6QIZXWGXO2DZOCCTLIUOQSRP3LIQKEARIQQSNA6RO6ACDependencies
- [2]
I64IPGJXavoid saving fragments in lines - [3]
GZ5WULJVswitch source side to new screen-line-based render - [4]
3ZYCPNQYclearer copy - [5]
FZBXBUFFbugfix: search - [6]
66X36NZNa little more prose describing manual_tests - [7]
HALS7E5Umore clearly skip prints before screen top - [8]
KKMFQDR4editing source code from within the app - [9]
PIEDOKYQbugfix - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing
Change contents
- replacement in text.lua at line 36
if State.lines[State.cursor1.line].data:sub(State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term)-1) == State.search_term thenlocal data = State.lines[State.cursor1.line].datalocal cursor_offset = Text.offset(data, State.cursor1.pos)if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term then - replacement in source_text.lua at line 58
if State.lines[State.cursor1.line].data:sub(State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term)-1) == State.search_term thenlocal data = State.lines[State.cursor1.line].datalocal cursor_offset = Text.offset(data, State.cursor1.pos)if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term then - replacement in Manual_tests.md at line 31
For example, `string.sub` should never use a `_pos` to substring, only an`_offset`.For example, `string.sub` should never use a `_pos`, only an `_offset`.