Suggestion for improving edit/history API in the editor. #291
Labels
code-quality
Doesn't improve user experience, only makes the code better.
enhancement
New feature or request
proposal
In planning phase
Get rid of the extra scope created by the anonymous function that's currently used for glyph modifications, and instead just return a mutable reference to the glyph after calling begin mod and consume it in end mod.
This will help in a variety of ways:
Cleaner code, fewer indentations, less scopes.
No need to copy, clone, move data between the scopes.
More rusty.
There's also the potential of not having an endModification at all, and simply ending the edit when the token is dropped, but I don't think this is explicit enough. I'd argue that I'd rather have drop(glyphModification) panic at runtime unless editor.endModification() is called.
The text was updated successfully, but these errors were encountered: