Skip to content

Commit

Permalink
Avoid renaming existing element
Browse files Browse the repository at this point in the history
  • Loading branch information
theteachr committed Dec 28, 2022
1 parent 5da164f commit a568fb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions helix-term/src/ui/statusline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ where
match element_id {
helix_view::editor::StatusLineElement::Mode => render_mode,
helix_view::editor::StatusLineElement::Spinner => render_lsp_spinner,
helix_view::editor::StatusLineElement::FileBaseName => render_file_base_name,
helix_view::editor::StatusLineElement::FileName => render_file_name,
helix_view::editor::StatusLineElement::FilePath => render_file_path,
helix_view::editor::StatusLineElement::FileEncoding => render_file_encoding,
helix_view::editor::StatusLineElement::FileLineEnding => render_file_line_ending,
helix_view::editor::StatusLineElement::FileType => render_file_type,
Expand Down Expand Up @@ -407,7 +407,7 @@ where
write(context, format!(" {} ", file_type), None);
}

fn render_file_path<F>(context: &mut RenderContext, write: F)
fn render_file_name<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
{
Expand All @@ -427,7 +427,7 @@ where
write(context, title, None);
}

fn render_file_name<F>(context: &mut RenderContext, write: F)
fn render_file_base_name<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
{
Expand Down
8 changes: 4 additions & 4 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl Default for StatusLineConfig {
use StatusLineElement as E;

Self {
left: vec![E::Mode, E::Spinner, E::FilePath],
left: vec![E::Mode, E::Spinner, E::FileName],
center: vec![],
right: vec![E::Diagnostics, E::Selections, E::Position, E::FileEncoding],
separator: String::from("│"),
Expand Down Expand Up @@ -315,10 +315,10 @@ pub enum StatusLineElement {
Spinner,

/// The base file name, including a dirty flag if it's unsaved
FileName,
FileBaseName,

/// The file path, including a dirty flag if it's unsaved
FilePath,
/// The relative file path, including a dirty flag if it's unsaved
FileName,

/// The file encoding
FileEncoding,
Expand Down

0 comments on commit a568fb0

Please sign in to comment.