Merge branch 'develop' into katex
This commit is contained in:
commit
aafaf34233
157 changed files with 6534 additions and 4828 deletions
|
@ -18,6 +18,10 @@ import EditorModel from "./model";
|
|||
import DocumentPosition, {Predicate} from "./position";
|
||||
import {Part} from "./parts";
|
||||
|
||||
const whitespacePredicate: Predicate = (index, offset, part) => {
|
||||
return part.text[offset].trim() === "";
|
||||
};
|
||||
|
||||
export default class Range {
|
||||
private _start: DocumentPosition;
|
||||
private _end: DocumentPosition;
|
||||
|
@ -35,6 +39,11 @@ export default class Range {
|
|||
});
|
||||
}
|
||||
|
||||
trim() {
|
||||
this._start = this._start.forwardsWhile(this.model, whitespacePredicate);
|
||||
this._end = this._end.backwardsWhile(this.model, whitespacePredicate);
|
||||
}
|
||||
|
||||
expandBackwardsWhile(predicate: Predicate) {
|
||||
this._start = this._start.backwardsWhile(this.model, predicate);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue