Skip to content

Commit 2d3af8b

Browse files
committed
Use a better grayscale color for the suggestion text
1 parent 7a56514 commit 2d3af8b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

PSReadLine/Render.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ void MaybeEmphasize(int i, string currColor)
374374
if (suggestion != null)
375375
{
376376
// TODO: write suggestion out in dark black by default, but it needs to be configurable.
377-
color = "\x1b[90m";
377+
// Find the most suitable color using https://stackoverflow.com/a/33206814
378+
color = "\x1b[38;5;238m";
378379
UpdateColorsIfNecessary(color);
379380

380381
foreach (char charToRender in suggestion)

PSReadLine/Suggestion.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ static DummySuggestion()
2121
"git diff",
2222
"git diff --cached",
2323
"git add -u",
24-
"git add -A"
24+
"git add -A",
25+
"start",
2526
};
2627
}
2728

2829
internal static string GetCommandLineSuggestion(string text)
2930
{
3031
foreach (string candidate in s_suggestions)
3132
{
32-
if (candidate.StartsWith(text, StringComparison.OrdinalIgnoreCase))
33+
if (candidate.Length > text.Length && candidate.StartsWith(text, StringComparison.OrdinalIgnoreCase))
3334
{
3435
return candidate;
3536
}

0 commit comments

Comments
 (0)