hack around start line 1, end line 1

This commit is contained in:
John Mitchell 2017-01-31 17:01:34 -05:00
parent eada4ce83f
commit 2e93fc22e2

View File

@ -202,6 +202,11 @@ export default ['$log', 'moment', function($log, moment){
let lineNums = _.range(event.start_line + 1,
event.end_line + 1);
// hack around no-carriage return issues
if (!lineNums.length) {
lineNums = [event.start_line + 1];
}
let lines = event.stdout
.replace("\t", " ")
.split("\r\n");
@ -214,6 +219,11 @@ export default ['$log', 'moment', function($log, moment){
}
}
// hack around no-carriage return issues
if (lineNums.length === lines.length) {
return _.zip(lineNums, lines);
}
return _.zip(lineNums, lines).slice(0, -1);
},
// public function that provides the parsed stdout line, given a