Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift+Insert, Ctrl+Insert, and Ctrl+Delete shortcuts throw errors #338

Closed
1j01 opened this issue Mar 26, 2024 · 1 comment
Closed

Shift+Insert, Ctrl+Insert, and Ctrl+Delete shortcuts throw errors #338

1j01 opened this issue Mar 26, 2024 · 1 comment
Labels

Comments

@1j01
Copy link
Owner

1j01 commented Mar 26, 2024

Shift+Insert is meant to trigger Paste.

It's calling paste() with no arguments, but paste expects an image or canvas to be passed in, leading to this error:

TypeError: img_or_canvas is undefined

paste@https://jspaint.app/src/functions.js:1599:6
@https://jspaint.app/src/app.js:1124:4
dispatch@https://jspaint.app/lib/jquery-3.4.1.min.js:2:42571
add/v.handle@https://jspaint.app/lib/jquery-3.4.1.min.js:2:40572

Now, I'm not sure if paste previously referred to a different function or what, but man am I itching to set up typechecking!
There is also an edit_paste function in the repo... git log --all -p --reverse --source -S edit_paste reveals it was introduced in commit ad37213.

Ctrl+Insert is meant to trigger Copy.
It currently gives ReferenceError: copy is not defined
There is an edit_copy function defined. Probably these names need to be updated, but I want to do a little more investigating, to confirm that copy referred to a similar function, and what happened to it.

Ctrl+Delete is meant to trigger Cut.
It currently gives ReferenceError: cut is not defined, same story as Ctrl+Insert.

@1j01 1j01 added the bug label Mar 26, 2024
@1j01
Copy link
Owner Author

1j01 commented Apr 12, 2024

I have now added typechecking to the codebase with JSDoc + tsc so it will now highlight this as an error. Problems like this should be scarce in the future! Still need to investigate this though.

@1j01 1j01 closed this as completed in e3ef424 May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant