heynote/electron
Florian Labarre d0d8f872a6
Add key bindings for inserting new blocks at the end/top of the buffer, as well as before the current block (#85)
* Add functionality to insert new block after the last block

- Update key bindings in `initial-content.ts` to include `Alt + Enter` for adding a new block after the last block.
- Implement `getLastNoteBlock` function in `block.js` to retrieve the last block in the note.
- Add `addNewBlockAfterLast` command in `commands.js` to handle the insertion of a new block after the last one.
- Integrate `addNewBlockAfterLast` command into the keymap in `keymap.js`.

* Add block insertion before/after current, before first and after last. Also, tests.

- Added `getFirstNoteBlock` in `block.js` for accessing the first text block.
- Implemented new functions in `commands.js` like `addNewBlockBeforeCurrent` and `addNewBlockBeforeFirst`.
- Updated `keymap.js` with new key bindings to facilitate block creation.
- Introduced `block-creation.spec.js` for testing the new block manipulation features.

* Fix visual bug when inserting new block at the top

* Update help text and Readme

* Fix wrong cursor position after inserting new blocks at the top of the buffer, when the previous first block's delimiter is long (e.g. Markdown)

* Make RegEx more generic

* Fix import

* Auto-generate the README.md and initial-content documentation

- Add a documentation generator
- Add an option to force the initial content to be erased with an env variable

* Add more specific tests

* Fix Mod key on Mac in test

---------

Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
2024-01-04 16:11:26 +01:00
..
main Add key bindings for inserting new blocks at the end/top of the buffer, as well as before the current block (#85) 2024-01-04 16:11:26 +01:00
preload Add Settings to web app (#125) 2024-01-04 14:27:04 +01:00
config.js CloseBrackets setting toggle (#102) 2024-01-04 14:52:41 +01:00
constants.ts Check for updates once every 24 hours. 2023-03-06 10:24:23 +01:00
detect-platform.ts Add key bindings for inserting new blocks at the end/top of the buffer, as well as before the current block (#85) 2024-01-04 16:11:26 +01:00
electron-env.d.ts Move contents of heynote-electron subdirectory into git repo root 2023-01-13 13:21:34 +01:00
initial-content.ts Add key bindings for inserting new blocks at the end/top of the buffer, as well as before the current block (#85) 2024-01-04 16:11:26 +01:00
keymap.js Add setting for turning on/off line number gutters and fold gutters 2023-01-27 17:18:31 +01:00