Commit Graph

162 Commits

Author SHA1 Message Date
Ahmed M. Atia
96440b28ba
Add syntax highlighting support for C# (#55)
* feat: add syntax highlighting support for C#

* update README - add C# sysntac highlighting support

* restore original indentation / formatting

* Fix syntax error in Lezer grammar

* Fix language auto detection of C#

---------

Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
2023-12-24 10:59:24 +01:00
Jonatan Heyman
5d7af5031d Improve settings dialog
* Fix issue where it would overflow the viewport if using high enough zoom
* Some minor design improvements
2023-12-24 00:23:07 +01:00
Jonatan Heyman
bb9a39fe6e Fix bug where language auto detection will not trigger in some cases
E.g. if you pasted a piece of javascript, selected the whole block and deleted the text (which will change back the default language to Plaintext (auto)) and then paste the same javascript code again.
2023-12-24 00:13:17 +01:00
Jonatan Heyman
9ee25ab758 Tweak body background in light mode 2023-12-22 20:09:39 +01:00
Jonatan Heyman
1b4b22eb62 Set dark body background in dark mode to prevent white flicker when resizing 2023-12-22 20:07:42 +01:00
Jonatan Heyman
f8db397e0c Show keyboard shortcuts in status bar tooltips 2023-12-21 19:26:02 +01:00
Jonatan Heyman
6086976dc4 Update prettier version and fix formatting bug.
Prettier currently has a bug that causes it's formatWithCursor() to be extremely slow in some cases. In Heynote, whenever you pasted a large JSON chunk and auto formatted it, with the cursor at the beginning or the start of the block, this would trigger that bug. This commit introduces a work around by using format() if the cursor is at the beginning or the end of the block.

Update to latest version of Prettier.
2023-12-21 03:09:53 +01:00
Jonatan Heyman
198ce3066b Add global hotkey functionality 2023-12-10 22:59:42 +01:00
Jonatan Heyman
13afe62e11 Add global SASS include for all Vue components 2023-12-10 22:58:33 +01:00
Jonatan Heyman
a88f9cc49b Update dependency versions
Explicitly add "@codemirror/*" packages instead of relying on the "codemirror" sample package.
Update to newer versions for implicit dependencies in in package-lock.json.

This should fix errors in development mode on Windows.
2023-12-10 12:18:43 +01:00
Jonatan Heyman
cfb95540df Add selection size to status bar when there are selections 2023-12-08 00:28:26 +01:00
Jonatan Heyman
a5068c0913 Fix bug when pressing C-a in an empty block and then pasting text
Before this fix it would cause part of the block separator to be overwritten causing the block separation to break.
2023-12-07 19:07:35 +01:00
Jonatan Heyman
08a28d037e Remove unused imports 2023-12-07 18:55:41 +01:00
Jonatan Heyman
6e9195c835 Fix auto updating beta versions by setting autoUpdater.allowPrerelease instead of autoUpdater.channel 2023-12-07 00:42:53 +01:00
Jonatan Heyman
0c55dcecb0 Add release channels (Stable and Beta) 2023-12-06 13:31:47 +01:00
Jonatan Heyman
146937a78a Upgrade to latest versions of Codemirror and Lezer packages 2023-12-06 11:33:55 +01:00
Jonatan Heyman
6f53b61bb0 Use guesslang-js for language auto detection instead of Highlight.js
Should (hopefully) reduce false positives.
2023-12-06 02:52:51 +01:00
Jonatan Heyman
c049fc5f2a Fix cursor movement using Ctrl-left/right with Emacs key bindings in "mark mode" 2023-12-05 17:45:51 +01:00
Jonatan Heyman
6480d214ed Turn off auto completion 2023-07-12 00:26:28 +02:00
Jonatan Heyman
a415247e48 Support currency conversions with lower case currency codes
(except for the currency CUP since it clashes with the measurement unit "cup")
2023-07-04 14:12:17 +02:00
Jonatan Heyman
0c567384ee Refresh Math blocks when new exchange rates are loaded 2023-07-04 14:01:59 +02:00
Jonatan Heyman
a4e9ce6893 Add currency conversion support to Math blocks 2023-03-20 11:09:56 +01:00
Jonatan Heyman
4a042ca5da Fix so that links are clickable in Markdown mode.
Do not include closing parentheses in link regex.
2023-03-14 13:46:34 +01:00
Jonatan Heyman
1c78aca88a Add functionality for creating new cursors using Cmd/Ctrl + Alt + Up/Down 2023-03-13 17:22:27 +01:00
Jonatan Heyman
0bbdb262e6 Add Emacs set mark mode (C-Space) 2023-03-12 18:22:16 +01:00
Jonatan Heyman
1292c6ced3 Fix typo causing update icon to spin indefinitely in case of a network error 2023-03-12 11:25:02 +01:00
Jonatan Heyman
95e1a76eca Fix Ctrl + click on links in Windows 2023-03-08 13:56:24 +01:00
Jonatan Heyman
c3e0539601 Underline https:// and http:// links, and make C+Click open them 2023-03-08 13:07:58 +01:00
Jonatan Heyman
87a54443b9 Auto update fixes:
Fix rotated download icon bug
Fix bug where update icon could keep spinning forever if there was a network error when checking for updates.
2023-03-08 10:51:30 +01:00
Jonatan Heyman
6bc3e09826 Improve Markdown mode.
Replace [ ] and [x] with checkboxes in Markdown todo lists.
Add Markdown LanguageSupport extension in order to automatically add/remove new list items when pressing enter/backspace in a list in Markdown mode.
2023-03-07 22:32:50 +01:00
Jonatan Heyman
b26381164a Improve language auto detection
If content starts and ends with { & } or [ & ], we first try to parse is as JSON. If that succeeds, we'll assume it's JSON.

