feat: add opt-in trailing whitespace highlighting

This commit is contained in:
2026-10-13 22:42:30 +02:00
parent b58fb085a3
commit e2f33519d1
8 changed files with 179 additions and 4 deletions
+10
View File
@@ -1763,6 +1763,7 @@ pub struct Editor {
popup: PopupConfig,
labels: BTreeMap<String, String>,
scroll_distance: Option<usize>,
highlight_trailing_whitespace: bool,
battery_charge: Option<u8>,
battery_label: String,
git_blame: bool,
@@ -1865,6 +1866,7 @@ impl Editor {
popup: PopupConfig::default(),
labels: BTreeMap::new(),
scroll_distance: Some(0),
highlight_trailing_whitespace: false,
battery_charge: None,
battery_label: String::new(),
git_blame: true,
@@ -2611,6 +2613,14 @@ impl Editor {
self.scroll_distance = distance;
}
pub(crate) fn highlight_trailing_whitespace(&self) -> bool {
self.highlight_trailing_whitespace
}
pub(crate) fn set_highlight_trailing_whitespace(&mut self, enabled: bool) {
self.highlight_trailing_whitespace = enabled;
}
pub(crate) fn set_diff_context_options(&mut self, context_lines: usize, expand_lines: usize) {
self.diff_context_options = (context_lines, expand_lines);
if let Some(diff) = &mut self.diff {