feat: add keyboard shortcuts for notes, the note list and the app

This commit is contained in:
randogoth 2026-10-13 11:31:14 +03:00
parent ed2de5e67f
commit 722390ecec
9 changed files with 532 additions and 60 deletions

View file

@ -89,6 +89,22 @@ void main() {
});
});
group('toggleEmphasis', () {
test('wraps, unwraps and inserts empty pairs', () {
final bold = toggleEmphasis(_value('a word', 2, 6), '**');
expect(bold.text, 'a **word**');
expect(bold.selection, const TextSelection(baseOffset: 4, extentOffset: 8));
expect(toggleEmphasis(bold, '**').text, 'a word');
final boldItalic = toggleEmphasis(bold, '*');
expect(boldItalic.text, 'a ***word***');
expect(toggleEmphasis(boldItalic, '*').text, 'a **word**');
expect(toggleEmphasis(boldItalic, '**').text, 'a *word*');
expect(_marked(toggleEmphasis(_caret('x|'), '*')), 'x*|*');
});
});
group('highlightMarkdown', () {
test('line and inline syntax', () {
final classes = _classes(