start sketching out a scrollbar
Dependencies
- [2]
6K5PFF6Xhelper: trimming whitespace from strings - [3]
DTBFNHJDmanual tests for the protocol with the driver - [4]
PRE6XPRNresponsively increase/decrease font height - [5]
OI4FPFINsupport drawings in the source editor - [6]
36Z442IVback to commit 8123959e52f without code editing - [7]
PLKNHYZ4extract a function - [8]
2RXZ3PGObeginning of a new approach to scroll+wrap - [9]
OGUV4HSAremove some memory leaks from rendered fragments - [10]
LF7BWEG4group all editor globals - [11]
4CTZOJPCstop pretending globals are local - [12]
MU2HIRR6Merge lines.love - [13]
ZM7NOBRMnew fork: carousel shell - [14]
R53OF3ONone bug I've repeatedly run into while testing with Moby Dick - [15]
PTDO2SOTadd state arg to schedule_save - [16]
SPSW74Y5add state arg to Text.keychord_pressed - [17]
S2MISTTMadd state arg to a few functions - [18]
XNFTJHC4split keyboard handling between Text and Drawing - [19]
QCPXQ2E3add state arg to a few functions - [20]
LSYLEVBDdrop some redundant args when clearing the cache - [21]
MUJTM6REbring back a level of wrapping - [22]
BULPIBEGbeginnings of a module for the text editor - [23]
HMODUNJEscroll on backspace - [24]
LXTTOB33extract a couple of files - [25]
7LVK4KRDfix a failing test - [26]
PX7DDEMOautosave slightly less aggressively - [27]
4EGQRXDAbugfix: naming points - [28]
I64IPGJXavoid saving fragments in lines - [29]
ILOA5BYFseparate data structure for each line's cache data - [30]
TGHAJBESuse line cache for drawings as well - [31]
Z5HLXU4Padd state arg to a few functions - [32]
JCXL74WVbring back everything from commit a68647ae22 - [33]
AYE2VEGJextract a couple of methods - [34]
MD3W5IRAnew fork: rip out drawing support - [*]
SDEY7LFJrename a variable - [*]
2L5MEZV3experiment: new edit namespace - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [*]
R5QXEHUIsomebody stop me - [*]
5RUFNRJOstart of the visual skeleton
Change contents
- edit in text.lua at line 31
--? print(i) - replacement in text.lua at line 170[5.2204]→[5.4:4](∅→∅),[5.4]→[5.3:61](∅→∅),[5.2113]→[5.3:61](∅→∅),[5.2204]→[5.3:61](∅→∅),[5.344]→[5.3:61](∅→∅)
Text.clear_screen_line_cache(State, State.cursor1.line)Text.refresh_screen_line_cache(State, State.cursor1.line) - replacement in text.lua at line 239
Text.clear_screen_line_cache(State, State.cursor1.line)Text.refresh_screen_line_cache(State, State.cursor1.line) - replacement in text.lua at line 272
Text.clear_screen_line_cache(State, State.cursor1.line)Text.refresh_screen_line_cache(State, State.cursor1.line) - replacement in text.lua at line 367
Text.clear_screen_line_cache(State, State.cursor1.line)Text.refresh_screen_line_cache(State, State.cursor1.line) - edit in text.lua at line 933
local curr_screen_line_index = 1 - edit in text.lua at line 936
State.line_cache[i].start_screen_line_index = curr_screen_line_indexText.populate_screen_line_starting_pos(State, i)curr_screen_line_index = curr_screen_line_index + #State.line_cache[i].screen_line_starting_pos - edit in text.lua at line 940
State.screen_line_count = curr_screen_line_index-1 - replacement in text.lua at line 943
function Text.clear_screen_line_cache(State, line_index)function Text.refresh_scrollbar_data(State)--? print('clearing fragments')local curr_screen_line_index = 1local npopulated = 0for i=1,#State.lines doif State.line_cache[i] == nil thenState.line_cache[i] = {}endif State.line_cache[i].screen_line_starting_pos == nil then--? print(('refresh_scrollbar_data: populating line %d'):format(i))Text.populate_screen_line_starting_pos(State, i)npopulated = npopulated+1endState.line_cache[i].start_screen_line_index = curr_screen_line_indexcurr_screen_line_index = curr_screen_line_index + #State.line_cache[i].screen_line_starting_posendif npopulated > 1 thenprint(('refresh_scrollbar_data: had to populate %d lines'):format(npopulated))endState.screen_line_count = curr_screen_line_index-1endfunction Text.refresh_screen_line_cache(State, line_index) - edit in text.lua at line 967
Text.populate_screen_line_starting_pos(State, line_index)Text.refresh_scrollbar_data(State) - edit in select.lua at line 120
Text.clear_screen_line_cache(State, minl) - edit in select.lua at line 125
Text.refresh_screen_line_cache(State, minl) - edit in select.lua at line 135
Text.refresh_screen_line_cache(State, minl) - edit in edit.lua at line 32
-- start_screen_line_index: a count of the number of screen lines above this line - edit in Manual_tests.md at line 16
* Type out a wrapping line, select all using ctrl+a and delete. Editor doesnot crash. - file addition: 0035-compute_scrollbar[39.2]
-- returns:-- * a float between 0 and 1 regarding the relative position of the top line on screen-- * a float between 0 and 1 regarding the relative position of the bottom line on screencompute_scrollbar = function(state)local top = state.line_cache[state.screen_top1.line].start_screen_line_indexlocal bot = state.line_cache[state.screen_bottom1.line].start_screen_line_indexreturn (top-1)/state.screen_line_count, bot/state.screen_line_countend - file addition: 0034-draw_scrollbar[39.2]
draw_scrollbar = function(Editor_state)App.color(Normal_color)love.graphics.line(Editor_state.right+30, Editor_state.top, Editor_state.right+30, Editor_state.bottom)love.graphics.line(Editor_state.right+25, Editor_state.top, Editor_state.right+35, Editor_state.top)love.graphics.line(Editor_state.right+25, Editor_state.bottom, Editor_state.right+35, Editor_state.bottom)local sbtop, sbbot = compute_scrollbar(Editor_state)local topy = Editor_state.top + sbtop*(Editor_state.bottom - Editor_state.top)local boty = Editor_state.top +sbbot*(Editor_state.bottom - Editor_state.top)App.color{r=0.6, g=0.6, b=0.8, a=0.5}love.graphics.rectangle('fill', Editor_state.right+20, topy, 20, boty-topy)end - replacement in 0013-on.keychord_press at line 11
end[4.2303]end - edit in 0012-on.draw at line 6[5.3033][40.1925]
draw_scrollbar(Editor_state)