Rename padding to spacer, remove by default

pull/3168/head^2
Blaž Hrastnik 2 years ago
parent 2f980471f8
commit 255c1734cf
No known key found for this signature in database
GPG Key ID: 1238B9C4AD889640

@ -38,7 +38,7 @@ hidden = false
| `shell` | Shell to use when running external commands. | Unix: `["sh", "-c"]`<br/>Windows: `["cmd", "/C"]` | | `shell` | Shell to use when running external commands. | Unix: `["sh", "-c"]`<br/>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` | | `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` | | `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-completion` | Enable automatic pop up of auto-completion. | `true` |
| `auto-format` | Enable automatic formatting on save. | `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` | | `idle-timeout` | Time in milliseconds since last keypress before idle timers trigger. Used for autocompletion, set to 0 for instant. | `400` |

@ -336,7 +336,7 @@ pub enum GutterType {
/// Show line numbers /// Show line numbers
LineNumbers, LineNumbers,
/// Show one blank space /// Show one blank space
Padding, Spacer,
} }
impl std::str::FromStr for GutterType { impl std::str::FromStr for GutterType {
@ -473,11 +473,7 @@ impl Default for Config {
}, },
line_number: LineNumber::Absolute, line_number: LineNumber::Absolute,
cursorline: false, cursorline: false,
gutters: vec![ gutters: vec![GutterType::Diagnostics, GutterType::LineNumbers],
GutterType::Diagnostics,
GutterType::LineNumbers,
GutterType::Padding,
],
middle_click_paste: true, middle_click_paste: true,
auto_pairs: AutoPairConfig::default(), auto_pairs: AutoPairConfig::default(),
auto_completion: true, auto_completion: true,

@ -106,14 +106,14 @@ impl View {
let width = match gutter_type { let width = match gutter_type {
GutterType::Diagnostics => 1, GutterType::Diagnostics => 1,
GutterType::LineNumbers => 5, GutterType::LineNumbers => 5,
GutterType::Padding => 1, GutterType::Spacer => 1,
}; };
gutter_offset += width; gutter_offset += width;
gutters.push(( gutters.push((
match gutter_type { match gutter_type {
GutterType::Diagnostics => gutter::diagnostics_or_breakpoints, GutterType::Diagnostics => gutter::diagnostics_or_breakpoints,
GutterType::LineNumbers => gutter::line_numbers, GutterType::LineNumbers => gutter::line_numbers,
GutterType::Padding => gutter::padding, GutterType::Spacer => gutter::padding,
}, },
width as usize, width as usize,
)); ));

Loading…
Cancel
Save