Commit Graph

7988 Commits

Author SHA1 Message Date
Antonio Scandurra
a7358477d9 Merge pull request #15240 from atom/as-manual-highlight-updates
Create, update and destroy highlights manually
2017-08-11 11:26:15 +02:00
Wliu
8963cf4955 Only use multiline if the flag is passed in 2017-08-10 13:24:46 -04:00
Antonio Scandurra
00d27befe8 Create, update and destroy highlights manually
Etch's reconciliation routine causes elements to be sometimes
re-ordered. In order to move an element, however, Etch needs to first
detach it from the DOM and then re-append it at the right location.

This behavior is unacceptable for highlight decorations because it could
re-start CSS animations on a certain highlight decoration when a
completely different one is added or removed.

Even though we are still interested in restructuring etch's
reconciliation logic to prevent unwanted re-orderings, with this commit
we are switching to a custom routine to create/update/remove highlight
decorations that prevents unnecessary moves and, as a result, fixes the
undesired behavior described above.
2017-08-10 17:48:34 +02:00
Wliu
95b216f234 Add multiline spec 2017-08-09 23:15:33 -04:00
Wliu
2088143a90 Fix specs 2017-08-09 12:43:35 -04:00
Ash Wilson
fb0e29cf07 Merge pull request #14853 from atom/aw-filewatcher
Filesystem watcher API
2017-08-08 14:04:39 -04:00
Jason Rudolph
47420761f5 Add basic test for TextEditorComponent::didPaste(event) 2017-08-07 11:32:57 -04:00
Jason Rudolph
c7bfbc181c 🐛 Fix atom/tabs#461
On Linux, when the user performs a middle-button mouse click, Chromium
fires both a mouse-down event *and* a paste event. This commit teaches
the TextEditorComponent to ignore the paste event.

When the user performs a middle-mouse click on a tab, we get close the
tab and attempt to prevent Chromium's default processing for the event.
[1] This prevents Chromium's default processing for the *mouse down*
event, but then Chromium also fires a *paste* event, and that event
pastes the clipboard's current content into the newly-focused text
editor. 🙀

Since Atom already has its own logic for handling pasting, we
shouldn't (🤞) need to handle browser paste events. By ignoring the
browser paste events on Linux, we fix atom/tabs#461.

[1]
ce1d92e0ab/lib/tab-bar-view.coffee (L416-L418)
2017-08-07 10:19:08 -04:00
Ash Wilson
6c608e88bc Merge remote-tracking branch 'origin/master' into aw-filewatcher 2017-08-05 10:14:32 -04:00
Jason Rudolph
50f02495c0 Attempt to fix flaky test re: flashing highlight decorations
Based on the assertion failures seen in
https://github.com/atom/atom/issues/15158#issue-247808059, it seems that
the flash for class 'c' sometimes ends before the flash for class 'd'
happens. Prior to this change, we only flashed class 'c' for 100ms, and
perhaps that isn't always enough time.

In this commit, we increase the flash duration from 100ms to 1000ms,
greatly increasing the likelihood that we're allowing enough time for
the flash on class 'd' to take place before the flash for class 'c'
ends. We also extract the scenario into its own test, so that 1) we can
more clearly explain the scenario that these assertions are testing and
2) future intermittent test failures will be easier to isolate.
2017-08-04 14:28:28 -04:00
Ash Wilson
dc9fe25255 Wrap temp.cleanupSync() calls in try-catch blocks 2017-08-04 14:18:43 -04:00
Ash Wilson
97ffe46247 Consistently use require('temp').track() 2017-08-04 14:08:29 -04:00
Ash Wilson
ea91723b36 Only deal with watcher stopping in the onDidChangeFiles spec 2017-08-04 10:37:41 -04:00
Ash Wilson
3b57d2a259 Let's see if we're still green without diagnostics! 2017-08-03 20:29:01 -04:00
Ash Wilson
dc9cb76fa4 tfw your diagnostic tests don't even run because of a linter error 2017-08-03 19:07:52 -04:00
Ash Wilson
7b61d4f62f Log a few more things 2017-08-03 18:21:24 -04:00
Ash Wilson
a84694fac1 Stop watchers in an afterEach block 2017-08-03 18:21:11 -04:00
Ash Wilson
095f6da379 Default to the appveyor home dir 2017-08-03 18:15:39 -04:00
Jason Rudolph
15a055b6cd Revert some of the changes from 29810c6cd1
xref: https://github.com/atom/atom/pull/15154#discussion_r131270263
2017-08-03 17:57:13 -04:00
Ash Wilson
94c91c57b1 Explicitly put the logfile in ${HOME} 2017-08-03 15:32:18 -04:00
Ash Wilson
bb91bb58e5 Okay fine let's do this the dumb way 2017-08-03 14:30:40 -04:00
Ash Wilson
263adde377 Use async cleanup to avoid ENOTEMPTY on Windows 2017-08-03 14:22:54 -04:00
Ash Wilson
dedf5193cd Does stderr work there... ? 2017-08-03 13:11:09 -04:00
Jason Rudolph
29810c6cd1 Attempt to fix flaky test re: blinking cursor
As shown in #15122, this test sometimes fails in CI with the following
error:

  TextEditorComponent
    rendering
      it blinks cursors when the editor is focused and the cursors are not moving
        Expected '0' to be '1'.
          at it (C:\projects\atom\spec\text-editor-component-spec.js:414:49)
        Expected '0' to be '1'.
          at it (C:\projects\atom\spec\text-editor-component-spec.js:415:49)

