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 {
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)
};