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

feat: relative numbers #485

Merged
merged 10 commits into from
Aug 16, 2021
Next Next commit
feat(helix-view): configuring line-number
gbaranski committed Aug 10, 2021
commit 08dff863ccb028afd6f60807f4110c3c91d266e6
16 changes: 16 additions & 0 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
@@ -29,6 +29,21 @@ pub struct Config {
pub scroll_lines: isize,
/// Mouse support. Defaults to true.
pub mouse: bool,
/// Line number mode.
pub line_number: LineNumber,
}

#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum LineNumber {
/// No line number will be displayed
None,

/// Show absolute line number
Absolute,

/// Show relative line number to the primary cursor
Relative,
gbaranski marked this conversation as resolved.
Show resolved Hide resolved
}

impl Default for Config {
@@ -37,6 +52,7 @@ impl Default for Config {
scrolloff: 5,
scroll_lines: 3,
mouse: true,
line_number: LineNumber::Absolute,
}
}
}