julianpoemp / ngx-codejar

Angular wrapper for CodeJar code-editor. With this you can easily add code editors to your Angular app.
https://julianpoemp.github.io/ngx-codejar/
MIT License
8 stars 1 forks source link

Ctrl + Z and Ctrl + Y shortcuts not working in CodeJar #1

Closed Abneco closed 1 year ago

Abneco commented 1 year ago

Hello

I am currently using CodeJar for a project and I am having trouble getting the "Supports undo/redo" feature to work. No matter how many times I try the Ctrl + Z and Ctrl + Y keyboard shortcuts, the actions I take in the code editor are not being undone or redone.

Could you please provide me with some guidance on how to troubleshoot this issue? I would really appreciate any help you can offer.

Best regards, Abneco

julianpoemp commented 1 year ago

Hi @Abneco,

sorry for the late response and happy new year!

I'm sorry, but redo/undo seems not to work in CodeJar (see https://github.com/antonmedv/codejar/issues/79).

You could try to implement redo/undo for yourself (two arrays (one for redo, one for undo), add items to undo stack on keyup and paste, retrieve item either from undo/redo stack if a shortcut is triggered).

I'm thinking about fixing this issue in ngx-codejar because the CodeJar project itself seems not to be updated in time.

julianpoemp commented 1 year ago

@Abneco I created an PR that fixes the undo/redo issue in CodeJar: https://github.com/antonmedv/codejar/pull/91 As soon as this is merged and published it should also work in ngx-codejar. Undo shortcut is CTRL + Z and redo CTRL + SHIFT + Z.

Abneco commented 1 year ago

Hello, Thank you for your work on solving the undo/redo problem in CodeJar. I'm testing this as soon as it comes out. thanks again

julianpoemp commented 1 year ago

@Abneco I uploaded my fix for the redo/undo issue to a temporary Github repository. That way we don't have to wait any more until this issue is fixed in the main repository. You can install it easily:

npm install --save julianpoemp/codejar-fixed-redo-undo --legacy-peer-deps

Repository: https://github.com/julianpoemp/codejar-fixed-redo-undo

julianpoemp commented 1 year ago

@Abneco redo/undo issue is officially fixed 🎉. Please install the latest version of codejar.