-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add configuration for min width of line-numbers gutter #4724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
54f5914
ea094ed
4539a8d
568a69a
4af6508
9126fe0
d8875d3
6e858ea
ed90b88
7308a6b
7a265f0
209ba4d
f0e5bf1
9d198a0
a48e92c
c174b69
4f1393a
801df0d
ead29e6
097fd4f
c47e5cc
2a5e6b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,3 +255,55 @@ render = true | |
character = "╎" # Some characters that work well: "▏", "┆", "┊", "⸽" | ||
skip-levels = 1 | ||
``` | ||
|
||
### `[editor.gutters]` Section | ||
|
||
For simplicity, `editor.gutters` accepts an array of gutter types, which will | ||
use default settings for all gutter components. | ||
|
||
```toml | ||
[editor] | ||
gutters = ["diff", "diagnostics", "line-numbers", "spacer"] | ||
``` | ||
|
||
To customize the behavior of gutters, the `[editor.gutters]` section must | ||
be used. This section contains top level settings, as well as settings for | ||
specific gutter components as sub-sections. | ||
|
||
| Key | Description | Default | | ||
| --- | --- | --- | | ||
| `layout` | A vector of gutters to display | `["diagnostics", "spacer", "line-numbers", "spacer", "diff"]` | | ||
|
||
Example: | ||
|
||
```toml | ||
[editor.gutters] | ||
layout = ["diff", "diagnostics", "line-numbers", "spacer"] | ||
``` | ||
|
||
#### `[editor.gutters.line-numbers]` Section | ||
|
||
Options for the line number gutter | ||
|
||
| Key | Description | Default | | ||
| --- | --- | --- | | ||
| `width` | The minimum number of characters to use | `3` | | ||
|
||
Example: | ||
|
||
```toml | ||
[editor.gutters.line-numbers] | ||
width = 1 | ||
``` | ||
|
||
#### `[editor.gutters.diagnotics]` Section | ||
|
||
Currently unused | ||
|
||
#### `[editor.gutters.diff]` Section | ||
|
||
Currently unused | ||
|
||
#### `[editor.gutters.spacer]` Section | ||
|
||
Currently unused | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now the sub-sections are styled after the names that can be provided to Following that style, both breakpoints and diagnostics would be configured in Looking into the future a bit further, I think the underlying issue here is that diagnostics and breakpoints are a bit oddly coupled - likely a solution from before gutters were configurable. I think there's a case for decoupling diagnostics and breakpoints and trying to tackle that use case more generically. I think it would be interesting to be able to layer gutters as part of the layout. Perhaps something like: [editor.gutters]
layout = [ [ "diagnostics", "breakpoints" ], "line-numbers" ] Which would provide the current behavior. I think that needs more discussion before jumping to something like that, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m reimplementing #5371 rebased atop your PR then. |
Uh oh!
There was an error while loading. Please reload this page.