Skip to content

Commit

Permalink
Remove the vertical bar next to the code frame
Browse files Browse the repository at this point in the history
Summary:
This vertical bar doesn't really add any value. This diff removes it. At first I tried to use regex but ansi codes make that hard. We can just use the structured data and rely on the fact that the second item is always the one with the vertical bar.

(Note: this ignores all push blocking failures!)

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18656911

fbshipit-source-id: b72d4c93d0008c7da54647d072a4c4eb7646b694
  • Loading branch information
cpojer authored and facebook-github-bot committed Nov 22, 2019
1 parent 16e72ad commit 89be2d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Libraries/LogBox/UI/AnsiHighlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export default function Ansi({
remove_empty: true,
use_classes: true,
}).map((bundle, key) => {
// Remove the vertical bar after line numbers
const content =
key === 1 ? bundle.content.replace(/\| $/, ' ') : bundle.content;
const textStyle =
bundle.fg && COLORS[bundle.fg]
? {
Expand All @@ -62,7 +65,7 @@ export default function Ansi({
};
return (
<Text style={[style, textStyle]} key={key}>
{bundle.content}
{content}
</Text>
);
})}
Expand Down

0 comments on commit 89be2d0

Please sign in to comment.