Increase the highlightjs relevance threshold. 

Hopefully this will result in fewer false positives that have been observed (e.g. for CSS and JSON).
2023-03-07 15:01:41 +01:00
Jonatan Heyman
ef5955feeb Fix seamless start/stop of update icon's spinning animation.
Bump version.
2023-03-07 02:24:08 +01:00
Jonatan Heyman
93bf1e9036 Improve auto update
Add titles to status bar buttons
Bump version to 1.0.7
2023-03-07 01:45:23 +01:00
Jonatan Heyman
1df255032c Check for updates once every 24 hours.
Bump version.
2023-03-06 10:24:23 +01:00
Jonatan Heyman
7ce91016d6 Add auto update support 2023-03-06 01:30:37 +01:00
Jonatan Heyman
4c44f32542 Use fixed notation for math result values when they are copied to clipboard 2023-03-04 15:46:08 +01:00
Jonatan Heyman
51b2be3740 Add copy to clipboard when clicking on a math result 2023-03-04 00:41:39 +01:00
Jonatan Heyman
facd782984 Set default font for input and button elements 2023-03-03 16:14:33 +01:00
Jonatan Heyman
84812e892c Pixel push: dim down search panel's close button 2023-03-03 16:02:01 +01:00
Jonatan Heyman
37d1984f1f Style search panel 2023-03-03 15:56:48 +01:00
Jonatan Heyman
e6a6561395 Prevent search and replace from changing block deklimiters 2023-03-03 15:55:50 +01:00
Jonatan Heyman
d59d8fd7e7 Pixel push: Increase box shadow for language selector in dark mode 2023-03-03 15:54:55 +01:00
Jonatan Heyman
17a52683e9 Fix so that C-a (select all) in empty blocks doesn't select the whole buffer on first press 2023-03-03 13:31:15 +01:00
Jonatan Heyman
4d98d9c861 Change so that Alt+Click adds new cursor (instead of C+Click) 2023-03-03 13:29:50 +01:00
Jonatan Heyman
85a5bc95a7 Change key binding for format code 2023-03-03 13:28:51 +01:00
Jonatan Heyman
03d0195eb3 Catch syntax errors when trying to format code 2023-03-03 13:28:18 +01:00
Jonatan Heyman
2c1e23c9f4 Use selection.head when instead of to/from when determining active block, and formatting code 2023-03-03 01:49:50 +01:00
Jonatan Heyman
e1fe26b881 Add format block button to status bar, when a supported block is active 2023-03-03 01:40:24 +01:00
Jonatan Heyman
f3c5a49fbf Add ability to format code for JSON, JS, CSS, HTML and Markdown blocks 2023-03-03 00:57:33 +01:00
Jonatan Heyman
3aa9e5d512 Override default highlighting style to remove ugly underline on heading tags 2023-03-03 00:56:06 +01:00
Jonatan Heyman
0d7c04991f Use slightly lighter text for math expression results 2023-03-02 23:20:14 +01:00
Jonatan Heyman
686dc77e78 Increase number of digits needed before shortening numbers such as 3.7e+9 2023-03-02 21:00:00 +01:00
Jonatan Heyman
4d12404d77 Add support for Math blocks 2023-03-02 18:40:44 +01:00
Jonatan Heyman
bd28472175 Fix so that status bar blocks have the full height of the status bar (visible when hovered) 2023-02-12 13:11:50 +01:00
Jonatan Heyman
5f98323586 Add setting for turning on/off line number gutters and fold gutters 2023-01-27 17:18:31 +01:00
Jonatan Heyman
1fe63860a8 Add more bindings to Emacs style keybindings 2023-01-27 14:36:24 +01:00
Jonatan Heyman
97d4f6294a Add ability to change Emacs meta key on Mac 2023-01-25 10:11:51 +01:00
Jonatan Heyman
83356275dd Simplify keymap definitions.
Bind Ctrl-Left/Right keys for Emacs keybinding.
2023-01-24 18:55:06 +01:00
Jonatan Heyman
b44b47991b Change getActiveNoteBlock and getNoteBlockFromPos so that they return a block even if the cursor is hidden within a separator. Shouldn't happen, but this should make it more robust. 2023-01-24 18:04:07 +01:00
Jonatan Heyman
428a3172ab When moving all lines from the last block upwards, make sure we don't create a block with empty block content (which will create an invalid syntax tree)
#windows-build
2023-01-24 16:34:31 +01:00
Jonatan Heyman
a5d47d81f6 Add commands for selecting next/previous block/paragraph 2023-01-24 16:16:54 +01:00
Jonatan Heyman
ed13baf4e4 Make the insertNewBlockAtCursor use the same block language/auto setting as the block that is being split 2023-01-23 17:38:36 +01:00
Jonatan Heyman
9987c01207 Fix issue where it was possible to create an invalid block syntax by moving lines 2023-01-22 14:28:28 +01:00
Jonatan Heyman
35f4bed7c1 Don't emit cursorChange if we have a valid line 2023-01-22 14:27:09 +01:00
Jonatan Heyman
305ec124ac Continuously render the debug syntax tree 2023-01-21 16:01:59 +01:00
Jonatan Heyman
99a6d0fcc7 Copy moveLineUp/moveLineDown command from Codemirror source into move-lines.js. Plan is to modify them to fix issue when moving the only line from a a single line block. When that happens it results in the following text data in the buffer:
∞∞∞text
∞∞∞text

