Skip to content
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

Scrolling Bufferline #8362

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Updated documentation
  • Loading branch information
CedricMeu committed Sep 23, 2023
commit 67753154d3934692fd609911904595c89123a55f
16 changes: 15 additions & 1 deletion book/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,27 @@ Its settings will be merged with the configuration directory `config.toml` and t
| `true-color` | Set to `true` to override automatic detection of terminal truecolor support in the event of a false negative | `false` |
| `undercurl` | Set to `true` to override automatic detection of terminal undercurl support in the event of a false negative | `false` |
| `rulers` | List of column positions at which to display the rulers. Can be overridden by language specific `rulers` in `languages.toml` file | `[]` |
| `bufferline` | Renders a line at the top of the editor displaying open buffers. Can be `always`, `never` or `multiple` (only shown if more than one buffer is in use) | `never` |
| `color-modes` | Whether to color the mode indicator with different colors depending on the mode itself | `false` |
| `text-width` | Maximum line length. Used for the `:reflow` command and soft-wrapping if `soft-wrap.wrap-at-text-width` is set | `80` |
| `workspace-lsp-roots` | Directories relative to the workspace root that are treated as LSP roots. Should only be set in `.helix/config.toml` | `[]` |
| `default-line-ending` | The line ending to use for new documents. Can be `native`, `lf`, `crlf`, `ff`, `cr` or `nel`. `native` uses the platform's native line ending (`crlf` on Windows, otherwise `lf`). | `native` |
| `insert-final-newline` | Whether to automatically insert a trailing line-ending on write if missing | `true` |

### `[editor.bufferline]` Section

Allows configuring the bufferline at the top of the editor.

```toml
[editor.bufferline]
show = "always"
style = "scroll"
```

| Key | Description | Default |
| --- | --- | --- |
| `show` | Can be `always`, `never` or `multiple` (only shown if more than one buffer is in use) | `never` |
| `style` | Can be `overflow`, `wrap` or `scroll`. | `overflow` |

### `[editor.statusline]` Section

Allows configuring the statusline at the bottom of the editor.
Expand Down
12 changes: 7 additions & 5 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,13 @@ impl Default for CursorShapeConfig {
}
}

/// bufferline render modes
/// bufferline configuration
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case", default, deny_unknown_fields)]
pub struct BufferLine {
// Set when to show the bufferline
pub show: BufferLineShow,
// Set how to handle overflowing
pub style: BufferLineStyle,
}

Expand All @@ -597,16 +599,16 @@ pub enum BufferLineShow {
Multiple,
}

/// bufferline render
/// bufferline render style
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum BufferLineStyle {
/// Don't render bufferline
/// Overflow bufferline on the right
#[default]
Overflow,
/// Always render
/// Wrap when the bufferline overflows
Wrap,
/// Only if multiple buffers are open
/// Scroll active buffer as centered in the bufferline as possible
Scroll,
}

Expand Down