julianpoemp/ngx-codejar

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

Closed this issue · 5 comments

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

Hi @Abneco,

sorry for the late response and happy new year!

I'm sorry, but redo/undo seems not to work in CodeJar (see antonmedv/codejar#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.

@Abneco I created an PR that fixes the undo/redo issue in CodeJar: antonmedv/codejar#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.

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

@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

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