Commit Graph

15880 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
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
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
Antonio Scandurra
baca845e64 Fix not resetting unused styles in NodePool 2017-06-03 14:56:21 +02:00
Antonio Scandurra
f07e1eb009 Merge pull request #14698 from atom/as-ns-recycle-nodes
Recycle line and line number DOM nodes
2017-06-03 10:53:47 +02:00
Antonio Scandurra
ec774e143a Fix lint errors 2017-06-03 10:52:32 +02:00
Jason Rudolph
e1719a8923 Teach Workspace::reset() to properly reset hasActiveTextEditor 2017-06-02 15:56:13 -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
9629caefb7 Remove unnecessary serialization 2017-06-02 15:09:20 -04:00
Max Brunsfeld
d289ca4471 Fix unintended unload prevention for spec windows 2017-06-02 10:30:10 -07: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
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
5dfbb65b0e 🎨 Reduce ternaries 2017-06-01 17:09:38 -04:00
Jason Rudolph
6a694f80f4 🎨 Replace instanceof check with nullness check
xref: https://github.com/atom/atom/pull/14695#discussion_r119721719
2017-06-01 17:04:43 -04:00
Jason Rudolph
fe550a1b03 🎨 Refactor: Introduce explaining variable
xref: https://github.com/atom/atom/pull/14695#discussion_r119721719
2017-06-01 17:04:17 -04:00
Jason Rudolph
14d8eccc6e 📝 Add API docs for observeActiveTextEditor(callback) 2017-06-01 15:47:31 -04:00
Jason Rudolph
5b52d8c77a 📝 Add API docs for onDidChangeActiveTextEditor(callback) 2017-06-01 15:44:37 -04:00
Jason Rudolph
09495dfc35 🔥 Remove broken Dock::getTextEditors() function
We're updating Atom to disallow editors in docks. As a result, we need
to remove Dock::getTextEditors(). Normally, we would deprecate a method
before removing it, but this method is broken and has never worked:

  atom.workspace.getLeftDock().getTextEditors()
  (unknown) Uncaught TypeError: this.paneContainer.getTextEditors is not a function
      at Dock.getTextEditors (/Applications/Atom.app/Contents/Resources/app/src/dock.js:590:37)
      at <anonymous>:1:30

Since the method is broken, we know that nobody is relying on it.
Instead of deprecating the method, we can just remove it.
2017-06-01 15:31:21 -04:00
Jason Rudolph
0b314ac1a9 🔥 Remove broken Dock::observeTextEditors(callback) fn
We're updating Atom to disallow editors in docks. As a result, we need
to remove Dock::observeTextEditors(callback). Normally, we would
deprecate a method before removing it, but this method is broken and has
never worked:

  atom.workspace.getLeftDock().observeTextEditors(console.log)
  (unknown) Uncaught TypeError: this.paneContainer.getTextEditors is not a function
      at Dock.getTextEditors (/Applications/Atom.app/Contents/Resources/app/src/dock.js:590:37)
      at Dock.observeTextEditors (/Applications/Atom.app/Contents/Resources/app/src/dock.js:396:41)
      at <anonymous>:1:30
  getTextEditors @ <embedded>:29933
  observeTextEditors @ <embedded>:29739
  (anonymous) @ VM1941:1

Since the method is broken, we know that nobody is relying on it.
Instead of deprecating the method, we can just remove it.
2017-06-01 15:26:12 -04:00
Jason Rudolph
f8ebd71200 Deprecate Dock::getActiveTextEditor() 2017-06-01 15:24:50 -04:00
Max Brunsfeld
12d0de0e03 Merge branch 'master' into mb-use-native-text-buffer 2017-06-01 11:09:09 -07:00
Jason Rudolph
e569f8fc4d 📝 Fix odd grammar in API docs 2017-06-01 12:08:09 -04:00
Lee Dohm
50603ef19c Merge pull request #14697 from atom/ld-activate-item-docs
📝 Add missing parameter documentation
2017-06-01 08:26:20 -07:00
Antonio Scandurra
a25134e97f Recycle line number nodes
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-06-01 17:24:18 +02:00
Lee Dohm
fdd4d52fcc 📝 Add missing parameter documentation 2017-06-01 08:24:14 -07:00
Antonio Scandurra
b8d0d83b9a Recycle line nodes
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-06-01 17:24:13 +02: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
Antonio Scandurra
23e26da2fb Skip overlay resize events when we already measured at the current size
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-06-01 14:44:06 +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
Jason Rudolph
61a52d49aa Allow text editors in the workspace center, but not in docks 2017-05-31 14:06:46 -04:00
Antonio Scandurra
028b4c9082 Try a different approach for preventing autoscroll to off-screen input
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-31 16:43:08 +02:00
Max Brunsfeld
d4c05e5956 Merge branch 'master' into mb-use-native-text-buffer 2017-05-30 10:25:54 -07: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
d296e9d185 Immediately fetch new buffers' git status in GitRepository
We used to emit buffer added events before the buffers were loaded, so we
would end up fetching their git status soon afterwords, when they emitted
the did-reload event.
2017-05-22 17:50:37 -07:00
Lee Dohm
0842106203 📝 Document Task.cancel 2017-05-22 16:42:03 -07:00
Lee Dohm
85e65ffd1c Merge pull request #14492 from mrngoitall/fix-report-issue-link
🐛 Fix Report Issue link to CONTRIBUTING.md
2017-05-22 12:02:41 -07: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
6c0b70f5f3 Start work on integrating new native TextBuffer version 2017-05-19 11:33:49 -07:00
Antonio Scandurra
a7066e387f Fix lint errors
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-19 11:07:38 +02:00
Antonio Scandurra
d158e44374 Merge branch 'master' into tj-upgrade-electron 2017-05-19 11:05:15 +02:00
Antonio Scandurra
2c3500503f Use custom snapshot row translation to prevent Electron 1.6 reload crash
Adding a source map for the entire snapshot was expensive in terms of
memory and seemed to be triggering some sort of bug in Chromium when
reloading with the DevTools open.

The custom row translation relies on a much more compact representation
of the data and avoids the crash.

Signed-off-by: Nathan Sobo <nathan@github.com>
2017-05-19 10:23:13 +02:00
Will Ngo
6283463d88 🐛 Fix Report Issue link to CONTRIBUTING.md 2017-05-18 14:31:27 -07:00
Max Brunsfeld
e99545ee41 Fix exception when starting to drag text 2017-05-18 10:13:48 -07:00
Michelle Tilley
b15ce0c3f6 Merge pull request #14424 from atom/mkt-update-github-0.0.10
⬆ github@0.0.10
2017-05-18 17:10:57 +02:00