don't always pop up keyboard on mobile devices
We don't want to do this during app initialization because other forks
might not start out with an editor on screen even if this one does.
We also don't want to perform side-effects like this within
edit.mouse_press.
simplify end of file check on right arrow
fix line wrap in a comment
Merge branch 'yumaikas-experiment'
After using get_rect in edit.draw I grow more confident that this is a
better approach. The only drawback is that edit.up and
edit._up_whole_screen_lines need some extra work to fight the
abstraction of get_rect. But that feels like a net win.
reuse get_rect in edit.draw
clean up an issue I feel confident about
clean up an issue I feel confident about
explicitly state when operations manage undo
explicitly state when operations manage undo
make function arg lowercase
This might have introduced a bug. I _think_ I've checked for functions
without an `Editor` arg, but one may have slipped past. I don't know how
to be sure. (Not without tests :/)
make function arg lowercase
This might have introduced a bug. I _think_ I've checked for functions
without an `Editor` arg, but one may have slipped past. I don't know how
to be sure. (Not without tests :/)
bugfix
scenario:
start with an empty file, there's one line with a '+' button on it
press the '+' to create a drawing in the top line
press C-z to undo
= before this commit, undo would create a weird intermediate state where there were two lines with '+' on them
scenario:
type something into the first line, press enter to append a second line
press the '+' on the second line to create a drawing
press C-z to undo
= crash
The root cause in both cases: we end up creating 2 undo events starting
from the same before snapshot: one inside the button handler, and a
second on mouse release.
This doesn't affect lines 1 because we had a separate variable called
current_drawing which protected the mouse release handler from
triggering.
bugfix
scenario:
start with an empty file, there's one line with a '+' button on it
press the '+' to create a drawing in the top line
press C-z to undo
= before this commit, undo would create a weird intermediate state where there were two lines with '+' on them
scenario:
type something into the first line, press enter to append a second line
press the '+' on the second line to create a drawing
press C-z to undo
= crash
The root cause in both cases: we end up creating 2 undo events starting
from the same before snapshot: one inside the button handler, and a
second on mouse release.
This doesn't affect lines 1 because we had a separate variable called
current_drawing which protected the mouse release handler from
triggering.
bugfix
scenario:
* open a file with a drawing on the first line
* position cursor in the line below
* hit backspace
I _think_ this is the only place where I need to update screen_top
_before_ the scroll check (because screen_top switches mode and has
gotten corrupted).