Commit Graph

56 Commits

Author SHA1 Message Date
Ash Wilson
88d7c6dbdd Include now-missing project folders in initial state key computation 2019-01-24 11:33:44 -05:00
Ash Wilson
07dc40362f Flip conditional for clarity 2019-01-24 11:32:39 -05:00
Ash Wilson
02e1ae4b0f Notify about missing project folders 2019-01-24 10:39:50 -05:00
Ash Wilson
f6837d1f97 openLocations() flag to require a path to be an existing directory 2019-01-24 10:19:01 -05:00
Ash Wilson
b9bd3713ee Open an untitled buffer when pathToOpen is null or undefined 2019-01-17 08:15:06 -05:00
Ash Wilson
92785ac257 Merge branch 'master' into aw/single-file 2019-01-14 10:22:51 -05:00
Ash Wilson
d725f5e42b 👕 Now that I actually got my linter working 👀 2019-01-04 09:54:36 -05:00
Ash Wilson
6938a31329 Never open the parent directory of a file path 2019-01-03 16:39:09 -05:00
Winston Liu
aa8d3d6ee8 Fix typo in atom.confirm documentation
[ci skip]
2018-12-28 21:04:18 -05:00
Ash Wilson
b64dac8ea3 👕 2018-12-20 20:51:56 -05:00
Ash Wilson
01bd45ef4c When only a file is specified, don't open the parent directory 2018-12-20 15:59:41 -05:00
Jordan Eldredge
351b624487 Fix unloading serialization test 2018-08-27 10:24:04 -07:00
Jordan Eldredge
57e6927f2a Fix lint 2018-08-27 08:31:11 -07:00
Jordan Eldredge
a9e887976f Remove unload-aborted event
This edge case will be handled by https://github.com/atom/atom/pull/17873/
2018-08-23 16:11:20 -07:00
Jordan Eldredge
9895badff8 Avoid serialization race condition with slow package deactivation
If any package takes longer than one second (the
`saveStateDebounceInterval`) to deactivate, and the unload was triggered
by a key or mouse down, mouse event, you can end up in a situation where
sate is serialized _after_ the packages are deactivated.

The result in a bug where panes, such as the File Tree, will randomly
be closed when you reload or reopen Atom.

This can be reproduced by creating a package that has an artificially
slow `deactivate` method. With such a package enabled, every reload ends
up serializing a state where all panes are closed.

I'm a bit nervous about this exact fix, since we have to track every
place where it's possible for `prepare-to-unload` to be fired, without
the window actually closing.

I handled the only instance I saw, but the logic is complex enough, that
I'm not 100% confident there are not other instances.

If it did happen that `prepare-to-unload` was fired and some other logic
caused the window to not actually close, we could end up in a state
where mousedown/keydown events were no longer causing state to get
serialized.
2018-08-23 14:17:22 -07:00
David Wilson
cd83486c7d Fix isReleasedVersion check in AtomEnvironment 2018-06-28 14:29:09 -07:00
David Wilson
bd5d258d80 Detect any channel name in AtomEnvironment.getReleaseChannel 2018-06-28 12:53:14 -07:00
Ash Wilson
92f6ab599f Pass Config file path to ApplicationDelegate call 2018-03-27 08:56:29 -04:00
Philip Weiss
062dfdea80 address PR comments 2018-03-06 11:06:22 -08:00
Philip Weiss
faf0d78f3e remove console log 2018-03-01 21:00:24 -08:00
Philip Weiss
7ce5b000e4 address more of max's comments 2018-03-01 19:35:59 -08:00
Philip Weiss
48d3677664 update project api names 2018-02-26 15:45:56 -08:00
Philip Weiss
347d547d5f guard against edge cases 2018-02-24 17:58:46 -08:00
Philip Weiss
1483c0c96d add more data passed through with projectSettings 2018-02-24 17:50:18 -08:00
Philip Weiss
e2c480847c atom project open in their own windows and behave more sanely 2018-02-23 17:38:36 -08:00
Philip Weiss
bf6a4e3db4 add .atomProject files 2018-02-18 15:03:00 -08:00
Max Brunsfeld
1d20b8ee1d Start work on routing all config file IO through main process 2018-01-25 20:35:00 -08:00
Max Brunsfeld
744ae36f31 🔥 dead code
Signed-off-by: Nathan Sobo <nathan@github.com>
2018-01-19 11:56:25 -08:00
Max Brunsfeld
7c8f73b2d8 Make StorageFolder.clear async 2018-01-18 15:14:35 -08:00
Antonio Scandurra
a5c0223592 Fix race condition between opening new files and restoring window state
This commit fixes a race condition in the
`attemptRestoreProjectStateForPaths` function that could cause a file to
be opened more than once within the same workspace pane.

