mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Ensure that new editors get unique ids
This restores the behavior from when TextEditor was written in coffeescript, and extended the Model class.
This commit is contained in:
@@ -119,6 +119,10 @@ class TextEditor {
|
||||
}
|
||||
|
||||
this.id = params.id != null ? params.id : nextId++
|
||||
if (this.id >= nextId) {
|
||||
// Ensure that new editors get unique ids:
|
||||
nextId = this.id + 1;
|
||||
}
|
||||
this.initialScrollTopRow = params.initialScrollTopRow
|
||||
this.initialScrollLeftColumn = params.initialScrollLeftColumn
|
||||
this.decorationManager = params.decorationManager
|
||||
|
||||
Reference in New Issue
Block a user