(doc, sel, options)
| 1125 | } |
| 1126 | |
| 1127 | function setSelectionNoUndo(doc, sel, options) { |
| 1128 | if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) |
| 1129 | sel = filterSelectionChange(doc, sel); |
| 1130 | |
| 1131 | var bias = cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1; |
| 1132 | setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); |
| 1133 | |
| 1134 | if (!(options && options.scroll === false) && doc.cm) |
| 1135 | ensureCursorVisible(doc.cm); |
| 1136 | } |
| 1137 | |
| 1138 | function setSelectionInner(doc, sel) { |
| 1139 | if (sel.equals(doc.sel)) return; |
no test coverage detected