bugfix: where cursor is drawn
[?]
Jul 20, 2022, 4:11 PM
VSBSWTE4IVQDRXLPQ7VTDIIEBEF7GMGRBHZ2IA73ZR6B2KZWI5JACDependencies
- [2]
KURLAXXIclean up some prints - [3]
5XQ4Y7NUreorg manual tests doc - [4]
GL4Q5WCVkeep text from overflowing right margin - [5]
EKKFWP4Dbugfix: couple of margin-relative computations - [6]
IMEJA43Lsnapshot - [7]
ULKLJBN6couple of renames - [8]
JFFUF5ALoverride mouse state lookups in tests - [9]
WAR3HXHTtest both ways of selecting text with mouse - [10]
RMKMPFT5fix a corner case when selecting text - [11]
APYPFFS3call edit rather than App callbacks in tests - [12]
BULPIBEGbeginnings of a module for the text editor - [13]
JLU2RMC4allow Text.nearest_pos_less_than to return 0 - [14]
LNUHQOGHstart passing in Editor_state explicitly - [15]
UHB4GARJleft/right margin -> left/right coordinates - [16]
H3ECRBXFbugfix: clicking on empty lines - [17]
356GY7IQunify two similar functions - [18]
LF7BWEG4group all editor globals - [19]
LXTTOB33extract a couple of files - [*]
MXA3RZYKdeduce left/right from state where possible - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing
Change contents
- replacement in text_tests.lua at line 288
check_eq(Editor_state.cursor1.pos, 1, 'F - test_click_with_mouse_takes_margins_into_account/cursor:pos')check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_with_mouse_takes_margins_into_account/cursor:pos') - replacement in text_tests.lua at line 378
check_eq(Editor_state.cursor1.pos, 1, 'F - test_click_with_mouse_on_wrapping_line/cursor:pos')check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_with_mouse_on_wrapping_line/cursor:pos') - replacement in text_tests.lua at line 398
check_eq(Editor_state.cursor1.pos, 1, 'F - test_click_with_mouse_on_wrapping_line_takes_margins_into_account/cursor:pos')check_eq(Editor_state.cursor1.pos, 2, 'F - test_click_with_mouse_on_wrapping_line_takes_margins_into_account/cursor:pos') - replacement in text_tests.lua at line 837
check_eq(Editor_state.cursor1.pos, 1, 'F - test_move_cursor_using_mouse/cursor:pos')check_eq(Editor_state.cursor1.pos, 2, 'F - test_move_cursor_using_mouse/cursor:pos') - replacement in text_tests.lua at line 858
check_eq(Editor_state.selection1.pos, 1, 'F - test_select_text_using_mouse/selection:pos')check_eq(Editor_state.selection1.pos, 2, 'F - test_select_text_using_mouse/selection:pos') - replacement in text_tests.lua at line 883
check_eq(Editor_state.selection1.pos, 1, 'F - test_select_text_using_mouse_and_shift/selection:pos')check_eq(Editor_state.selection1.pos, 2, 'F - test_select_text_using_mouse_and_shift/selection:pos') - replacement in text_tests.lua at line 914
check_eq(Editor_state.selection1.pos, 1, 'F - test_select_text_repeatedly_using_mouse_and_shift/selection:pos')check_eq(Editor_state.selection1.pos, 2, 'F - test_select_text_repeatedly_using_mouse_and_shift/selection:pos') - replacement in text_tests.lua at line 916
check_eq(Editor_state.cursor1.pos, 1, 'F - test_select_text_repeatedly_using_mouse_and_shift/cursor:pos')check_eq(Editor_state.cursor1.pos, 2, 'F - test_select_text_repeatedly_using_mouse_and_shift/cursor:pos') - replacement in text_tests.lua at line 1132
check_eq(Editor_state.cursor1.pos, 6, 'F - test_down_arrow_scrolls_down_by_one_screen_line/cursor:pos')check_eq(Editor_state.cursor1.pos, 5, 'F - test_down_arrow_scrolls_down_by_one_screen_line/cursor:pos') - replacement in text_tests.lua at line 1696
check_eq(Editor_state.cursor1.pos, 25, 'F - test_position_cursor_on_recently_edited_wrapping_line/cursor:pos')check_eq(Editor_state.cursor1.pos, 26, 'F - test_position_cursor_on_recently_edited_wrapping_line/cursor:pos') - replacement in text.lua at line 806
local max_x = Text.x(line, len)local max_x = Text.x_after(line, len) - replacement in text.lua at line 813
local currxmin = Text.x(line, curr+1)local currxmax = Text.x(line, curr+2)local currxmin = Text.x_after(line, curr+1)local currxmax = Text.x_after(line, curr+2) - replacement in text.lua at line 831
function Text.x(s, pos)function Text.x_after(s, pos) - edit in text.lua at line 839
function Text.x(s, pos)local offset = Text.offset(s, pos)local s_before = s:sub(1, offset-1)local text_before = App.newText(love.graphics.getFont(), s_before)return App.width(text_before)end - edit in Manual_tests.md at line 11
* How the screen looks. Our tests use a level of indirection to check text andgraphics printed to screen, but not the precise pixels they translate to.- where exactly the cursor is drawn to highlight a given character