Add a limit of 100 lines to the code editor #6489
Draft
+569
−251
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6441
Changes
Summary
This PR changes the current behavior so that users receive immediate feedback while typing if a program exceeds the allowed length, instead of only getting an error after sending it to the server.
Current result after running program:
Bug in current approach
Currently you are allowed to type 101 lines whilst the error returns that only 100 are allowed.
Max line per level
It's now possible to set the max lines per level or range.
How to test
From level 1 to 9: It should not be possible to go over 100 lines in the code editor when typing.
From level 9 and above: It should not be possible to go over 200 lines in the code editor when typing.
Whenever the user tries to add a new line character the user should get an informative warning message: