new fork: for mobile devices
This commit is contained in:
parent
cd28ae8fff
commit
534224f0cc
1
0001-on
1
0001-on
|
@ -8,7 +8,6 @@ on = {
|
|||
-- on.draw
|
||||
-- on.update
|
||||
-- on.resize
|
||||
-- on.file_drop (see love.filedropped)
|
||||
-- on.focus
|
||||
-- on.mouse_press (see love.mousepressed)
|
||||
-- on.mouse_release (see love.mousereleased)
|
||||
|
|
4
main.lua
4
main.lua
|
@ -150,10 +150,6 @@ function App.resize(w, h)
|
|||
if on.resize then on.resize(w,h) end
|
||||
end
|
||||
|
||||
function App.filedropped(file)
|
||||
if on.file_drop then on.file_drop(file) end
|
||||
end
|
||||
|
||||
function App.draw()
|
||||
if Mode == 'error' then
|
||||
love.graphics.setColor(0,0,1)
|
||||
|
|
|
@ -48,15 +48,6 @@ two categories.
|
|||
`App.resize`.
|
||||
(Based on [LÖVE](https://love2d.org/wiki/love.resize))
|
||||
|
||||
* `on.file_drop(file)` -- called when a file icon is dragged and dropped on
|
||||
the app window. Provides in `file` an object representing the file that was
|
||||
dropped, that will respond to the following messages:
|
||||
|
||||
* `file:getFilename()` returning a string name
|
||||
* `file:read()` returning the entire file contents in a single string
|
||||
|
||||
(Based on [LÖVE](https://love2d.org/wiki/love.filedropped).)
|
||||
|
||||
* `on.code_change()` -- called when you make changes to the app using
|
||||
[driver.love](https://git.sr.ht/~akkartik/driver.love), any time you hit
|
||||
`f4` inside driver.love, after a definition is created or modified.
|
||||
|
|
|
@ -370,7 +370,7 @@ end
|
|||
|
||||
function test_click_on_wrapping_line()
|
||||
-- display two screen lines with cursor on one of them
|
||||
App.screen.init{width=50, height=80}
|
||||
App.screen.init{width=60, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc def ghi jkl mno pqr stu'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -407,7 +407,7 @@ end
|
|||
|
||||
function test_draw_text_wrapping_within_word()
|
||||
-- arrange a screen line that needs to be split within a word
|
||||
App.screen.init{width=60, height=60}
|
||||
App.screen.init{width=61, height=60}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abcd e fghijk', 'xyz'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -425,7 +425,7 @@ end
|
|||
|
||||
function test_draw_wrapping_text_containing_non_ascii()
|
||||
-- draw a long line containing non-ASCII
|
||||
App.screen.init{width=60, height=60}
|
||||
App.screen.init{width=65, height=60}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'madam I’m adam', 'xyz'} -- notice the non-ASCII apostrophe
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -443,7 +443,7 @@ end
|
|||
|
||||
function test_click_past_end_of_screen_line()
|
||||
-- display a wrapping line
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
-- 12345678901234
|
||||
Editor_state.lines = load_array{"madam I'm adam"}
|
||||
|
@ -466,7 +466,7 @@ end
|
|||
|
||||
function test_click_on_wrapping_line_rendered_from_partway_at_top_of_screen()
|
||||
-- display a wrapping line from its second screen line
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
-- 12345678901234
|
||||
Editor_state.lines = load_array{"madam I'm adam"}
|
||||
|
@ -487,7 +487,7 @@ end
|
|||
|
||||
function test_click_past_end_of_wrapping_line()
|
||||
-- display a wrapping line
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
-- 12345678901234
|
||||
Editor_state.lines = load_array{"madam I'm adam"}
|
||||
|
@ -511,7 +511,7 @@ end
|
|||
|
||||
function test_click_past_end_of_wrapping_line_containing_non_ascii()
|
||||
-- display a wrapping line containing non-ASCII
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
-- 12345678901234
|
||||
Editor_state.lines = load_array{'madam I’m adam'} -- notice the non-ASCII apostrophe
|
||||
|
@ -556,7 +556,7 @@ end
|
|||
|
||||
function test_select_text()
|
||||
-- display a line of text
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc def'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -578,7 +578,7 @@ end
|
|||
|
||||
function test_cursor_movement_without_shift_resets_selection()
|
||||
-- display a line of text with some part selected
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -596,7 +596,7 @@ end
|
|||
|
||||
function test_edit_deletes_selection()
|
||||
-- display a line of text with some part selected
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -613,7 +613,7 @@ end
|
|||
|
||||
function test_edit_with_shift_key_deletes_selection()
|
||||
-- display a line of text with some part selected
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -635,7 +635,7 @@ end
|
|||
|
||||
function test_copy_does_not_reset_selection()
|
||||
-- display a line of text with a selection
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -653,7 +653,7 @@ end
|
|||
|
||||
function test_cut()
|
||||
-- display a line of text with some part selected
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -671,7 +671,7 @@ end
|
|||
|
||||
function test_paste_replaces_selection()
|
||||
-- display a line of text with a selection
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc', 'def'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -945,7 +945,7 @@ end
|
|||
|
||||
function test_select_all_text()
|
||||
-- display a single line of text
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc def'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
@ -1950,7 +1950,7 @@ end
|
|||
|
||||
function test_undo_restores_selection()
|
||||
-- display a line of text with some part selected
|
||||
App.screen.init{width=75, height=80}
|
||||
App.screen.init{width=80, height=80}
|
||||
Editor_state = edit.initialize_test_state()
|
||||
Editor_state.lines = load_array{'abc'}
|
||||
Text.redraw_all(Editor_state)
|
||||
|
|
Loading…
Reference in New Issue
Block a user