And the separator needs a newline on both sides to be valid
2023-01-21 16:01:27 +01:00
Jonatan Heyman
4b4e113aa5 Att next/previous paragraph commands 2023-01-20 17:55:02 +01:00
Jonatan Heyman
924fd4b226 Replace block separators with "\n\n" when copying text.
Add Settings dialog.
Started implementing Emacs-like keymap.
2023-01-20 15:33:26 +01:00
Jonatan Heyman
6c1e89c5b0 Don't emit event if we did not get an active block (can happen with extremely large blocks, most likely because of slow syntax tree parsing) 2023-01-19 23:41:39 +01:00
Jonatan Heyman
aa628a4f08 Add new command for adding a new block after the current one, and moving the cursor to it. Change default Mod-Enter keybinding to use the new command, and added a new Mod-Shift-Enter keybinding to use the old command that inserts a new block separator at the cursor position (e.g. splits the current block).
#windows-build
2023-01-19 14:29:14 +01:00
Jonatan Heyman
1abefce1ec Fix broken Mod-L shortcut 2023-01-19 13:10:52 +01:00
Jonatan Heyman
b35e4840a4 Remove "optimization" because it can result in a outofbounds error 2023-01-19 13:08:56 +01:00
Jonatan Heyman
0d6d5daa40 Pixel push 2023-01-19 12:43:32 +01:00
Jonatan Heyman
221e42e30a Add ability to display the Lezer syntax tree for debugging 2023-01-19 12:29:23 +01:00
Jonatan Heyman
80febafd26 Small optimization of external noteContent parser 2023-01-19 11:31:49 +01:00
Jonatan Heyman
14152fbede Implement persistent buffer 2023-01-19 00:20:50 +01:00
Jonatan Heyman
c4e78a70ce Fix bug causing an endless loop with the lang auto detector continuously changing the language of the current block 2023-01-19 00:18:18 +01:00
Jonatan Heyman
335390d8e5 Update key binding help text 2023-01-18 21:36:48 +01:00
Jonatan Heyman
80feeed26c First block should not be have auto language 2023-01-17 01:25:07 +01:00
Jonatan Heyman
8d8f6cdcb3 Add support for Rust, XML and C++
Remove Lezer support
2023-01-16 23:43:22 +01:00
Jonatan Heyman
c3918c32c5 Don't use conflicting name "select" for language change event
#windows-build
2023-01-16 21:52:45 +01:00
Jonatan Heyman
996f5c131e Give back focus to editor when toggling themes 2023-01-16 21:31:52 +01:00
Jonatan Heyman
8214bf1bbb Add ability to change language using a language selector dialog 2023-01-16 21:30:30 +01:00
Jonatan Heyman
41573820ae Add CSS support
Add Language class and move language related settings into editor/language.js

