Commit Graph

5167 Commits

Author SHA1 Message Date
Nathan Sobo
b94576dc09 Pass view measurements to model via presenter
Someday, we won’t need to pass measurements to the model anymore.
2015-02-04 14:48:17 -07:00
Max Brunsfeld
d0757c87c8 Move selenium-webdriver dependency to build/package.json 2015-02-04 13:11:33 -08:00
Max Brunsfeld
c19d99e9e2 Add integration test for starting atom w/ different arguments 2015-02-04 12:59:26 -08:00
Nathan Sobo
3973939de1 Don’t constrain scrollTop/Left until required measurements are assigned
This commit also adds to the list of required measurements and updates
the spec with a buildPresenter helper to more easily supply default
values for required measurements in each spec when they aren’t relevant
to that spec’s content.
2015-02-04 11:13:24 -07:00
Nathan Sobo
b792190693 Constrain scrollLeft based on computed clientWith and scrollWidth 2015-02-04 10:22:29 -07:00
Nathan Sobo
1ae25ed85d Make randomized presenter spec failures easier to reproduce 2015-02-04 10:05:47 -07:00
Nathan Sobo
5bb3095ffa Constrain scrollTop based on clientHeight and scrollHeight 2015-02-04 09:38:00 -07:00
Nathan Sobo
3e6669cf3e Log code for repeatable randomized presenter spec failures 2015-02-04 08:42:06 -07:00
Nathan Sobo
ba6d11e24e Merge branch 'master' into ns-editor-presenters 2015-02-04 07:57:04 -07:00
Nathan Sobo
86991bbec2 Merge branch 'driskell-bugs/ident_guide_whitespace_only' 2015-02-03 21:26:25 -07:00
Nathan Sobo
973d7ebf13 Add spec coverage for indent guides + invisibles on blank lines 2015-02-03 21:26:01 -07:00
Kevin Sawicki
a4976c32ae Remove release notes from event payload
The release notes are provided by Squirrel on Mac but not by Squirrel for
Windows and the release notes package pulls them down manually anyway
so this field is no longer needed.

Checking for the presence of the release notes previously was preventing the
event from firing on Windows which would cause old release notes to show in
the package.

Closes #3757
2015-02-03 14:57:33 -08:00
Nathan Sobo
78b8039384 Don’t require sync update before measuring when autoHeight changes
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:45 -07:00
Nathan Sobo
cd77870286 In presenter, handle the first line being soft-wrapped
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:44 -07:00
Nathan Sobo
edd595a72f Access mouseWheelScreenRow property instead of calling removed method 2015-02-03 15:05:43 -07:00
Nathan Sobo
cf50ec1861 Fix action logging in random spec 2015-02-03 15:05:42 -07:00
Nathan Sobo
de5c1fc28d Add randomized fuzz test for TextEditorPresenter
This test performs random operations on the editor and assigns random
measurements from the view. After each operation, the state of a
pre-existing presenter is compared with that of a new presenter created
with the same parameters.

