fix: line numbers now start at 1
This commit is contained in:
parent
660b710cac
commit
0a67beb76f
1 changed files with 2 additions and 2 deletions
|
|
@ -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),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue