From fcd99d9c22b7187c764144ca2dadc2f6db485330 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 26 Dec 2016 22:10:25 +0000 Subject: [PATCH] Use absolute distance for relative line numbering Closes #1068 --- src/highlighters.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 21b557c4..3b761fcc 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -752,7 +752,7 @@ void show_line_numbers(const Context& context, HighlightFlags flags, const int line_to_format = (relative and not is_cursor_line) ? current_line - main_selection : current_line; char buffer[16]; - snprintf(buffer, 16, format, line_to_format); + snprintf(buffer, 16, format, std::abs(line_to_format)); DisplayAtom atom{buffer}; atom.face = (hl_cursor_line and is_cursor_line) ? face_absolute : face; line.insert(line.begin(), std::move(atom));