Skip to content

Commit d767c3c

Browse files
authored
Merge pull request #145 from JunioraTeam/main
Fix for extra added spaces at the start of lines
2 parents e7711dd + a3b2079 commit d767c3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+78
-31
lines changed

src/Languages/Base/Injections/GutterInjection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Tempest\Highlight\Highlighter;
99
use Tempest\Highlight\Injection;
1010
use Tempest\Highlight\ParsedInjection;
11+
use Tempest\Highlight\TerminalTheme;
1112

1213
final class GutterInjection implements Injection
1314
{
@@ -62,13 +63,14 @@ public function parse(string $content, Highlighter $highlighter): ParsedInjectio
6263
$gutterClass = 'hl-gutter' . ($hasClasses ? ' ' . $hasClasses : '');
6364

6465
$lines[$i] = sprintf(
65-
Escape::tokens('<span class="%s">%s</span> %s'),
66+
Escape::tokens('<span class="%s">%s</span>%s%s'),
6667
$gutterClass,
6768
str_pad(
6869
string: (string) $gutterNumber,
6970
length: $gutterWidth,
7071
pad_type: STR_PAD_LEFT,
7172
),
73+
$highlighter->getTheme() instanceof TerminalTheme ? ' ' : '',
7274
$line,
7375
);
7476
}

src/Themes/Css/andromeeda.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pre, code {
7272
font-size: 0.9em;
7373
color: #555;
7474
padding: 0 1ch;
75+
margin-right: 1ch;
7576
user-select: none;
7677
}
7778

src/Themes/Css/aurora-x.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pre, code {
7272
font-size: 0.9em;
7373
color: #555;
7474
padding: 0 1ch;
75+
margin-right: 1ch;
7576
user-select: none;
7677
}
7778

src/Themes/Css/ayu-dark.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pre, code {
7272
font-size: 0.9em;
7373
color: #555;
7474
padding: 0 1ch;
75+
margin-right: 1ch;
7576
user-select: none;
7677
}
7778

src/Themes/Css/catppuccin-frappe.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pre, code {
7272
font-size: 0.9em;
7373
color: #555;
7474
padding: 0 1ch;
75+
margin-right: 1ch;
7576
user-select: none;
7677
}
7778

src/Themes/Css/catppuccin-latte.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pre, code {
7272
font-size: 0.9em;
7373
color: #555;
7474
padding: 0 1ch;
75+
margin-right: 1ch;
7576
user-select: none;
7677
}
7778

src/Themes/Css/catppuccin-macchiato.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pre, code {
7272
font-size: 0.9em;
7373
color: #555;
7474
padding: 0 1ch;
75+
margin-right: 1ch;
7576
user-select: none;
7677
}
7778

src/Themes/Css/catppuccin-mocha.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pre, code {
7272
font-size: 0.9em;
7373
color: #555;
7474
padding: 0 1ch;
75+
margin-right: 1ch;
7576
user-select: none;
7677
}
7778

src/Themes/Css/dark-plus.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pre, code {
7272
font-size: 0.9em;
7373
color: #555;
7474
padding: 0 1ch;
75+
margin-right: 1ch;
7576
user-select: none;
7677
}
7778

src/Themes/Css/dracula-soft.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pre, code {
7272
font-size: 0.9em;
7373
color: #555;
7474
padding: 0 1ch;
75+
margin-right: 1ch;
7576
user-select: none;
7677
}
7778

0 commit comments

Comments
 (0)