PseudocodeEditor / editor

The codemirror 6 editor for CIE spec Pseudocode
https://editor.pseudonaja.app
21 stars 2 forks source link

Add Run Code shortcut #30

Closed DillonB07 closed 9 months ago

DillonB07 commented 9 months ago

This pull request adds a new shortcut to the code editor that allows users to run their code with a single key combination.

I've set the shortcut to be Control/Command + Enter.

For this, I had to addPrec.highest(). The shortcut I used is by default used to make a new line underneath your current one. This function increases the precedence of the custom keymap and overrides the default one.

There is one issue with this, which is that when you use the shortcut, your cursor gets set to the top of the file. Unfortunately, I was unable to find the cause of this or fix it.