Skip to content

Commit

Permalink
fix #1339
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Apr 17, 2017
1 parent ea24ae8 commit 6c32a39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ function handleBackspace(range, context) {
if (range.index === 0 || this.quill.getLength() <= 1) return;
let [line, ] = this.quill.getLine(range.index);
let formats = {};
if (context.offset === 0) {
if (context.offset === 0 && line.prev != null && line.prev.length() > 1) {
let curFormats = line.formats();
let prevFormats = this.quill.getFormat(range.index-1, 1);
formats = DeltaOp.attributes.diff(curFormats, prevFormats) || {};
Expand Down

1 comment on commit 6c32a39

@astr0junk
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this fix has added in npm package?

Please # to comment.