-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better separation of Model from View. #241
Comments
So the proposed However, due to #152, and in providing the foundation for #222 to be implemented, if caret position and selection are stored in the Model, how would each View know what to display? Would the Model have a list that stores the caret positions and selection IndexRange of each StyledTextArea that displays the model, each of which is bound to its corresponding StyledTextArea property? |
|
Ah, ok that clarifies a lot. |
See my PR (#242) |
StyledTextArea
is aNode
and as such takes care of rendering the visual representation of a document. In other words,StyledTextArea
is the view. A big part of the model is represented byEditableStyledDocument
, which is independent of the view. However, some parts of the model currently leak intoStyledTextArea
; namely undo/redo, caret position and selection. As a result, for example, to test undo/redo, one needs to instantiate the view, even though undo/redo itself doesn't depend on the view.I propose to introduce a class (
StyledTextAreaModel
) to encapsulate the model.The text was updated successfully, but these errors were encountered: