Commit Graph

7936 Commits

Author SHA1 Message Date
Max Brunsfeld
8f106d2d44 Don't serialize undo/redo stacks when the user is idle 2017-06-07 11:21:39 -07:00
Jason Rudolph
296e407284 Check an item's allowed locations when moving/copying to pane 2017-06-07 12:59:54 -04:00
Max Brunsfeld
3b56ef8cbf Merge remote-tracking branch 'origin/master' into mb-use-native-text-buffer 2017-06-06 17:12:34 -07:00
Jason Rudolph
4fecbaf4f5 Merge master into jr-fix-observe-text-editor-methods 2017-06-06 13:59:35 -04:00
Jason Rudolph
268f94b89d Merge pull request #14695 from atom/jr-editors-live-in-workspace-center
Provide API for observing the active text editor
2017-06-06 10:09:52 -04:00
Jason Rudolph
5c5fb28da1 Add test for getVisiblePaneContainers() 2017-06-05 17:44:41 -04:00
Jason Rudolph
110bd6a16e Add test for Workspace::getVisiblePanes() 2017-06-05 17:29:46 -04:00
Jason Rudolph
0cadf7e888 Merge branch 'jr-editors-live-in-workspace-center' into jr-fix-observe-text-editor-methods 2017-06-05 17:07:31 -04:00
Jason Rudolph
2347c9bdaa Always invoke callback with current active text editor
This makes observeActiveTextEditor consistent with observers like
observeActivePaneItem, which always invoke the callback with the current
value, regardless of whether that value is undefined or not.
2017-06-02 15:55:00 -04:00
Jason Rudolph
44a2be7c9d Test deserialization in terms of user-observable functionality
- Rework serialization/deserialization test
- Move simulateReload function so that it can be used in multiple
describe blocks
2017-06-02 15:30:53 -04:00
Max Brunsfeld
a7736b81e3 Remove code for preserving cursor position on buffer reload
Updating the markers correctly is handled by TextBuffer. This
was actually breaking it.
2017-06-02 09:58:57 -07:00
Jason Rudolph
5b61c0a949 🐛 Initialize active editor state correctly after reload
Fixes the following bug:

1. Open Atom
2. Open a file
3. Observe the file's encoding in the status bar
4. Reload Atom
5. Close the file
6. Observe that the closed file's encoding is still present in the
status bar

This bug occured because the reload did not deserialize/serialze the
workspace's active text editor state. As a result, when closing the
text editor in step 5, we failed to notify observers that there is no
longer an active text editor.
2017-06-02 08:01:42 -04:00
Max Brunsfeld
021f934ccd Fix Pane.close test 2017-06-01 15:48:08 -07:00
Max Brunsfeld
307d63e1ed Fix handling of aborted save in Pane.saveItem 2017-06-01 15:10:09 -07:00
Max Brunsfeld
7535a9419f Use async/await in Pane spec 2017-06-01 14:42:45 -07:00
Jason Rudolph
f8ebd71200 Deprecate Dock::getActiveTextEditor() 2017-06-01 15:24:50 -04:00
Max Brunsfeld
16b1d7359f Convert pane spec to JS 2017-06-01 11:42:18 -07:00
Max Brunsfeld
12d0de0e03 Merge branch 'master' into mb-use-native-text-buffer 2017-06-01 11:09:09 -07:00
Antonio Scandurra
6d1f8ea88c Render line number gutter without numbers when showLineNumbers is false
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-06-01 16:29:04 +02:00
Jason Rudolph
16e1ef917b Update Workspace specs regarding editors in docks 2017-06-01 09:34:56 -04:00
Nathan Sobo
2372227b00 Fix specs on macOS when "Show scroll bars" option isn't "always" 2017-06-01 12:01:11 +02:00
Max Brunsfeld
dc320181fc Fix handling of .save and .saveAs rejections
* Make Pane.close, Pane.saveActiveItem, and Pane.saveActiveItemAs async.
* Refactor the logic for prompting to save on window unload
2017-05-31 17:46:04 -07:00
Jason Rudolph
05efc143ed Add Workspace::observeActiveTextEditor() 2017-05-31 16:17:54 -04:00
Jason Rudolph
cf50625cc6 Teach Workspace::getActiveTextEditor() to get item from center 2017-05-31 14:32:20 -04:00
Wliu
16be073c91 Merge branch 'master' into wl-build-on-node-7 2017-05-30 15:40:02 -04:00
Max Brunsfeld
d4c05e5956 Merge branch 'master' into mb-use-native-text-buffer 2017-05-30 10:25:54 -07:00
Jason Rudolph
a49203504c 🐛 Add missing onDidAddTextEditor method to WorkspaceCenter
WorkspaceCenter's observeTextEditors method calls
this.onDidAddTextEditor, but WorkspaceCenter didn't have an
onDidAddTextEditor method. This commit adds a test for
observeTextEditors and it adds the missing onDidAddTextEditor method to
make the test pass.
2017-05-25 17:24:07 -04:00
Jason Rudolph
92d0f60e6c 🐛 Add missing onDidAddTextEditor method to Dock
Dock's observeTextEditors() method calls this.onDidAddTextEditor(), but
Dock didn't have an onDidAddTextEditor method. 🙀

Dock's observeTextEditors() method also calls this.getTextEditors(), and
Dock's getTextEditors() method calls
this.paneContainer.getTextEditors(), but there is no getTextEditors()
method on this.paneContainer. 🙈

