Skip to content
This repository was archived by the owner on Sep 5, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions init.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,8 @@

case "+":
/* Some characters were added. */
aceDelta = {
action: "insertText",
range: {
start: {row: (row - 1), column: (col - 1)},
end: {row: (row - 1), column: (col - 1)}
},
text: data
};
aceDeltas.push(aceDelta);
var startRow = row;
var startCol = col;

var innerRows = data.split("\n");
var innerRowsCount = innerRows.length - 1;
Expand All @@ -574,6 +567,14 @@
} else {
col = innerRows[innerRowsCount].length + 1;
}

aceDelta = {
action: "insert",
start: {row: (startRow - 1), column: (startCol - 1)},
end: {row: (row - 1), column: (col - 1)},
lines: innerRows
};
aceDeltas.push(aceDelta);
break;

case "-":
Expand All @@ -593,12 +594,10 @@
}

aceDelta = {
action: "removeText",
range: {
start: {row: (row - 1), column: (col - 1)},
end: {row: (endRow - 1), column: (endCol - 1)}
},
text: data
action: "remove",
start: {row: (row - 1), column: (col - 1)},
end: {row: (endRow - 1), column: (endCol - 1)},
lines: removedRows
};
aceDeltas.push(aceDelta);

Expand Down