1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Handle 'No newline' message in text diffs

This commit is contained in:
Nick O'Leary 2017-10-20 21:29:43 +02:00
parent 3d6468326a
commit b9a3563e5b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -1670,10 +1670,10 @@ RED.diff = (function() {
for (var j=0;j<hunks[i].lines.length;j++) {
var lineText = hunks[i].lines[j];
if (lineText[0] === '\\' || lineText === "") {
// Comment line - bail out of this hunk
break;
}
// if (lineText[0] === '\\' || lineText === "") {
// // Comment line - bail out of this hunk
// break;
// }
diffRow = $('<tr>').appendTo(codeBody);
var localLineNo = $('<td class="lineno">').appendTo(diffRow);
var remoteLineNo = $('<td class="lineno">').appendTo(diffRow);
@ -1688,10 +1688,10 @@ RED.diff = (function() {
localLineNo.text(localLine++);
} else {
line.addClass("unchanged");
if (localLine > 0) {
if (localLine > 0 && lineText[0] !== '\\' && lineText !== "") {
localLineNo.text(localLine++);
}
if (remoteLine > 0) {
if (remoteLine > 0 && lineText[0] !== '\\' && lineText !== "") {
remoteLineNo.text(remoteLine++);
}
}