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

Compiled code and input can get out of sync when quickly typing #1

Closed
bjorn3 opened this issue Jun 16, 2024 · 2 comments
Closed

Compiled code and input can get out of sync when quickly typing #1

bjorn3 opened this issue Jun 16, 2024 · 2 comments

Comments

@bjorn3
Copy link

bjorn3 commented Jun 16, 2024

For example if you enter

let a = 123459075670950985750895769789057u128;
let b = a+1;
println!("{b}");

and then place the cursor right between u and 128 and quickly press backspace and u, it will ignore the u and show.

error: literal out of range for `i32`
 --> main.rs:2:9
  |
2 | let a = 123459075670950985750895769789057128;
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: the literal `123459075670950985750895769789057128` does not fit into the type `i32` whose range is `-2147483648..=2147483647`
  = help: consider using the type `i128` instead
  = note: `#[deny(overflowing_literals)]` on by default

-1323120535
@LyonSyonII
Copy link
Owner

LyonSyonII commented Jun 16, 2024

At the moment it's intentional.
This is caused by a check that ensures that executions can't be queued, to avoid big queues caused by quick typing.

I can increase the length of the queue, but then the experience for code that takes a long time will be weird (changes will not be reflected until much later).

Edit: I've just thought of a solution, to check if the input when the code was submitted is different than the current one, and run again if it's the case.

LyonSyonII added a commit that referenced this issue Jun 16, 2024
@bjorn3
Copy link
Author

bjorn3 commented Jun 16, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants