fix(cli): Report correct column for brief output

This commit is contained in:
Ed Page 2022-11-29 22:25:28 -06:00
parent 2a6c8e9a3a
commit 9b2ca187db

View file

@ -134,7 +134,7 @@ impl Report for PrintLong {
fn print_brief_correction(msg: &Typo, palette: Palette) -> Result<(), std::io::Error> { fn print_brief_correction(msg: &Typo, palette: Palette) -> Result<(), std::io::Error> {
let start = String::from_utf8_lossy(&msg.buffer[0..msg.byte_offset]); let start = String::from_utf8_lossy(&msg.buffer[0..msg.byte_offset]);
let column_number = let column_number =
unicode_segmentation::UnicodeSegmentation::graphemes(start.as_ref(), true).count(); unicode_segmentation::UnicodeSegmentation::graphemes(start.as_ref(), true).count() + 1;
match &msg.corrections { match &msg.corrections {
typos::Status::Valid => {} typos::Status::Valid => {}
typos::Status::Invalid => { typos::Status::Invalid => {