I *think* this might be a case of overspecification in the test's
assertions. Prior to this commit, the test expected the blinking cursor
to *start* in the visible state, and then transition to the invisible
state. When we see the failure above, I suspect that the cursor has
already transitioned from the visible state to the invisible state by
the time the assertion runs.

Since the test aims to verify that the cursor blinks, it seems like we
should focus on the blinking, and not worry about the *initial* state of
the cursor. This commit removes the assertions that verify the initial
state of the cursor, and instead asserts that the cursor toggles between
the visible and the invisible state.
2017-08-03 12:25:01 -04:00
Ash Wilson
3deb26b6a0 console.log debugging 2017-08-03 11:52:15 -04:00
Ash Wilson
3e3ab73748 Use distinct names for spec directories 2017-08-03 07:48:22 -07:00
Jason Rudolph
7d6bd2a6b1 Merge pull request #15147 from atom/ns-jr-fix-gutter-decoration-dimensions
Ensure custom gutter decoration elements fill their container
2017-08-03 10:11:04 -04:00
Ash Wilson
b6a3c5c6d2 Consistently split paths in test cases 2017-08-03 08:51:44 -04:00
Ash Wilson
4cf519f2d7 Merge branch 'master' into aw-filewatcher 2017-08-03 08:37:40 -04:00
Nathan Sobo
1584189962 Ensure custom decoration elements fill their container 2017-08-02 20:34:18 -06:00
Ash Wilson
e90441303d 🔥 console.logs 2017-08-02 19:34:44 -04:00
Ash Wilson
1e739aa891 Prepend a drive root to lookup paths on Windows 2017-08-02 14:55:12 -04:00
Ash Wilson
b9080bcec5 Don't use "path" as a variable name 2017-08-02 12:59:38 -04:00
Ash Wilson
c7a47a9e89 Use module.exports to not break Joanna horribly 2017-08-01 16:40:54 -04:00
Ash Wilson
00346614a0 Spec for onDidChangeFiles 2017-08-01 15:58:38 -04:00
Ash Wilson
67a8ba2a04 Adjust specs for the changed event shape 2017-08-01 15:08:07 -04:00
Ash Wilson
53ea430019 Update spec name 2017-08-01 15:08:07 -04:00
Ash Wilson
3fab3fed36 Consistent path handling in specs 2017-08-01 15:08:07 -04:00
Ash Wilson
3c967b07ef Use a cross-platform way to generate absolute paths for specs 2017-08-01 15:08:07 -04:00
Ash Wilson
9c874c921e Use the watchPath API in specs 2017-08-01 15:08:07 -04:00
Ash Wilson
99d6f911cf Rename the filesystem-manager-spec too 2017-08-01 15:08:06 -04:00
Ash Wilson
6cc3e4b6d2 Test case for consolidating child watchers during split 2017-08-01 15:08:06 -04:00
Ash Wilson
0c5674a56c Split subtrees into child watchers on parent watcher removal 2017-08-01 15:08:06 -04:00
Ash Wilson
a5f217fd51 WIP work on rewatching child directories 2017-08-01 15:08:05 -04:00
Ash Wilson
60e6da9097 Weird-ass concurrent mkdir() error 2017-08-01 15:08:05 -04:00
Ash Wilson
f75aa1ae03 Use onWillStop() instead of onDidStop()
This will prevent new Watchers from attaching to NativeWatchers that are
in the process of stopping.
2017-08-01 15:08:05 -04:00
Ash Wilson
b34a9d6972 Only resolve the waitForChanges promise once 2017-08-01 15:08:05 -04:00
Ash Wilson
6d17fc880d Opportunistic native watcher stopping 2017-08-01 15:08:05 -04:00
Ash Wilson
9c8ed35b26 Provide native watcher creation function to the NativeWatcherRegistry constructor 2017-08-01 15:08:05 -04:00
Ash Wilson
6e6c0a5ef9 Use getStartPromise() in specs 2017-08-01 15:08:05 -04:00