Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Changes required due to TextBuffer.save becoming async in Atom 1.19 #3

Closed
maxbrunsfeld opened this issue Jun 14, 2017 · 0 comments · Fixed by #5
Closed

Changes required due to TextBuffer.save becoming async in Atom 1.19 #3

maxbrunsfeld opened this issue Jun 14, 2017 · 0 comments · Fixed by #5

Comments

@maxbrunsfeld
Copy link

Hi! Thanks for maintaining the atom-vim-like-tab package!

In Atom v1.19, we will release a major change to Atom's core text buffer data structure. As part of this change, we have made TextBuffer.save asynchronous; rather than blocking until the save is complete, it now immediately returns a Promise that resolves when the save is complete. Because of this, a few other Atom APIs that use save have similarly become async:

  • Pane.close
  • TextBuffer.save
  • TextEditor.save
  • Pane.saveItem
  • Pane.saveItemAs
  • Pane.saveActiveItem
  • Pane.saveActiveItemAs
  • Pane.saveItems
  • Workspace.saveActivePaneItem
  • Workspace.saveActivePaneItemAs

Effects on this package

We think this package could be impacted by this upgrade because it calls the changed methods in the following places:

We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.

What to do about the change

It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:

@Kesin11 Kesin11 closed this as completed in #5 Jul 2, 2017
Kesin11 added a commit that referenced this issue Jul 2, 2017
fix #3. fix spec for atom1.19 breaking change Pane.close()
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant