Fixed OT not handle when selection is empty
This commit is contained in:
parent
53f26a7771
commit
3f64ec79b7
2 changed files with 2 additions and 2 deletions
2
public/vendor/ot/codemirror-adapter.js
vendored
2
public/vendor/ot/codemirror-adapter.js
vendored
|
@ -247,7 +247,7 @@ ot.CodeMirrorAdapter = (function (global) {
|
||||||
|
|
||||||
CodeMirrorAdapter.prototype.setSelection = function (selection) {
|
CodeMirrorAdapter.prototype.setSelection = function (selection) {
|
||||||
var ranges = [];
|
var ranges = [];
|
||||||
for (var i = 0; i < selection.ranges.length; i++) {
|
for (var i = 0; selection && i < selection.ranges.length; i++) {
|
||||||
var range = selection.ranges[i];
|
var range = selection.ranges[i];
|
||||||
ranges[i] = {
|
ranges[i] = {
|
||||||
anchor: this.cm.posFromIndex(range.anchor),
|
anchor: this.cm.posFromIndex(range.anchor),
|
||||||
|
|
2
public/vendor/ot/ot.min.js
vendored
2
public/vendor/ot/ot.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue