mirror of https://github.com/helix-editor/helix
statusline toggle-encoding bool added
parent
de3f1b183b
commit
239c4c9318
|
@ -407,7 +407,7 @@ where
|
||||||
let enc = context.doc.encoding();
|
let enc = context.doc.encoding();
|
||||||
let config = context.editor.config();
|
let config = context.editor.config();
|
||||||
|
|
||||||
if config.encoding_always_show || enc != encoding::UTF_8 {
|
if config.statusline.toggle_encoding || enc != encoding::UTF_8 {
|
||||||
write(context, format!(" {} ", enc.name()).into());
|
write(context, format!(" {} ", enc.name()).into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,8 +318,6 @@ pub struct Config {
|
||||||
pub file_picker: FilePickerConfig,
|
pub file_picker: FilePickerConfig,
|
||||||
/// Configuration of the statusline elements
|
/// Configuration of the statusline elements
|
||||||
pub statusline: StatusLineConfig,
|
pub statusline: StatusLineConfig,
|
||||||
/// Toggle encoding to always show
|
|
||||||
pub encoding_always_show: bool,
|
|
||||||
/// Shape for cursor in each mode
|
/// Shape for cursor in each mode
|
||||||
pub cursor_shape: CursorShapeConfig,
|
pub cursor_shape: CursorShapeConfig,
|
||||||
/// Set to `true` to override automatic detection of terminal truecolor support in the event of a false negative. Defaults to `false`.
|
/// Set to `true` to override automatic detection of terminal truecolor support in the event of a false negative. Defaults to `false`.
|
||||||
|
@ -504,6 +502,7 @@ pub struct StatusLineConfig {
|
||||||
pub mode: ModeConfig,
|
pub mode: ModeConfig,
|
||||||
pub diagnostics: Vec<Severity>,
|
pub diagnostics: Vec<Severity>,
|
||||||
pub workspace_diagnostics: Vec<Severity>,
|
pub workspace_diagnostics: Vec<Severity>,
|
||||||
|
pub toggle_encoding: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for StatusLineConfig {
|
impl Default for StatusLineConfig {
|
||||||
|
@ -530,6 +529,7 @@ impl Default for StatusLineConfig {
|
||||||
mode: ModeConfig::default(),
|
mode: ModeConfig::default(),
|
||||||
diagnostics: vec![Severity::Warning, Severity::Error],
|
diagnostics: vec![Severity::Warning, Severity::Error],
|
||||||
workspace_diagnostics: vec![Severity::Warning, Severity::Error],
|
workspace_diagnostics: vec![Severity::Warning, Severity::Error],
|
||||||
|
toggle_encoding: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -998,7 +998,6 @@ impl Default for Config {
|
||||||
auto_info: true,
|
auto_info: true,
|
||||||
file_picker: FilePickerConfig::default(),
|
file_picker: FilePickerConfig::default(),
|
||||||
statusline: StatusLineConfig::default(),
|
statusline: StatusLineConfig::default(),
|
||||||
encoding_always_show: false,
|
|
||||||
cursor_shape: CursorShapeConfig::default(),
|
cursor_shape: CursorShapeConfig::default(),
|
||||||
true_color: false,
|
true_color: false,
|
||||||
undercurl: false,
|
undercurl: false,
|
||||||
|
|
Loading…
Reference in New Issue