fix unicode-width version to 0.1.13

This commit is contained in:
ehwan 2024-06-19 14:06:15 +09:00 committed by Wei Zhang
parent 5918660f48
commit b0d55bb846
3 changed files with 7 additions and 5 deletions

4
Cargo.lock generated
View file

@ -1257,9 +1257,9 @@ dependencies = [
[[package]]
name = "unicode-width"
version = "0.1.11"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
[[package]]
name = "unsafe-libyaml"

View file

@ -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.*"

View file

@ -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;
}
}
@ -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
}
}
}