Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit 369e9f3

Browse files
committed
trim 1 char, not 2
1 parent 2066396 commit 369e9f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/CLIColoredUnifiedDiff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ final protected static function join(vec<string> $lines): string {
6868
final protected static function colorDeleteLineWithIntralineEdits(
6969
vec<DiffOp<string>> $ops,
7070
): string {
71-
$line = self::DELETE_COLOR.'- ';
71+
$line = self::DELETE_COLOR.'-';
7272
foreach ($ops as $op) {
7373
if ($op is DiffKeepOp<_>) {
7474
$line .= $op->getContent();
@@ -89,7 +89,7 @@ final protected static function colorDeleteLineWithIntralineEdits(
8989
final protected static function colorInsertLineWithIntralineEdits(
9090
vec<DiffOp<string>> $ops,
9191
): string {
92-
$line = self::INSERT_COLOR.'+ ';
92+
$line = self::INSERT_COLOR.'+';
9393
foreach ($ops as $op) {
9494
if ($op is DiffKeepOp<_>) {
9595
$line .= $op->getContent();

src/ColoredUnifiedDiff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ final public static function create(
106106
&& \levenshtein($line, $next) - 2 <= (0.5 * (Str\length($line) - 2))
107107
) {
108108
// Drop the prefix
109-
$line = Str\slice($line, 2);
110-
$next = Str\slice($next, 2);
109+
$line = Str\slice($line, 1);
110+
$next = Str\slice($next, 1);
111111
$lines = Vec\drop($lines, 1);
112112

113113
$intraline = StringDiff::characters($line, $next)->getDiff();

0 commit comments

Comments
 (0)