Since it’s easier to reason about building fresh state than it is to
reason about state updates, I hope this will catch any bugs in our
update logic as we optimize it and explore every corner case.
2015-02-03 15:05:33 -07:00
Nathan Sobo
510520d2c7 🎨 rename ::getStart/EndRow to ::computeStart/EndRow 2015-02-03 15:05:32 -07:00
Nathan Sobo
f005b2005f Add specs for updating scrollWidth when the longest line changes 2015-02-03 15:05:32 -07:00
Nathan Sobo
b521e8dc97 Handle auto-height in TextEditorPresenter 2015-02-03 15:05:32 -07:00
Nathan Sobo
bbc1a264b5 Make each section of presenter state self-contained
This means we have some duplicated values in different parts of the
tree, but it’s cleaner in the view since each component only consumes
a single object. Seems like the presenter should convey the correct
data to the correct locations and minimize the logic in the view. A
few duplicated integers is a reasonable trade-off.
2015-02-03 15:05:31 -07:00
Nathan Sobo
efdba9fc24 Use presenter state for scrollbars and scrollbar corner 2015-02-03 15:05:31 -07:00
Nathan Sobo
0910e86357 Add .right and .bottom to presenter scrollbar states 2015-02-03 15:05:31 -07:00
Nathan Sobo
14776e3f0a Give each scrollbar its own state object and track visibility 2015-02-03 15:05:30 -07:00
Nathan Sobo
42ab02d7d2 Rename ::clientHeight/Width to ::height and ::contentFrameWidth
The term “client” was actually a misnomer here because it typically
means the height excluding the scrollbars, which wasn’t how we were
using it here.
2015-02-03 15:05:30 -07:00
Nathan Sobo
1b5be9aef8 Track horizontal/vertical scrollbar height/width in presenter 2015-02-03 15:05:30 -07:00
Nathan Sobo
9de8ab949f Drop TextEditorComponent::getRenderedRowRange 2015-02-03 15:05:30 -07:00
Nathan Sobo
6108c04f40 Add spec coverage for deprecated ‘cursor:moved’ event
So we don’t accidentally drop it during this transition
2015-02-03 15:05:30 -07:00
Nathan Sobo
76241fb779 Handle line and line number preservation in presenter
The target of mousewheel events needs to be preserved when scrolling.
It used to be dealt with in the view, but now we can do it in the
presenter for a simpler view implementation.
2015-02-03 15:05:29 -07:00
Nathan Sobo
d9a5d141eb Clear ::mouseWheelScreenRow after delay even if we don’t actually scroll 2015-02-03 15:05:29 -07:00
Nathan Sobo
37a040a620 Preserve line numbers in presenter based on ::mouseWheelScreenRow 2015-02-03 15:05:29 -07:00
Nathan Sobo
35d3690088 Preserve lines in TextEditorPresenter based on ::mouseWheelScreenRow 2015-02-03 15:05:29 -07:00
Nathan Sobo
578a76ba6b Make “mouse wheel” 2 words in presenter API
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:28 -07:00
Nathan Sobo
da5ee3fa86 Add TextEditorPresenter::state.mousewheelScreenRow 2015-02-03 15:05:28 -07:00
Nathan Sobo
ac25596002 Wait for required measurements before building some presenter state
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:27 -07:00
Max Brunsfeld
9cc7ecb1be Add maxLineNumberDigits to presenter state 2015-02-03 15:05:27 -07:00
Max Brunsfeld
60fca8d8b2 Use presenter state for gutter background color
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-03 15:05:27 -07:00
Max Brunsfeld
fd4f28911d Use presenter state for placeholder text
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-03 15:05:27 -07:00
Nathan Sobo
f5fa3b837e Set content.indentGuidesVisible in presenter if editor is mini 2015-02-03 15:05:26 -07:00
Nathan Sobo
d4517b1ab0 Add TextEditorPresenter::state.scrollingVertically
This is used by the view to defer measuring new lines until we stop
scrolling.
2015-02-03 15:05:26 -07:00
Nathan Sobo
71a27de7ac Add TextEditorPresenter::state.content.backgroundColor 2015-02-03 15:05:25 -07:00
Nathan Sobo
e4c95d8ac3 Add overlay decorations to TextEditorPresenter::state 2015-02-03 15:05:25 -07:00
Nathan Sobo
c4b5a0f411 Honor the ‘onlyHead’ option for line and line-number decorations 2015-02-03 15:05:24 -07:00
Nathan Sobo
af8c38ad80 🎨 2015-02-03 15:05:24 -07:00
Nathan Sobo
0802b9bdd1 Don’t decorate soft-wrapped lines/line numbers unless spanned by marker 2015-02-03 15:05:24 -07:00
Nathan Sobo
20838accc1 Key line numbers by buffer row and soft-wrap count
…instead of an array. This will make things simpler to diff in the
view.
2015-02-03 15:05:24 -07:00
Max Brunsfeld
f218e985cf Update presenter scrollHeight when clientHeight changes
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-03 15:05:23 -07:00
Max Brunsfeld
33081cefda Move .lineNumbers onto .gutter property of presenter state
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-03 15:05:23 -07:00
Nathan Sobo
d26e8a2df1 Move vertical scroll state to root of presenter state object
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:23 -07:00
Nathan Sobo
1ff0b20cea Add ‘foldable’ to line number presenter state 2015-02-03 15:05:23 -07:00
Nathan Sobo
66c35d6e3e Reflect changes to line number decorations in presenter state
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -07:00
Nathan Sobo
970936f96d Start on TextEditorPresenter::state.lineNumbers
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -07:00
Nathan Sobo
49bf3bb14e Use presenter to render flashes
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -07:00
Nathan Sobo
8ebd057b0c Use presenter to render highlights
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -07:00
Nathan Sobo
2f526c59c5 Add highlights state to TextEditorPresenter
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:21 -07:00
Nathan Sobo
764139c25e Fix spec organization
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:21 -07:00
Nathan Sobo
3b93f3d71b Blink cursors based on presenter state
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:21 -07:00
Nathan Sobo
b412c2642d Add TextEditorPresenter::onDidUpdateState
And ensure observers are invoked whenever the state changes in spec.
2015-02-03 15:05:20 -07:00
Nathan Sobo
3c6c385ec8 Add TextEditorPresenter::state.content.blinkCursorsOff 2015-02-03 15:05:20 -07:00
Nathan Sobo
06b5eba17c Fix 0-width cursors in presenter instead of view 2015-02-03 15:05:20 -07:00
Nathan Sobo
c8b58761ba Add TextEditorPresenter::state.content.cursors 2015-02-03 15:05:20 -07:00
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
de0b5c4c62 Reorganize specs on TextEditorPresenter to mirror structure of state 2015-02-03 15:05:18 -07:00
Nathan Sobo
59b109654e Fix spec 2015-02-03 15:05:18 -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
5d8f831136 Instantiate presenter with minimal parameters in specs 2015-02-03 15:05:17 -07:00
Nathan Sobo
9c1efb6ba0 Simplify assertions 2015-02-03 15:05:17 -07:00
Nathan Sobo
568b9f6999 Add lineStateForScreenRow helper
The access pattern is pretty noisy in the specs
2015-02-03 15:05:16 -07:00
Nathan Sobo
06ef0792ce Add .decorationClasses to line state on initial render 2015-02-03 15:05:16 -07:00
Nathan Sobo
32a1854b7c Use TextEditorPresenter::state.content.indentGuidesVisible 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
a3fb8b3aaa Disable spec until presenter approach stabilizes 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
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
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
Kevin Sawicki
853ad9cee3 Re-throw stylesheet compile errors
This makes it consistent with other read errors. Previously a Notification
was returned in the error case causing errors downstream where the package's
stylesheets array was assumed to be a path/content tuple.

Closes atom/deprecation-cop#22
2015-02-02 17:55:36 -08:00
Max Brunsfeld
3739995ddb Merge pull request #5277 from atom/mb-package-json-services
Allow packages to specify services in their package.json files
2015-02-02 17:07:41 -08:00
Kevin Sawicki
f9f7cf6d34 Add more 6to5 specs 2015-02-02 13:29:20 -08:00
Kevin Sawicki
3b8b569d0c 🎨 2015-02-02 13:13:39 -08:00
Kevin Sawicki
8365ccb064 Merge pull request #5299 from bolinfest/6to5
Transpile all .js files beginning with the "use 6to5"; pragma with 6to5.
2015-02-02 13:11:33 -08:00
Max Brunsfeld
14969c0522 Avoid using private serviceHub in package manager test
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-02 10:01:56 -08:00
Max Brunsfeld
65f2ffa55e Rename service keys in package.json
* serviceProvisions -> providedServices
* serviceDependencies -> consumedServices

Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-02 10:01:50 -08:00