WIP commit, newlines sort of working
This commit is contained in:
parent
9f597c7ec0
commit
7ebb6ce621
5 changed files with 183 additions and 63 deletions
|
@ -80,7 +80,8 @@ export default class EditorModel {
|
|||
update(newValue, inputType, caret) {
|
||||
const diff = this._diff(newValue, inputType, caret);
|
||||
const position = this._positionForOffset(diff.at, caret.atNodeEnd);
|
||||
console.log("update at", {position, diff, newValue, prevValue: this.parts.reduce((text, p) => text + p.text, "")});
|
||||
const valueWithCaret = newValue.slice(0, caret.offset) + "|" + newValue.slice(caret.offset);
|
||||
console.log("update at", {diff, valueWithCaret});
|
||||
let removedOffsetDecrease = 0;
|
||||
if (diff.removed) {
|
||||
removedOffsetDecrease = this._removeText(position, diff.removed.length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue