mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Ensure that all opened editors' buffers are added to the project
Assigning a language mode happens when adding a buffer to the project, so we need to guarantee this happens to all buffers used by visible editors.
This commit is contained in:
@@ -497,6 +497,9 @@ module.exports = class Workspace extends Model {
|
||||
this.textEditorRegistry.maintainConfig(item),
|
||||
item.observeGrammar(this.handleGrammarUsed.bind(this))
|
||||
)
|
||||
if (!this.project.findBufferForId(item.buffer.id)) {
|
||||
this.project.addBuffer(item.buffer)
|
||||
}
|
||||
item.onDidDestroy(() => { subscriptions.dispose() })
|
||||
this.emitter.emit('did-add-text-editor', {textEditor: item, pane, index})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user