This commit adds a test for observeTextEditors, and it adds the missing
onDidAddTextEditor method, and it fixes the getTextEditors method to
make the new test pass.
2017-05-25 17:24:06 -04:00
Jason Rudolph
e3c612b261 🔥 Remove unnecessary require 2017-05-25 09:02:32 -04:00
Jason Rudolph
1dfdd84393 Add ability to move directionally across *all* visible panes
Prior to this change, the following commands successfully move between
panes in the workspace center, but they could not move between the the
panes in the workspace center and panes in the docks:

- window:focus-pane-above
- window:focus-pane-below
- window:focus-pane-on-left
- window:focus-pane-on-right
- window:move-active-item-to-pane-above
- window:move-active-item-to-pane-below
- window:move-active-item-to-pane-on-left
- window:move-active-item-to-pane-on-right
- window:copy-active-item-to-pane-above
- window:copy-active-item-to-pane-below
- window:copy-active-item-to-pane-on-left
- window:copy-active-item-to-pane-on-right

This commit updates these commands to work across all visible panes,
regardless of whether the pane is in the workspace center or a dock.

Summary of approach:

- Add tests for the `nearestVisiblePaneInDirection`, which provides the
  core logic for the higher-level methods like `focusPaneViewAbove`,
  `moveActiveItemToPaneAbove`, `focusPaneViewOnLeft`, etc.
    - Test the generic logic extensively (i.e., the logic that is
      independent of whether the given pane resides in the workspace
      center or a dock)
    - Also test the navigation between docks and the workspace center
- Since the core logic is tested in the new tests above, simplify the
  tests for the higher-level methods (e.g., `focusPaneViewAbove`,
  `moveActiveItemToPaneAbove`, `focusPaneViewOnLeft`) to avoid
  unnecessary duplication.
- Add `nearestVisiblePaneInDirection` to `WorkspaceElement`, implemented
  in terms of the existing `nearestPaneInDirection` method on
  `PaneContainerElement` for now.
2017-05-24 17:30:15 -04:00
Ian Olsen
d5089936bd Merge pull request #14420 from atom/fb-mdt-dock-items-dont-cause-restore-state-prompt
Don't show restore dialog for non-editor dock items
2017-05-24 08:43:35 -07:00
Ian Olsen
ddcf5460ed Merge pull request #14427 from atom/fb-hw-url-fix2
Fix the atom:// URL handler for real (with tests this time)
2017-05-24 08:41:43 -07:00
Max Brunsfeld
2c2d00a403 Don't create duplicate buffers if a path is opened twice concurrently 2017-05-23 07:27:56 -07:00
Max Brunsfeld
41ddb2c873 Wait for save to complete in pending state spec 2017-05-22 22:09:27 -07:00
Jason Rudolph
bee12af4c1 Move directional pane movement specs up to WorkspaceElement
In preparation for providing directional pane navigation that goes
beyond the currently-active pane container, this commit:

- Moves the existing directional pane movement specs out of the
PaneContainerElement specs and into the WorkspaceElement specs
- Adjusts the specs to perform all set-up in terms of the workspace, as
opposed to manually constructing a PaneContainer.
2017-05-22 10:19:18 -04:00
Jason Rudolph
efa440f705 Merge pull request #14460 from atom/jr-activate-next-or-previous-pane-in-dock
Fix ability to activate next/previous pane in a dock
2017-05-22 10:03:26 -04:00
Max Brunsfeld
eef2bf0801 Avoiding writing to fixture files in Workspace.replace tests 2017-05-20 23:35:48 -07:00
Max Brunsfeld
6c0b70f5f3 Start work on integrating new native TextBuffer version 2017-05-19 11:33:49 -07:00
Jason Rudolph
3020a61e34 Test activating next/previous pane at the workspace level 2017-05-19 10:49:51 -04:00
Jason Rudolph
8079b51839 Remove unnecessary test setup
H/T @nathansobo
2017-05-19 09:33:06 -04:00
Antonio Scandurra
d158e44374 Merge branch 'master' into tj-upgrade-electron 2017-05-19 11:05:15 +02:00
Max Brunsfeld
e99545ee41 Fix exception when starting to drag text 2017-05-18 10:13:48 -07:00
Jason Rudolph
d599b52d36 Add failing tests for #14442 2017-05-17 15:26:42 -04:00
hansonw
e8cd4bf431 Fix the atom:// URL handler for real (with tests this time) 2017-05-16 11:51:54 -07:00
Antonio Scandurra
d44876f3bc Merge branch 'master' into tj-upgrade-electron 2017-05-16 14:39:47 +02:00
Antonio Scandurra
3b3505d969 Always allow to destroy free-form folds from the gutter 2017-05-16 14:36:50 +02:00
Antonio Scandurra
ad6202cadb Show foldable icon on the last screen row belonging to a buffer row 2017-05-16 14:26:57 +02:00
Antonio Scandurra
4c5127ca2f Update foldable icon when a row's foldability changes 2017-05-16 14:05:11 +02:00
Matthew Dapena-Tretter
80ced1140c Don't show restore dialog for non-editor dock items
The Nuclide file tree was causing this dialog to be shown every time.
With this commit, we exclude non-editor dock items from the "dirty"
check.
2017-05-15 16:13:29 -07:00
Lee Dohm
1559c8a047 Merge pull request #12946 from jamsinclair/11848-fix-moving-line-without-line-ending
Fixes #11848 Moving line up without line ending
2017-05-13 15:00:46 -07:00