Commit Graph

28 Commits

Author SHA1 Message Date
Nathan Sobo
f479e9d029 Add ::state.content.scrollTop/Left to TextEditorPresenter 2015-02-03 15:05:19 -07:00
Nathan Sobo
2c5888e25a Add ::state.content.scrollHeight to TextEditorPresenter 2015-02-03 15:05:19 -07:00
Nathan Sobo
fe5ee524a8 Show/hide line decorations when TextEditor::mini changes 2015-02-03 15:05:18 -07:00
Nathan Sobo
9a496e62cb Don’t apply line decorations to mini editors 2015-02-03 15:05:18 -07:00
Nathan Sobo
a513cf260c Don’t apply line decorations to last line if it ends at column 0 2015-02-03 15:05:17 -07:00
Nathan Sobo
62a1210604 Honor the ‘onlyEmpty’ and ‘onlyNonEmpty’ line decoration options 2015-02-03 15:05:17 -07:00
Nathan Sobo
773482467e Handle updates to line decorations in TextEditorPresenter
This isn’t a super efficient approach, but it is simple and should be
correct. Once we move all state to the presenter we can perform a more
efficient synchronous update when markers change.
2015-02-03 15:05:17 -07:00
Nathan Sobo
06ef0792ce Add .decorationClasses to line state on initial render 2015-02-03 15:05:16 -07:00
Nathan Sobo
590391a0ce Update .content.indentGuidesVisible when editor’s grammar changes 2015-02-03 15:05:15 -07:00
Nathan Sobo
d0b52538b2 Add content.indentGuidesVisible to TextEditorPresenter::state 2015-02-03 15:05:15 -07:00
Nathan Sobo
0a9f7586ae Add top-level .content object to presenter state
It contains the .scrollWidth and then all the lines in a nested .lines
object. The .width has been removed from each line and replaced with
.content.scrollWidth.
2015-02-03 15:05:15 -07:00
Nathan Sobo
115d764725 Handle scoped character widths in TextEditorPresenter
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:14 -07:00
Nathan Sobo
9e6aa8f873 Include more fields in line state 2015-02-03 15:05:14 -07:00
Nathan Sobo
e2693da225 Fix endRow calculation 2015-02-03 15:05:14 -07:00
Nathan Sobo
9a070e7f6d Include endOfLineInvisibles in presenter state 2015-02-03 15:05:14 -07:00
Nathan Sobo
db5059626f Use getters in TextEditorPresenter internally for consistency
::clientHeight is conditionally computed in the getter, so lets use them
everywhere for consistency.
2015-02-03 15:05:13 -07:00
Nathan Sobo
7095ccd32b Make all lines visible if no external client height is assigned 2015-02-03 15:05:13 -07:00
Nathan Sobo
ac463143dd Add 1 pixel to scrollWidth to account for cursor if not soft-wrapped 2015-02-03 15:05:13 -07:00
Nathan Sobo
2296d2d378 Account for overdrawMargin of startRow when computing the endRow 2015-02-03 15:05:13 -07:00
Nathan Sobo
143183aa25 🎨 2015-02-03 15:05:13 -07:00
Nathan Sobo
0f4bcac8d4 Add 1 to the last row to ensure it’s visible 2015-02-03 15:05:12 -07:00
Nathan Sobo
b09b54800f Include line text in presenter state 2015-02-03 15:05:12 -07:00
Nathan Sobo
f4d8ef8315 Add width to lines state based on the computed scrollWidth
This is based on the ::baseCharacterWidth property for now. To be fully
correct, we need to base the scrollWidth on the actual width of
individual characters.
2015-02-03 15:05:12 -07:00
Nathan Sobo
a1c2e1bb66 Update TextEditorPresenter when the editor’s content changes 2015-02-03 15:05:12 -07:00
Nathan Sobo
5a2bbc945b Handle changing ::lineHeight in TextEditorPresenter 2015-02-03 15:05:12 -07:00
Nathan Sobo
9c2ed478cd Handle changing ::clientHeight in TextEditorPresenter 2015-02-03 15:05:11 -07:00
Nathan Sobo
880e1ce1f0 Handle changing ::scrollTop in TextEditorPresenter 2015-02-03 15:05:11 -07:00
Nathan Sobo
f0920bf63b Start on TextEditorPresenter with lines state 2015-02-03 15:05:11 -07:00