This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
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.
The issue with the current KeyCommandsHandler, is that even if the key command is set to be false, the command is not really ignored and was stll being handled by the default function, which at the same time was not working properly with plain text mode since it forced an update in the model.
Also the usage of the enter() function was redundant also for the RTE mode, since we already handle the enter directly in the replaceText properly, and we are constraining the usage of the key commands only to the ones we have defined in the library not giving to the users of the library a proper control on which and when they should be and should enabled.
The alternative approach was to disabled the default handling in plain text mode for such commands, but this created two issues:
The current solution allows full control and customisation for the key commands while also providing the possibility of creating some default rapid key commands (like .enter) for the general use cases, while also fixing the shift+enter bug in plain text mode.