In particular, when opening some file into an empty window, Atom tries
to recover the state for the project containing the file (if there is
one). However, we were previously not waiting until the
`AtomEnvironment`'s state had been fully deserialized before trying to
load the requested file into the workspace. If the same file also
existed in the serialized representation of the workspace, it could end
up being opened twice.

With this commit we will now wait until the environment has been fully
deserialized before honoring the user's request of loading new files
into an empty window. Also, tests have been restructured to test more
thoroughly this interaction.
2018-01-10 13:22:09 +01:00
Antonio Scandurra
e85b8738d1 Allow destroying AtomEnvironment instances that haven't been initialized 2018-01-10 13:11:25 +01:00
Wliu
c84eeb3ae0 Merge branch 'master' into wl-async-save-dialog 2018-01-09 17:20:57 -05:00
Wliu
5c3d6abb12 Merge branch 'master' into wl-async-confirm 2018-01-07 21:08:32 -05:00
Wliu
b69631a444 Merge branch 'master' into wl-async-save-dialog 2018-01-07 20:55:16 -05:00
Max Brunsfeld
6f50f32116 Rename pathsToNotifyWhenClosed -> pathsWithWaitSessions 2018-01-05 17:50:11 -08:00
Max Brunsfeld
386b786d93 Let 'atom --wait -a folder' exit due to removing the project folder 2018-01-05 17:50:11 -08:00
Max Brunsfeld
1f4ccf3024 Allow existing windows to be reused when running --wait 2018-01-05 17:50:11 -08:00
Max Brunsfeld
75b4a7a984 ⬆️ joanna, put back AtomEnvironment public property docs 2018-01-04 12:12:43 -08:00
Antonio Scandurra
011766768a Fix AtomEnvironment tests 2017-12-22 12:05:03 +01:00
Segev Finer
5490a8b258 Initialize ProtocolHandlerInstaller after initializing Config
This allows it to correctly read `core.uriHandlerRegistration` and
avoids popping the notification even if set to 'never'.

Fixes #16201
2017-12-16 23:34:37 +02:00
Wliu
7f01a8e718 Add back and deprecate atom.showSaveDialogSync 2017-12-04 23:26:51 +01:00
Wliu
e889f9f5a6 Merge branch 'master' into wl-async-save-dialog 2017-12-04 23:07:19 +01:00
Wliu
3998556a0a Merge branch 'master' into wl-async-confirm 2017-12-04 22:49:12 +01:00
Max Brunsfeld
bffdeb461f Remove handling of old grammarOverridesByPath serialization key 2017-11-27 09:36:43 -08:00
Max Brunsfeld
93f5ab4780 Don't set TextEditor class's schedule in AtomEnvironment constructor
We construct multiple AtomEnvironment instances in the tests. I don't
know how the tests ever worked with this code in there.
2017-11-21 13:32:28 -08:00
Max Brunsfeld
a18848e569 👕 2017-11-20 17:10:21 -08:00
Max Brunsfeld
d52c4bc33b Serialize the grammar registry 2017-11-20 14:50:00 -08:00
Wliu
9f9ec92e9b Make showSaveDialog optionally async 2017-11-20 19:29:39 +01:00
Wliu
131c13db3e 🎨 2017-11-19 00:35:40 +01:00
Wliu
b881edac06 Convert attemptRestoreProjectStateForPaths 2017-11-18 01:45:19 +01:00