Skip to content

Commit

Permalink
refactor(term): rename prompt to status line
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Apr 26, 2024
1 parent 205b84d commit 6e3c885
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 7 deletions.
52 changes: 52 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/synd_term/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ tracing-appender = "0.2.3"
tracing-subscriber = { workspace = true }
unicode-segmentation = "1.10.1"
url = { workspace = true }
nucleo = "0.5.0"
# https://github.com/arkbig/throbber-widgets-tui/pull/5
# throbber-widgets-tui = "0.3.0"

Expand Down
8 changes: 4 additions & 4 deletions crates/synd_term/src/ui/components/mod.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
use crate::{
auth::AuthenticationProvider,
ui::components::{
authentication::Authentication, entries::Entries, filter::Filter, prompt::Prompt,
authentication::Authentication, entries::Entries, filter::Filter, status::StatusLine,
subscription::Subscription, tabs::Tabs,
},
};

pub mod authentication;
pub mod entries;
pub mod filter;
pub mod prompt;
pub mod root;
pub mod status;
pub mod subscription;
pub mod tabs;

pub struct Components {
pub tabs: Tabs,
pub filter: Filter,
pub prompt: Prompt,
pub prompt: StatusLine,
pub subscription: Subscription,
pub entries: Entries,
pub auth: Authentication,
Expand All @@ -28,7 +28,7 @@ impl Components {
Self {
tabs: Tabs::new(),
filter: Filter::new(),
prompt: Prompt::new(),
prompt: StatusLine::new(),
subscription: Subscription::new(),
entries: Entries::new(),
auth: Authentication::new(vec![
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ use crate::{

use super::tabs::Tab;

pub struct Prompt {
pub struct StatusLine {
error_message: Option<String>,
}

impl Prompt {
impl StatusLine {
pub fn new() -> Self {
Self {
error_message: None,
Expand All @@ -38,7 +38,7 @@ impl Prompt {
}
}

impl Prompt {
impl StatusLine {
pub fn render(&self, area: Rect, buf: &mut Buffer, cx: &Context<'_>, tab: Option<Tab>) {
match self.error_message.as_ref() {
Some(error_message) => Self::render_error(area, buf, cx, error_message),
Expand Down

0 comments on commit 6e3c885

Please sign in to comment.