0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00
Commit graph

12 commits

Author SHA1 Message Date
Neil Jenkins
d2e211796b Fix undo shortcut sometimes not working
Same deal - does the Shift modifier also modify the character? Just
allow both.

Fixes #457.
2024-03-04 11:22:10 +11:00
Neil Jenkins
46bc36861e Fix Shift-number shortcuts don't work on windows
The perennial issue of should keyboard shortcuts be about the character
or the key!
2024-03-04 10:52:07 +11:00
Neil Jenkins
73e9d083dd Fix handling of Japanese IME input
With the modern keyboard events, the Backspace/Enter handlers were being
triggered even when they were part of an IME composition, which broke
the native IME handling. We now ignore all keyboard events that are part
of composition to avoid this issue.
2024-02-01 21:24:11 +11:00
Neil Jenkins
6cfd85bd8e Add undo point for automatic list creation
If you do `*` then space or `1. ` then space at the beginning of a line,
we automatically create a list. Now you can use undo to undo just the
automatic list creation, reverting to the plain text you typed.
2023-12-20 14:17:34 +11:00
Neil Jenkins
3804ea50ba Use modern keyboard event properties
The keyboard event handling code was written over a decade ago and we
have better APIs now! More importantly, the old APIs are deprecated, so
we should stop using them.

Fixes #450
2023-12-20 14:17:34 +11:00
Neil Jenkins
9f5df9e5c0 Fix format intent lost after pressing Space
On Chrome, if you made an inline formatting change, this would insert a
new <span> with a ZWS inside so we could focus it. Pressing Space would
remove this ZWS resulting in the focus ending up outside and so the
formatting would be lost. We were removing the ZWS so we could check
if we were at a block boundary correctly; instead, I've made it so the
boundary check can handle trailing or leading ZWS (see previous commit).
2023-09-27 14:56:00 +10:00
Neil Jenkins
edde44a924 Auto-format list if starting line with * or 1. 2023-09-19 14:45:15 +08:00
Neil Jenkins
cbde45311a Fix crash linkifying text in middle of node
We were looking at the selection properties after we had mutated the DOM, and
trying to manipulate them based on some numbers cached from before mutating
the DOM, which could result in trying to set a negative index for the selection
offset. Instead, calculate all our values before we do any mutations.

Fixes #430
2023-04-20 10:57:05 +10:00
Neil Jenkins
8304fd3e04 Let ArrowRight key always break out of <code> 2023-02-22 16:01:23 +11:00
Neil Jenkins
cf30a69b89 Fix backspace can delete two characters
If we're handling the backspace completely ourselves, must prevent
default to stop the browser also having a go.
2023-02-22 11:27:16 +11:00
Neil Jenkins
1904405ab8 Auto delink if backspacing inside auto-linked URL
This means if you make a mistake and backspace, you don't end up
accidentally fixing the text but leaving the link to the wrong URL.
2023-02-01 14:20:53 +11:00
Neil Jenkins
fe0dfdf6c4 Squire 2.0
This is a massive refactor to port Squire to TypeScript, fix a bunch of small
bugs and modernise our tooling. The development was done on an internal
repository, so apologies to anyone following externally for the commit dump;
updates from here should come as real commits again.

Co-authored-by: Joe Woods <woods@fastmailteam.com>
2023-01-23 13:18:29 +11:00