Skip to content

Commit

Permalink
fix unicode-width version to 0.1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
ehwan authored and zwpaper committed Aug 20, 2024
1 parent 5918660 commit b0d55bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ once_cell = "1.17.1"
chrono = { version = "0.4.19", features = ["unstable-locales"] }
chrono-humanize = "0.2"
# unicode-width 0.1.13 has a breaking change so stick to 0.1.11
unicode-width = "=0.1.11"
unicode-width = "0.1.13"
lscolors = "0.16.0"
wild = "2.0"
globset = "0.4.*"
Expand Down
6 changes: 4 additions & 2 deletions src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ fn get_visible_width(input: &str, hyperlink: bool) -> usize {

let m_pos = s.find('m');
if let Some(len) = m_pos {
nb_invisible_char += len
// len points to the 'm' character, we must include 'm' to invisible characters
nb_invisible_char += len + 1;
}
}

Expand All @@ -449,7 +450,8 @@ fn get_visible_width(input: &str, hyperlink: bool) -> usize {

let m_pos = s.find("\x1B\x5C");
if let Some(len) = m_pos {
nb_invisible_char += len
// len points to the '\x1B' character, we must include both '\x1B' and '\x5C' to invisible characters
nb_invisible_char += len + 2
}
}
}
Expand Down

0 comments on commit b0d55bb

Please sign in to comment.