M-left/M-right for word-based motions
[?]
May 25, 2022, 10:47 PM
2HW3HUCGWNPSVN2BRPZIFVBI64CTFEJKETLVDJ4X5X2GUPERXSJQCDependencies
- [2]
KECEMMMRextract couple of functions - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
XNFTJHC4split keyboard handling between Text and Drawing - [*]
6LJZN727handle chords
Change contents
- edit in text.lua at line 775
-- left/right by one word-- C- hotkeys reserved for drawings, so we'll use M-elseif chord == 'M-left' thenwhile true doText.left()if Cursor1.pos == 1 then break endassert(Cursor1.pos > 1)local offset = utf8.offset(Lines[Cursor1.line].data, Cursor1.pos)assert(offset > 1)if Lines[Cursor1.line].data:sub(offset-1,offset-1) == ' ' thenbreakendendelseif chord == 'M-right' thenwhile true doText.right()if Cursor1.pos > utf8.len(Lines[Cursor1.line].data) then break endlocal offset = utf8.offset(Lines[Cursor1.line].data, Cursor1.pos)if Lines[Cursor1.line].data:sub(offset,offset) == ' ' thenbreakendend - edit in keychord.lua at line 16[6.1004][6.1004]
print(result)