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:
Ford Hurley
2017-12-27 13:39:50 -05:00
parent e3b0c8c9b5
commit f96a0d922e

View File

@@ -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