Commit Graph

15350 Commits

Author SHA1 Message Date
Matthew Dapena-Tretter
9663101671 Always add opened items to the workspace
This commit changes the behavior of `open()` so that the item will be
added to the workspace—even if the `activateItem` option is false.

This provides a way to open (and add) an item without activating it,
but removes the ability to open without adding. For that, we've made
the `createItemForURI()` method public 😊
2017-03-31 14:17:09 -07:00
Nathan Sobo
5557219fbc Merge pull request #14027 from atom/fb-mdt-save-focused-pane-item
Add `saveFocusedPaneItem()` and call it in "core:save" command
2017-03-31 13:57:50 -06:00
Matthew Dapena-Tretter
dec52a7384 Add atom.workspace.hide()
This adds an method for hiding items by URI and re-implements
`toggle()` in terms of it. (tbh it's really just extracting most of
`toggle()` into a new function.)
2017-03-30 17:37:55 -07:00
Max Brunsfeld
817467f0a8 Merge branch 'master' into fb-mdt-docks 2017-03-30 11:16:21 -07:00
Lee Dohm
6a76ef5dd6 Merge pull request #13764 from atom/wl-dont-soft-wrap-minis
Disable soft wrap on mini editors
2017-03-29 14:38:47 -07:00
Nathan Sobo
c7a4755808 If Workspace.open finds existing item, yield event loop
This ensures that the function always behaves asynchronously regardless
of the state of the workspace.

/cc @maxbrunsfeld

Signed-off-by: Antonio Scandurra <as-cii@github.com>
2017-03-29 09:27:21 -06:00
Matthew Dapena-Tretter
0d12396bf3 Add saveFocusedPaneItem() and call it in "core:save" command
Also, do the same for "core:save-as" and `saveFocusedPaneItemAs()`.
This behavior change means that pane items in docks (#13977) will be
savable too.
2017-03-28 14:05:29 -07:00
Nathan Sobo
45bd466384 Don’t add item in Workspace.open if activateItem is false
We thought it was a bug that activateItem: false caused the
item not to be added, but it turned out there were package
tests that depended on this behavior.

Ideally, we should have an addItem option that exhibits this
behavior instead.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2017-03-28 15:00:13 -06:00
Matthew Dapena-Tretter
08e8975a10 Always show the dock when an item is dropped into it
Previously, we were only showing it when going from 0 -> 1 items (which
is a bug).
2017-03-27 18:17:02 -07:00
Matthew Dapena-Tretter
3b23ab44bc Add getLocation() to PaneContainer class
This allows the location to be inspected without having to jump to the
DOM and searching for a dock element.
2017-03-27 17:45:21 -07:00
Matthew Dapena-Tretter
401a549bf5 Don't open items in disallowed locations 2017-03-27 17:45:21 -07:00
Matthew Dapena-Tretter
41953ae7d6 Only show dock toggle buttons when dragging if item is allowed 2017-03-27 17:45:15 -07:00
Matthew Dapena-Tretter
f3c3917825 Don't show the dock toggle button if it's closed and empty 2017-03-27 14:20:47 -07:00
Matthew Dapena-Tretter
13f0c8a977 Docks: define handle size in CSS; measure in JS 2017-03-27 12:19:08 -07:00
Michelle Tilley
1ff5c9e684 Merge pull request #13963 from atom/ku-mkt-restore-atom-env-when-adding-folder-to-fresh-window
Restore atom environment when adding project folders to a fresh window
2017-03-27 10:56:37 -07:00
Matthew Brener
11c06d44b8 Fix typo in comments of text-editor-registry.js 2017-03-26 19:46:43 +11:00
Max Brunsfeld
bc872143cc Avoid duplicate search for pane container in Workspace.open 2017-03-24 15:49:35 -07:00
Max Brunsfeld
4082b67fb0 Refactor Workspace.open
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-03-24 15:35:52 -07:00
Max Brunsfeld
93ba6109fa Create Dock element lazily to be compatible w/ snapshotting 2017-03-24 15:29:46 -07:00
Michelle Tilley
1651f0fd76 👕 2017-03-23 23:57:53 -07:00
Michelle Tilley
f657bd13c6 👕 2017-03-23 23:44:38 -07:00
Michelle Tilley
cc2cbfbb0a Emit event from AtomWindow when locations are loaded 2017-03-23 23:36:53 -07:00
Matthew Dapena-Tretter
52606171bf Add "location" param to open() 2017-03-23 18:50:40 -07:00
Matthew Dapena-Tretter
d9e1fcc70b Merge branch 'master' into HEAD
* master: (43 commits)
  If one arch fails, kill the other for perf on appveyor
  ⬆️ dalek@0.2.1
  Revert "⬆️ all packages that use atom-select-list"
  ⬆️ atom-keymap
  ⬆️ status-bar
  ⬆️ all packages that use atom-select-list
  ⬆️ language-ruby@0.71.0
  ⬆️ autocomplete-css@0.16.1
  Ensure `packagesCache` exists before accessing it
  🎨
  ⬆️ less-cache
  Use `core/` instead of `<embedded>` for keymaps loaded during snapshot
  Set also defaultSettings.core.projectHome when initializing Config
  Fix tests
  ⬆️ atom-keymap
  Replace CommandRegistry.addBundled with a boolean param in .add
  Delete unused build scripts
  🔥 Remove parserlib
  Resolve style sheets paths during `script/build` for bundled packages
  Don't use cached less sources and imported files in dev mode
  ...
2017-03-23 18:47:46 -07:00
Matthew Dapena-Tretter
77ea97e623 Use async/await in openItem() 2017-03-23 11:43:06 -07:00
Matthew Dapena-Tretter
3e826591fd Clean up storage of most recent location 2017-03-23 11:28:40 -07:00
Matthew Dapena-Tretter
791457d9a7 Add remaining pane container methods and documentation to docks 2017-03-23 11:24:41 -07:00
Matthew Dapena-Tretter
37a3c9b59c Measure toggle button size instead of hardcoding it 2017-03-23 11:24:41 -07:00
Matthew Dapena-Tretter
e01bc40a78 "affordance" -> "hoverMargin" 2017-03-23 11:24:41 -07:00
Matthew Dapena-Tretter
d307c791c4 Be consistent about what "location" refers to 2017-03-23 11:24:37 -07:00
Matthew Dapena-Tretter
3fcec8b8cd previousLocations -> itemLocationStore 2017-03-23 10:39:02 -07:00
Katrina Uychaco
4c1cb16e77 Merge remote-tracking branch 'origin/master' into ku-mkt-restore-atom-env-when-adding-folder-to-fresh-window 2017-03-22 20:36:59 -07:00
Michelle Tilley
d9b73fa645 Restore state when opening folders to applicable windows
Note: "clean window" is defined as 1) having an empty project and 2)
having no pane items or only empty unnamed buffers

