Skip to content

Commit

Permalink
Add deleteCodePointForward/Backward commands
Browse files Browse the repository at this point in the history
And use the former as default backspace binding.

See codemirror/codemirror5#6408
  • Loading branch information
marijnh committed Sep 11, 2020
1 parent 5c53e27 commit 1ba59ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,11 @@ class LineContent {
this.strings = [this.cursor.next(this.start).value]
}
for (let result = "", pos = 0, i = 0;; i++) {
if (i == this.strings!.length) this.strings!.push(this.cursor!.next().value)
if (i == this.strings!.length) {
let next = this.cursor!.next().value
if (!next) return result
this.strings!.push(next)
}
let string = this.strings![i], start = pos
pos += string.length
if (pos <= from) continue
Expand Down

0 comments on commit 1ba59ec

Please sign in to comment.