add state arg to a few functions
[?]
Jul 13, 2022, 12:10 AM
F65ADDGLR2PNXVSM2XBHM3OSLQC2OTRR3GQBI7DJWIKPJCJ5CSOACDependencies
- [2]
Z5HLXU4Padd state arg to a few functions - [3]
QCQTMUZ7add args to some functions - [4]
5OALPNN3add args to some functions - [5]
KECEMMMRextract couple of functions - [6]
ZPUQSPQPextract a few methods - [7]
ZHLO7K3Madd args to some functions - [8]
2CH77LZCadd args to some functions - [9]
LF7BWEG4group all editor globals - [10]
2LC3BM2Nsupport other whitespace chars in word movements - [11]
62PZGSUCoptimization: moving cursor to next word - [12]
V3EABA35skip multiple consecutive whitespace - [13]
HTWAM4NZbugfix: scrolling in left/right movements - [*]
BULPIBEGbeginnings of a module for the text editor
Change contents
- replacement in text.lua at line 524
Text.left(left, right)Text.left(State, left, right) - replacement in text.lua at line 528
Text.left(left, right)Text.left(State, left, right) - replacement in text.lua at line 548
Text.right_without_scroll()Text.right_without_scroll(State) - replacement in text.lua at line 551
Text.right_without_scroll()Text.right_without_scroll(State) - replacement in text.lua at line 573
function Text.left(left, right)assert(Editor_state.lines[Editor_state.cursor1.line].mode == 'text')if Editor_state.cursor1.pos > 1 thenEditor_state.cursor1.pos = Editor_state.cursor1.pos-1function Text.left(State, left, right)assert(State.lines[State.cursor1.line].mode == 'text')if State.cursor1.pos > 1 thenState.cursor1.pos = State.cursor1.pos-1 - replacement in text.lua at line 578
local new_cursor_line = Editor_state.cursor1.linelocal new_cursor_line = State.cursor1.line - replacement in text.lua at line 581
if Editor_state.lines[new_cursor_line].mode == 'text' thenEditor_state.cursor1.line = new_cursor_lineEditor_state.cursor1.pos = utf8.len(Editor_state.lines[Editor_state.cursor1.line].data) + 1if State.lines[new_cursor_line].mode == 'text' thenState.cursor1.line = new_cursor_lineState.cursor1.pos = utf8.len(State.lines[State.cursor1.line].data) + 1 - replacement in text.lua at line 588
if Text.lt1(Editor_state.cursor1, Editor_state.screen_top1) thenlocal top2 = Text.to2(Editor_state.screen_top1, left, right)if Text.lt1(State.cursor1, State.screen_top1) thenlocal top2 = Text.to2(State.screen_top1, left, right) - replacement in text.lua at line 591
Editor_state.screen_top1 = Text.to1(top2)State.screen_top1 = Text.to1(top2) - replacement in text.lua at line 595
function Text.right(left, right)Text.right_without_scroll()function Text.right(State, left, right)Text.right_without_scroll(State) - replacement in text.lua at line 602
function Text.right_without_scroll()assert(Editor_state.lines[Editor_state.cursor1.line].mode == 'text')if Editor_state.cursor1.pos <= utf8.len(Editor_state.lines[Editor_state.cursor1.line].data) thenEditor_state.cursor1.pos = Editor_state.cursor1.pos+1function Text.right_without_scroll(State)assert(State.lines[State.cursor1.line].mode == 'text')if State.cursor1.pos <= utf8.len(State.lines[State.cursor1.line].data) thenState.cursor1.pos = State.cursor1.pos+1 - replacement in text.lua at line 607
local new_cursor_line = Editor_state.cursor1.linewhile new_cursor_line <= #Editor_state.lines-1 dolocal new_cursor_line = State.cursor1.linewhile new_cursor_line <= #State.lines-1 do - replacement in text.lua at line 610
if Editor_state.lines[new_cursor_line].mode == 'text' thenEditor_state.cursor1.line = new_cursor_lineEditor_state.cursor1.pos = 1if State.lines[new_cursor_line].mode == 'text' thenState.cursor1.line = new_cursor_lineState.cursor1.pos = 1