From fcbac485f885d90f6341d7acaf75157a01d81892 Mon Sep 17 00:00:00 2001 From: Connortsui20 Date: Tue, 8 Aug 2023 08:51:34 -0400 Subject: Show whether file readonly in statusline (#7740) --- helix-term/src/ui/statusline.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index 61fca609..52dd49f9 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -145,6 +145,7 @@ where helix_view::editor::StatusLineElement::FileModificationIndicator => { render_file_modification_indicator } + helix_view::editor::StatusLineElement::ReadOnlyIndicator => render_read_only_indicator, 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, @@ -442,6 +443,19 @@ where write(context, title, None); } +fn render_read_only_indicator(context: &mut RenderContext, write: F) +where + F: Fn(&mut RenderContext, String, Option