We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0795945 commit 6722c9dCopy full SHA for 6722c9d
src/CodeFormatManager.ts
@@ -66,10 +66,11 @@ export default class CodeFormatManager {
66
// Events from the explicit Atom command.
67
this._subscriptions.add(
68
atom.commands.add("atom-text-editor", "code-format:format-code", async (event) => {
69
- const editor = atom.workspace.getActiveTextEditor()
70
- if (!editor) {
+ const editorElement = event.currentTarget
+ if (!editorElement) {
71
return
72
}
73
+ const editor = editorElement.getModel()
74
// Make sure we halt everything when the editor gets destroyed.
75
const edits = await this._formatCodeInTextEditor(editor)
76
try {
0 commit comments