tshort / atom-mdpad Goto Github PK
View Code? Open in Web Editor NEWMdpad utilities for the Atom text editor
License: MIT License
Mdpad utilities for the Atom text editor
License: MIT License
Hi! Thanks for maintaining the mdpad 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
We think this package could be impacted by this upgrade because it calls the changed methods in the following places:
TextEditor.save
We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.
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:
Please let me know if you have any questions. I would be happy to help!
Hi! Thanks for maintaining the mdpad package!
In Atom v1.23, we will some changes that may affect your package.
The methods TextEditor.onDidChange
and TextBuffer.onDidChange
will now call their callbacks less frequently. Previously, these callbacks would get called once for each individual change to the buffer. So if you had 5 cursors and typed a character, they would get called 5 times. Now, they will only get called once, and the event that is passed to them will contain information about all 5 of the changes that have occurred.
The same properties that have always existed on the TextBuffer.onDidChange
events (oldRange
, newRange
, oldText
, and newText
) will still be there, and they will now reflect the sum of all changes that have occurred. But now there will be an additional property called changes
, which will contain an array of more fine-grained objects describing the individual changes. We encourage you to use this property instead of the old ones.
It looks like this package calls the changed methods in the following places:
TextEditor.onDidChange
We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.
It is likely that you do not need to do anything. The old event properties will continue to work.
However, you may be able to handle changes more accurately and efficiently by using the changes
field of the events rather than the old properties. The changes
field does not exist in Atom 1.22 unless you use the TextBuffer.onDidChangeText
method. In Atom 1.23 and above though, .onDidChange
and .onDidChangeText
will become identical, having both the old properties and the new changes
property.
Please let me know if you have any questions. I would be happy to help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.