disregard line endings when comparing size

This commit is contained in:
Vladimir Agafonkin 2012-10-30 23:38:41 +02:00
parent ae7561ec6b
commit 3bd189ed4c

View File

@ -74,6 +74,6 @@ exports.getSizeDelta = function (newContent, oldContent) {
if (!oldContent) { if (!oldContent) {
return 'new'; return 'new';
} }
var delta = newContent.length - oldContent.length; var delta = newContent.replace(/\r\n?/g, '\n').length - oldContent.replace(/\r\n?/g, '\n').length;
return (delta >= 0 ? '+' : '') + delta; return (delta >= 0 ? '+' : '') + delta;
}; };