Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only underline filename in header #25

Merged
merged 2 commits into from
Sep 5, 2017
Merged
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
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = results => {
.forEach(x => {
let message = x.message;

// stylize inline code blocks
// Stylize inline code blocks
message = message.replace(/\B`(.*?)`\B|\B'(.*?)'\B/g, (m, p1, p2) => chalk.bold(p1 || p2));

const line = String(x.line || 0);
Expand Down Expand Up @@ -88,17 +88,17 @@ module.exports = results => {
let output = '\n';

if (process.stdout.isTTY && !process.env.CI) {
// make relative paths Cmd+click'able in iTerm
// Make relative paths Cmd+click'able in iTerm
output += ansiEscapes.iTerm.setCwd();
}

output += lines.map(x => {
if (x.type === 'header') {
// add the line number so it's Cmd+click'able in some terminals
// use dim & gray for terminals like iTerm that doesn't support `hidden`
// Add the line number so it's Cmd+click'able in some terminals
// Use dim & gray for terminals like iTerm that doesn't support `hidden`
const position = showLineNumbers ? chalk.hidden.dim.gray(`:${x.firstLineCol}`) : '';

return ' ' + chalk.underline(x.relativeFilePath + position);
return ' ' + chalk.underline(x.relativeFilePath) + position;
}

if (x.type === 'message') {
Expand Down