aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorGrzegorz Baranski2021-08-26 17:48:33 +0000
committerGitHub2021-08-26 17:48:33 +0000
commitcec5d437d892767ccbc49cfcb20b4561ce24576d (patch)
treee8aa4707b0c7a38ba730ff359e09925ec6efb674 /helix-term/src
parent6192f2fa250e3aa10e514547c69ae901aebed657 (diff)
fix: show current line number even if relative line is on (#656)
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/ui/editor.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 4da8bfd5..72b8adc1 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -462,7 +462,13 @@ impl EditorView {
} else {
let line = match config.line_number {
LineNumber::Absolute => line + 1,
- LineNumber::Relative => abs_diff(current_line, line),
+ LineNumber::Relative => {
+ if current_line == line {
+ line + 1
+ } else {
+ abs_diff(current_line, line)
+ }
+ }
};
format!("{:>5}", line)
};