fix: line numbers now start at 1

This commit is contained in:
Mohammad Kanaan 2026-07-27 13:03:14 +03:00
parent 660b710cac
commit 0a67beb76f

View file

@ -6,7 +6,7 @@ use std::{
use anyhow::Context; use anyhow::Context;
use regex::Regex; use regex::Regex;
use crate::matches::{self, Match, Matches}; use crate::matches::{Match, Matches};
pub fn read_lines( pub fn read_lines(
file_path: &str, file_path: &str,
@ -42,7 +42,7 @@ pub fn match_pattern(
if reg.is_match(&line) { if reg.is_match(&line) {
let m = Match { let m = Match {
line_number: idx, line_number: idx + 1,
text: line, text: line,
file_name: get_file_name_from_path(file_path), file_name: get_file_name_from_path(file_path),
}; };