When project is empty and there is saved state associated with the
opened/added folders...
* Open a file or folder (from command line or Open menu)
  * If we have a clean window, restore project state in window
  * If window is dirty, restore saved state in new window
2017-03-22 20:25:57 -07:00
Michelle Tilley
910fef97a0 Restore state when adding folders to applicable windows
Note: "clean window" is defined as 1) having an empty project and 2)
having no pane items or only empty unnamed buffers

Adding folder(s)
* If we have a clean window, restore project state in window
* If window is dirty, prompt user to
  * add folder to the existing window LOSING state
  * OR open project folder in a new window
2017-03-22 20:24:50 -07:00
Matthew Dapena-Tretter
cd62357f0f Mention dock getters in Dock docs 2017-03-20 22:39:28 -07:00
Matthew Dapena-Tretter
98e7fcc505 Prefer getElement() to view registry for Docks, PaneContainer & Pane 2017-03-20 22:39:23 -07:00
Max Brunsfeld
91780e6f18 Merge branch 'master' into fb-mdt-docks 2017-03-20 11:26:42 -07:00
Antonio Scandurra
2ce66a724c Ensure packagesCache exists before accessing it 2017-03-20 17:23:06 +01:00
Antonio Scandurra
e2637aac78 🎨 2017-03-20 10:20:36 +01:00
Antonio Scandurra
95cf200a7c Merge branch 'as-snapshot-atom-environment' into as-ns-optimize-stylesheets-loading
# Conflicts:
#	script/tdd
2017-03-20 10:06:57 +01:00
Antonio Scandurra
31692f6e6c Merge branch 'master' into as-snapshot-atom-environment 2017-03-20 09:58:15 +01:00
Antonio Scandurra
17611889d3 Use core/ instead of <embedded> for keymaps loaded during snapshot 2017-03-20 09:56:40 +01:00
Matthew Dapena-Tretter
d854a88dbb Add workspace.toggle() method 2017-03-18 15:32:01 -07:00
Matthew Dapena-Tretter
5b4f402278 Add toggle commands 2017-03-18 15:32:01 -07:00
Matthew Dapena-Tretter
5c7bd66896 Remember previous item locations 2017-03-18 15:32:01 -07:00
Matthew Dapena-Tretter
64e290b57f Make open() location aware 2017-03-18 15:32:01 -07:00
Matthew Dapena-Tretter
238ce1d8cd Make workspace inspection methods location-aware 2017-03-18 15:32:00 -07:00
Matthew Dapena-Tretter
a6424a795e Separate searching panes from creation 2017-03-18 15:32:00 -07:00
Matthew Dapena-Tretter
939ebb3ddf Add findRightmostSibling and findBottommostSibling methods 2017-03-18 15:32:00 -07:00
Matthew Dapena-Tretter
3ff830102f Serialize docks 2017-03-18 15:31:57 -07:00