From 255c1734cfc46964e8faa21756ede2badd7b3813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Tue, 26 Jul 2022 10:10:06 +0900 Subject: [PATCH] Rename padding to spacer, remove by default --- book/src/configuration.md | 2 +- helix-view/src/editor.rs | 8 ++------ helix-view/src/view.rs | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/book/src/configuration.md b/book/src/configuration.md index 1b3d3aee..c7334af4 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -38,7 +38,7 @@ hidden = false | `shell` | Shell to use when running external commands. | Unix: `["sh", "-c"]`
Windows: `["cmd", "/C"]` | | `line-number` | Line number display: `absolute` simply shows each line's number, while `relative` shows the distance from the current line. When unfocused or in insert mode, `relative` will still show absolute line numbers. | `absolute` | | `cursorline` | Highlight all lines with a cursor. | `false` | -| `gutters` | Gutters to display: Available are `diagnostics` and `line-numbers` and `padding`, note that `diagnostics` also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty | `["diagnostics", "line-numbers", "padding"]` | +| `gutters` | Gutters to display: Available are `diagnostics` and `line-numbers` and `spacer`, note that `diagnostics` also includes other features like breakpoints, 1-width padding will be inserted if gutters is non-empty | `["diagnostics", "line-numbers"]` | | `auto-completion` | Enable automatic pop up of auto-completion. | `true` | | `auto-format` | Enable automatic formatting on save. | `true` | | `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant. | `400` | diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 53c664b1..5d82e0d4 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -336,7 +336,7 @@ pub enum GutterType { /// Show line numbers LineNumbers, /// Show one blank space - Padding, + Spacer, } impl std::str::FromStr for GutterType { @@ -473,11 +473,7 @@ impl Default for Config { }, line_number: LineNumber::Absolute, cursorline: false, - gutters: vec![ - GutterType::Diagnostics, - GutterType::LineNumbers, - GutterType::Padding, - ], + gutters: vec![GutterType::Diagnostics, GutterType::LineNumbers], middle_click_paste: true, auto_pairs: AutoPairConfig::default(), auto_completion: true, diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index 6bdd5be4..3df533df 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -106,14 +106,14 @@ impl View { let width = match gutter_type { GutterType::Diagnostics => 1, GutterType::LineNumbers => 5, - GutterType::Padding => 1, + GutterType::Spacer => 1, }; gutter_offset += width; gutters.push(( match gutter_type { GutterType::Diagnostics => gutter::diagnostics_or_breakpoints, GutterType::LineNumbers => gutter::line_numbers, - GutterType::Padding => gutter::padding, + GutterType::Spacer => gutter::padding, }, width as usize, ));