Skip to content

Commit

Permalink
Make Input::Text prompt and cursor colors follow theme
Browse files Browse the repository at this point in the history
  • Loading branch information
japhb committed Mar 1, 2024
1 parent 8bdcaf1 commit 9eb6915
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/Terminal/Widgets/Input/Text.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ class Terminal::Widgets::Input::Text
my $x = $layout.left-correction;
my $y = $layout.top-correction;

my $color = self.current-color;
my $states = self.current-color-states;
my $color = self.current-color($states);
my $prompt = self.current-color(%( |$states, :prompt ));
my $cursor = self.current-color(%( |$states, :cursor ));

my $refresh = $.input-field.render(:$edited);
my $start = $.input-field.field-start;
my $pos = $start
Expand All @@ -114,9 +118,9 @@ class Terminal::Widgets::Input::Text
self.clear-frame;
self.draw-framing;

$.grid.set-span($x, $y, $.prompt-string, "$color bold");
$.grid.set-span($x, $y, $.prompt-string, $prompt);
$.grid.set-span($start, $y, $refresh, $color);
$.grid.set-span-color($pos, $pos, $y, "$color inverse");
$.grid.set-span-color($pos, $pos, $y, $cursor);
}

#| Fetch completions based on current buffer contents and cursor pos
Expand Down

0 comments on commit 9eb6915

Please sign in to comment.