fix: show current line number even if relative line is on (#656)

This commit is contained in:
Grzegorz Baranski 2021-08-26 19:48:33 +02:00 committed by GitHub
parent 6192f2fa25
commit cec5d437d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -462,7 +462,13 @@ impl EditorView {
} else { } else {
let line = match config.line_number { let line = match config.line_number {
LineNumber::Absolute => line + 1, 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) format!("{:>5}", line)
}; };