From 721718eee4eec0d52b9dbf68db8fea8fdba25a0c Mon Sep 17 00:00:00 2001 From: Joscha Date: Sun, 9 Jan 2022 16:49:10 +0100 Subject: [PATCH] Fix line numbers in show command --- src/cli/show.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/show.rs b/src/cli/show.rs index 3eefd9c..4ed8470 100644 --- a/src/cli/show.rs +++ b/src/cli/show.rs @@ -14,9 +14,9 @@ use super::util; fn fmt_where(files: &Files, command: &Sourced<'_, Spanned>) -> String { let name = files.name(command.source.file()).expect("file exists"); let line = files - .line_number(command.source.file(), command.value.span.start) + .line_index(command.source.file(), command.value.span.start) .expect("file exists and line is valid"); - format!("Line {} in {}", line, name) + format!("Line {} in {}", line + 1, name) } fn print_desc(command: &Sourced<'_, Spanned>) {