mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
[yabridgectl] Downgrade textwrap again
Partially reverts f02b9e646b. Newer
versions don't take the indentation into account when wrapping.
This commit is contained in:
@@ -30,6 +30,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
- Fixed builds on Wine 6.8 because of internal changes to Wine's `windows.h`
|
- Fixed builds on Wine 6.8 because of internal changes to Wine's `windows.h`
|
||||||
implementation.
|
implementation.
|
||||||
|
|
||||||
|
### yabridgectl
|
||||||
|
|
||||||
|
- Fixed text wrapping being broken after a dependency update earlier this year.
|
||||||
|
|
||||||
## [3.2.0] - 2021-05-03
|
## [3.2.0] - 2021-05-03
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
Generated
+16
-13
@@ -438,12 +438,6 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "smawk"
|
|
||||||
version = "0.3.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
@@ -461,6 +455,16 @@ dependencies = [
|
|||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "term_size"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "termcolor"
|
name = "termcolor"
|
||||||
version = "1.1.2"
|
version = "1.1.2"
|
||||||
@@ -482,21 +486,20 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "textwrap"
|
name = "textwrap"
|
||||||
version = "0.12.1"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789"
|
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"terminal_size",
|
"term_size",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "textwrap"
|
name = "textwrap"
|
||||||
version = "0.13.4"
|
version = "0.12.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cd05616119e612a8041ef58f2b578906cc2531a6069047ae092cfb86a325d835"
|
checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"smawk",
|
|
||||||
"terminal_size",
|
"terminal_size",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
]
|
]
|
||||||
@@ -624,7 +627,7 @@ dependencies = [
|
|||||||
"rayon",
|
"rayon",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"textwrap 0.13.4",
|
"textwrap 0.11.0",
|
||||||
"toml",
|
"toml",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
"which",
|
"which",
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ promptly = "0.3.0"
|
|||||||
rayon = "1.3.1"
|
rayon = "1.3.1"
|
||||||
serde = "1.0.114"
|
serde = "1.0.114"
|
||||||
serde_derive = "1.0.114"
|
serde_derive = "1.0.114"
|
||||||
textwrap = { version = "0.13.4", features = ["terminal_size"] }
|
# NOTE: textwrap 0.12.0 up to at least 0.13.4 apply the subsequent indent after
|
||||||
|
# wrapping
|
||||||
|
textwrap = { version = "0.11.0", features = ["term_size"] }
|
||||||
toml = "0.5.6"
|
toml = "0.5.6"
|
||||||
walkdir = "2.3.1"
|
walkdir = "2.3.1"
|
||||||
which = "4.0.1"
|
which = "4.0.1"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ use std::os::unix::fs as unix_fs;
|
|||||||
use std::os::unix::process::CommandExt;
|
use std::os::unix::process::CommandExt;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
use textwrap;
|
use textwrap::Wrapper;
|
||||||
|
|
||||||
use crate::config::{self, Config, KnownConfig, YABRIDGE_HOST_EXE_NAME};
|
use crate::config::{self, Config, KnownConfig, YABRIDGE_HOST_EXE_NAME};
|
||||||
use crate::files::NativeFile;
|
use crate::files::NativeFile;
|
||||||
@@ -341,10 +341,7 @@ pub fn verify_wine_setup(config: &mut Config) -> Result<()> {
|
|||||||
/// Wrap a long paragraph of text to terminal width, or 80 characters if the width of the terminal
|
/// Wrap a long paragraph of text to terminal width, or 80 characters if the width of the terminal
|
||||||
/// can't be determined. Everything after the first line gets indented with four spaces.
|
/// can't be determined. Everything after the first line gets indented with four spaces.
|
||||||
pub fn wrap(text: &str) -> String {
|
pub fn wrap(text: &str) -> String {
|
||||||
textwrap::fill(
|
let wrapper = Wrapper::with_termwidth().subsequent_indent(" ");
|
||||||
text,
|
|
||||||
textwrap::Options::new(textwrap::termwidth())
|
wrapper.fill(text)
|
||||||
.splitter(textwrap::NoHyphenation)
|
|
||||||
.subsequent_indent(" "),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user