Closed danielsaidi closed 9 months ago
In the example above, commit 1a67ab796f2231a9d65d22fa65e34f4b6f895e49 makes the two functions reuse more functionality.
I think the library will eventually get rid of the attribute writer, or at least some of its functions. The component can't just use it as is, but also needs to modify the text storage, layout manager, etc. which means that the attribute writer functions aren't used by the library itself, and may therefore not work as intended.
I think it'd then be better to not have the writer at all.
There's currently a lot of duplicated code when it comes to setting attributes, styles, etc.
For instance, here's how the
RichTextAttributeWriter
andRichTextViewComponent
handles setting text style:In this case, you can also see ow the writer implementation actually accidentally omits strikethrough, which is a bug.
All this duplicated
setX
/setCurrentX
functionality is also complicated by the fact that some code actually HAS to differ, but having the duplications sure isn't nice.