mirror of https://github.com/helix-editor/helix
Merge 535e015266
into 5d16aae58e
commit
68aa8d5b65
|
@ -104,6 +104,7 @@ separator = "│"
|
||||||
mode.normal = "NORMAL"
|
mode.normal = "NORMAL"
|
||||||
mode.insert = "INSERT"
|
mode.insert = "INSERT"
|
||||||
mode.select = "SELECT"
|
mode.select = "SELECT"
|
||||||
|
version-control-prefix = "vcs: "
|
||||||
```
|
```
|
||||||
The `[editor.statusline]` key takes the following sub-keys:
|
The `[editor.statusline]` key takes the following sub-keys:
|
||||||
|
|
||||||
|
@ -116,6 +117,7 @@ The `[editor.statusline]` key takes the following sub-keys:
|
||||||
| `mode.normal` | The text shown in the `mode` element for normal mode | `"NOR"` |
|
| `mode.normal` | The text shown in the `mode` element for normal mode | `"NOR"` |
|
||||||
| `mode.insert` | The text shown in the `mode` element for insert mode | `"INS"` |
|
| `mode.insert` | The text shown in the `mode` element for insert mode | `"INS"` |
|
||||||
| `mode.select` | The text shown in the `mode` element for select mode | `"SEL"` |
|
| `mode.select` | The text shown in the `mode` element for select mode | `"SEL"` |
|
||||||
|
| `version-control-prefix` | A prefix for the `version-control` element | `"vcs: "` |
|
||||||
|
|
||||||
The following statusline elements can be configured:
|
The following statusline elements can be configured:
|
||||||
|
|
||||||
|
|
|
@ -519,8 +519,13 @@ where
|
||||||
.version_control_head()
|
.version_control_head()
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.to_string();
|
.to_string();
|
||||||
|
if head.is_empty() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
write(context, head, None);
|
let config = context.editor.config.load();
|
||||||
|
let prefix = &config.statusline.version_control_prefix;
|
||||||
|
write(context, format!("{prefix}{head}"), None);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_register<F>(context: &mut RenderContext, write: F)
|
fn render_register<F>(context: &mut RenderContext, write: F)
|
||||||
|
|
|
@ -497,6 +497,7 @@ pub struct StatusLineConfig {
|
||||||
pub right: Vec<StatusLineElement>,
|
pub right: Vec<StatusLineElement>,
|
||||||
pub separator: String,
|
pub separator: String,
|
||||||
pub mode: ModeConfig,
|
pub mode: ModeConfig,
|
||||||
|
pub version_control_prefix: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for StatusLineConfig {
|
impl Default for StatusLineConfig {
|
||||||
|
@ -521,6 +522,7 @@ impl Default for StatusLineConfig {
|
||||||
],
|
],
|
||||||
separator: String::from("│"),
|
separator: String::from("│"),
|
||||||
mode: ModeConfig::default(),
|
mode: ModeConfig::default(),
|
||||||
|
version_control_prefix: String::from("vcs: "),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue