first stab at supporting wrapping in cursor up
[?]
May 20, 2022, 3:55 PM
MGT5FTJ35MGYCQO3TZVK3RYUIN5YX475R4XG7RO42SYLYF4AIKFACDependencies
- [2]
5ED3YGHWplanning out cursor up/down over wrapped lines - [3]
WLHI7KD3new globals: draw partial screen line up top - [4]
76AIXR7Hbugfix - [5]
H2DPLWMVsnapshot: wrapping long lines at word boundaries - [6]
XNFTJHC4split keyboard handling between Text and Drawing - [7]
5L7K4GBDclicking to the right of a wrapped line - [8]
DLQMM265scroll past first page - [*]
BULPIBEGbeginnings of a module for the text editor - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [*]
FEEGTRGQbugfix: duplicate character on enter
Change contents
- replacement in text.lua at line 22
if line_index > Screen_top_line or pos >= Top_screen_line_starting_pos thenif line_index > Screen_top_line or pos > Top_screen_line_starting_pos then - replacement in text.lua at line 222[5.4030]→[2.1:27](∅→∅),[2.27]→[5.4030:4312](∅→∅),[5.4030]→[5.4030:4312](∅→∅),[5.4312]→[4.1:78](∅→∅),[4.78]→[5.4401:4415](∅→∅),[5.4401]→[5.4401:4415](∅→∅)
-- previous text linelocal new_cursor_line = Cursor_linewhile new_cursor_line > 1 donew_cursor_line = new_cursor_line-1if Lines[new_cursor_line].mode == 'text' thenlocal old_x = Text.cursor_x(Lines[new_cursor_line].data, Cursor_pos)Cursor_line = new_cursor_lineCursor_pos = Text.nearest_cursor_pos(Lines[Cursor_line].data, old_x)breakif Top_screen_line_starting_pos == 1 then-- top line is done; skip to previous text linelocal new_cursor_line = Cursor_linewhile new_cursor_line > 1 donew_cursor_line = new_cursor_line-1if Lines[new_cursor_line].mode == 'text' thenlocal old_x = Text.cursor_x(Lines[new_cursor_line].data, Cursor_pos)Cursor_line = new_cursor_lineCursor_pos = Text.nearest_cursor_pos(Lines[Cursor_line].data, old_x)breakendendif Cursor_line < Screen_top_line thenScreen_top_line = Cursor_line - replacement in text.lua at line 237
endif Cursor_line < Screen_top_line thenScreen_top_line = Cursor_lineelse-- scroll up just one screen line in current linelocal screen_line_index = table.find(Lines[Cursor_line].screen_line_starting_pos, Top_screen_line_starting_pos)assert(screen_line_index > 1)Top_screen_line_starting_pos = Lines[Cursor_line].screen_line_starting_pos[screen_line_index-1]local s = string.sub(Lines[Cursor_line].data, Top_screen_line_starting_pos)Cursor_pos = Text.nearest_cursor_pos(s, Cursor_x) - edit in manual_tests at line 17[12.67]
scrolling:given moby dick, a file containing all text:page up moves top line on screen to bottompage down moves bottom line on screen to topcursor remains on screencursor remains on text line'up' arrow with cursor at top of screen scrolls up one line (drawings still fully in or out)if top line wrapped before, it scrolls up by only one screen line'down' arrow with cursor at bottom of screen scrolls down one line (drawings still fully in or out)if top line wrapped before, it scrolls down by only one screen line