1 |
|
2 | header = require './header'
|
3 | _ = require 'underscore'
|
4 |
|
5 | module.exports = (stackLine,settings={}) ->
|
6 |
|
7 | settings = _.extend { margin:3, title:undefined }, settings
|
8 |
|
9 | header stackLine, settings.title
|
10 |
|
11 | stackLine.row = Number( stackLine.row )
|
12 |
|
13 | for i in [(stackLine.row - settings.margin)..(stackLine.row + settings.margin)]
|
14 |
|
15 | if undefined != ( line = stackLine.file.lines[ i - 1 ] )
|
16 |
|
17 | line = line.substr( 0, 80 )
|
18 |
|
19 | if stackLine.row is Number i
|
20 |
|
21 | console.error " \x1b[1;31m✘\x1b[1;33m #{i}: \x1b[1;37m#{line}\x1b[0m"
|
22 |
|
23 | else
|
24 |
|
25 | console.error " \x1b[0;33m #{i}: \x1b[1;30m#{line}\x1b[0m" |
\ | No newline at end of file |