mirror of
https://github.com/nushell/nushell.git
synced 2025-01-03 04:50:28 +01:00
Bump ansi-cut version to 0.2.0 (#822)
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
parent
3d40e169ce
commit
fd3eec81b5
@ -18,5 +18,5 @@ nu-protocol = { path = "../nu-protocol"}
|
|||||||
regex = "1.4"
|
regex = "1.4"
|
||||||
unicode-width = "0.1.8"
|
unicode-width = "0.1.8"
|
||||||
strip-ansi-escapes = "0.1.1"
|
strip-ansi-escapes = "0.1.1"
|
||||||
ansi-cut = "0.1.1"
|
ansi-cut = "0.2.0"
|
||||||
atty = "0.2.14"
|
atty = "0.2.14"
|
||||||
|
@ -152,7 +152,7 @@ fn split_word(cell_width: usize, word: &str) -> Vec<Subline> {
|
|||||||
let mut end_index;
|
let mut end_index;
|
||||||
|
|
||||||
let word_no_ansi = strip_ansi(word);
|
let word_no_ansi = strip_ansi(word);
|
||||||
for c in word_no_ansi.chars().enumerate() {
|
for c in word_no_ansi.char_indices() {
|
||||||
if let Some(width) = c.1.width() {
|
if let Some(width) = c.1.width() {
|
||||||
end_index = c.0;
|
end_index = c.0;
|
||||||
if current_width + width > cell_width {
|
if current_width + width > cell_width {
|
||||||
@ -169,7 +169,7 @@ fn split_word(cell_width: usize, word: &str) -> Vec<Subline> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if start_index != word_no_ansi.chars().count() {
|
if start_index != word_no_ansi.len() {
|
||||||
output.push(Subline {
|
output.push(Subline {
|
||||||
subline: word.cut(start_index..),
|
subline: word.cut(start_index..),
|
||||||
width: current_width,
|
width: current_width,
|
||||||
|
Loading…
Reference in New Issue
Block a user