Skip to content

Commit

Permalink
Rename Theme ReedlineTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
adaschma committed Jun 23, 2024
1 parent 89192ec commit 8127858
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub struct Reedline {
hide_hints: bool,

// Use ansi coloring or not
theme: Theme,
theme: ReedlineTheme,

// Engine Menus
menus: Vec<ReedlineMenu>,
Expand Down Expand Up @@ -180,7 +180,7 @@ impl Drop for Reedline {
}
}

pub struct Theme {
pub struct ReedlineTheme {
pub visual_selection: Style,
pub use_ansi_coloring: bool,
/// The color for the prompt, indicator, and right prompt
Expand All @@ -190,7 +190,7 @@ pub struct Theme {
pub prompt_right: Color,
}

impl Default for Theme {
impl Default for ReedlineTheme {
fn default() -> Self {
Self {
visual_selection: Style::new()
Expand Down Expand Up @@ -244,7 +244,7 @@ impl Reedline {
hinter,
hide_hints: false,
validator,
theme: Theme::default(),
theme: ReedlineTheme::default(),
menus: Vec::new(),
buffer_editor: None,
cursor_shapes: None,
Expand Down
8 changes: 4 additions & 4 deletions src/painting/painter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{engine::Theme, CursorConfig, PromptEditMode, PromptViMode};
use crate::{engine::ReedlineTheme, CursorConfig, PromptEditMode, PromptViMode};

use {
super::utils::{coerce_crlf, line_width},
Expand Down Expand Up @@ -187,7 +187,7 @@ impl Painter {
lines: &PromptLines,
prompt_mode: PromptEditMode,
menu: Option<&ReedlineMenu>,
theme: &Theme,
theme: &ReedlineTheme,
cursor_config: &Option<CursorConfig>,
) -> Result<()> {
self.stdout.queue(cursor::Hide)?;
Expand Down Expand Up @@ -315,7 +315,7 @@ impl Painter {
&mut self,
lines: &PromptLines,
menu: Option<&ReedlineMenu>,
theme: &Theme,
theme: &ReedlineTheme,
) -> Result<()> {
// print our prompt with color
if theme.use_ansi_coloring {
Expand Down Expand Up @@ -362,7 +362,7 @@ impl Painter {
&mut self,
lines: &PromptLines,
menu: Option<&ReedlineMenu>,
theme: &Theme,
theme: &ReedlineTheme,
) -> Result<()> {
let screen_width = self.screen_width();
let screen_height = self.screen_height();
Expand Down
4 changes: 2 additions & 2 deletions src/painting/styled_text.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use nu_ansi_term::Style;

use crate::{engine::Theme, Prompt};
use crate::{engine::ReedlineTheme, Prompt};

use super::utils::strip_ansi;

Expand Down Expand Up @@ -101,7 +101,7 @@ impl StyledText {
insertion_point: usize,
prompt: &dyn Prompt,
// multiline_prompt: &str,
theme: &Theme,
theme: &ReedlineTheme,
) -> (String, String) {
let mut current_idx = 0;
let mut left_string = String::new();
Expand Down

0 comments on commit 8127858

Please sign in to comment.