In order to add an additional language now, one only has to add in to the LANGUAGES list, and add the token to heynote.grammar
2023-01-16 20:36:07 +01:00
Jonatan Heyman
4660f42460 Move App into components 2023-01-16 16:34:22 +01:00
Jonatan Heyman
0b34cc4dd3 Remove old test/template code 2023-01-16 16:32:48 +01:00
Jonatan Heyman
c8cc1cb5f1 Make moveLineUp and changeLanguageTo command respect state.readOnly 2023-01-16 15:33:05 +01:00
Jonatan Heyman
fc63ad1651 Add isMac, isWindows, isLinux to a global window.platform object in the renderer 2023-01-16 15:32:45 +01:00
Jonatan Heyman
818d7f0260 Add gotoNextBlock and gotoPreviousBlock commmands (keymapped to Mod-Up/Down) 2023-01-16 14:42:55 +01:00
Jonatan Heyman
7dc39ca6e4 Change selection and highlight colors of dark theme 2023-01-16 14:41:48 +01:00
Jonatan Heyman
f2bff13c6e Remove command for manually triggering language auto detection 2023-01-16 12:57:26 +01:00
Jonatan Heyman
15b86abf0f Rename note-block.js -> block.js 2023-01-16 12:55:39 +01:00
Jonatan Heyman
6a53168b05 Fix issue where auto detected language would not get emitted to the status bar immediately on language change, if the cursor wasn't changed at the same time 2023-01-16 11:12:54 +01:00
Jonatan Heyman
7a74798a11 Fix language auto detection/changing breaking undo/redo history 2023-01-16 11:11:28 +01:00
Jonatan Heyman
996d4338ce Use different initial content for development/release
#build
2023-01-15 20:24:31 +01:00
Jonatan Heyman
895bd4eccc Fix font path to (hopefully) work in release builds
#build
2023-01-15 20:06:57 +01:00
Jonatan Heyman
3b905951af Convert styles.css to SASS and include it by importing it in main.js.
Add fonts: Hack and Open Sans.
Change editor font to Hack.
2023-01-15 19:55:26 +01:00
Jonatan Heyman
7aab3874b0 Remove old unused files from template 2023-01-15 19:53:12 +01:00
Jonatan Heyman
249a6bbe11 Use CSS media query for dark mode specific CSS 2023-01-15 12:06:17 +01:00
Jonatan Heyman
2f842612fb Read dark/light mode from system, automatically listen for changes, and add button for toggling the mode to the status bar 2023-01-15 11:59:17 +01:00