-
Notifications
You must be signed in to change notification settings - Fork 7
I/5862: Disable text transformations inside code blocks #222
Conversation
…ed methods and disable the plugin while typing in Code Block
Looking at what we have already and what is easiest to use
I don't think so - they don't know about each other and shouldn't know. The name 🤔 Another name that I could think of is TL;DR:
|
What do you think about not exporting this to a mixin but rather keeping duplicated in the base |
Cause: "Duplication is better than the wrong abstraction". |
Also, @panr mentioned that the implementation of this functionality differs slightly between commands and plugins (no refresh() in plugins) which is exactly the reason why it may be easier to duplicate the code. |
Actually, it makes more sense as you mentioned. Do we want an interface for this? Probably we do as I remember the usage of this. Both Plugin and Command would implement the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we could go a bit further and make TextWatcher
disablable. At this stage I don't think we need to implement the TextWatcher.forceDisabled()
et all - just simple listener to isEnabled
property.
…n unnecessary test for checking watchers after initialization
…'s state to the state of the TextTransformation plugin
There's a little commit madness. Should I squash some of them? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only small changes needed:
- The
EmitterMixin
is not needed. - The
isEnabled
property needs documentation.
ps.: I've also tested how the removing listeners could work and as it didn't break the test I've added this to your PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Suggested merge commit message (convention)
Fix: Disabled text transformation inside code blocks. Closes ckeditor/ckeditor5#5862.