Fix line number settings migration (#41351)
Follow-up to https://github.com/zed-industries/zed/pull/39268 Also updates the documentation. Release Notes: - N/A
This commit is contained in:
@@ -9,6 +9,7 @@ pub fn make_relative_line_numbers_an_enum(value: &mut Value) -> Result<()> {
|
||||
*relative_line_numbers = match relative_line_numbers {
|
||||
Value::Bool(true) => Value::String("enabled".to_string()),
|
||||
Value::Bool(false) => Value::String("disabled".to_string()),
|
||||
Value::String(s) if s == "enabled" || s == "disabled" || s == "wrapped" => return Ok(()),
|
||||
_ => anyhow::bail!("Expected relative_line_numbers to be a boolean"),
|
||||
};
|
||||
Ok(())
|
||||
|
||||
@@ -2996,11 +2996,33 @@ List of `string` glob patterns
|
||||
|
||||
- Description: Whether to show relative line numbers in the gutter
|
||||
- Setting: `relative_line_numbers`
|
||||
- Default: `false`
|
||||
- Default: `"disabled"`
|
||||
|
||||
**Options**
|
||||
|
||||
`boolean` values
|
||||
1. Show relative line numbers in the gutter whilst counting wrapped lines as one line:
|
||||
|
||||
```json [settings]
|
||||
{
|
||||
"relative_line_numbers": "enabled"
|
||||
}
|
||||
```
|
||||
|
||||
2. Show relative line numbers in the gutter, including wrapped lines in the counting:
|
||||
|
||||
```json [settings]
|
||||
{
|
||||
"relative_line_numbers": "wrapped"
|
||||
}
|
||||
```
|
||||
|
||||
2. Do not use relative line numbers:
|
||||
|
||||
```json [settings]
|
||||
{
|
||||
"relative_line_numbers": "disabled"
|
||||
}
|
||||
```
|
||||
|
||||
## Remove Trailing Whitespace On Save
|
||||
|
||||
|
||||
Reference in New Issue
Block a user