Fix typos and capitalization of "Unicode" (#3234)

* Capitalize "Unicode"

* Fix several typos

* Fix mixed whitespace in nu-parser's tests
This commit is contained in:
Waldir Pimenta
2021-04-03 20:14:07 +01:00
committed by GitHub
parent e278ca61d1
commit 4bc9d9fd3b
20 changed files with 72 additions and 71 deletions

View File

@ -17,7 +17,7 @@ impl WholeStreamCommand for Autoenv {
// "Mark a .nu-env file in a directory as trusted. Needs to be re-run after each change to the file or its filepath."
r#"Create a file called .nu-env in any directory and run 'autoenv trust' to let nushell load it when entering the directory.
The .nu-env file has the same format as your $HOME/nu/config.toml file. By loading a .nu-env file the following applies:
- environment variables (section \"[env]\") are loaded from the .nu-env file. Those env variables are only existend in this directory (and children directories)
- environment variables (section \"[env]\") are loaded from the .nu-env file. Those env variables only exist in this directory (and children directories)
- the \"startup\" commands are run when entering the directory
- the \"on_exit\" commands are run when leaving the directory
"#

View File

@ -26,8 +26,8 @@ impl WholeStreamCommand for Char {
SyntaxShape::Any,
"the name of the character to output",
)
.rest(SyntaxShape::String, "multiple unicode bytes")
.switch("unicode", "unicode string i.e. 1f378", Some('u'))
.rest(SyntaxShape::String, "multiple Unicode bytes")
.switch("unicode", "Unicode string i.e. 1f378", Some('u'))
}
fn usage(&self) -> &str {
@ -51,12 +51,12 @@ impl WholeStreamCommand for Char {
]),
},
Example {
description: "Output unicode character",
description: "Output Unicode character",
example: r#"char -u 1f378"#,
result: Some(vec![Value::from("\u{1f378}")]),
},
Example {
description: "Output multi-byte unicode character",
description: "Output multi-byte Unicode character",
example: r#"char -u 1F468 200D 1F466 200D 1F466"#,
result: Some(vec![Value::from(
"\u{1F468}\u{200D}\u{1F466}\u{200D}\u{1F466}",
@ -77,7 +77,7 @@ impl WholeStreamCommand for Char {
if unicode {
if !rest.is_empty() {
// Setup a new buffer to put all the unicode bytes in
// Setup a new buffer to put all the Unicode bytes in
let mut multi_byte = String::new();
// Get the first byte
let decoded_char = string_to_unicode_char(&name.item, &name.tag);
@ -104,8 +104,8 @@ impl WholeStreamCommand for Char {
)))
} else {
Err(ShellError::labeled_error(
"error decoding unicode character",
"error decoding unicode character",
"error decoding Unicode character",
"error decoding Unicode character",
name.tag(),
))
}
@ -136,8 +136,8 @@ fn string_to_unicode_char(s: &str, t: &Tag) -> Result<char, ShellError> {
Ok(ch)
} else {
Err(ShellError::labeled_error(
"error decoding unicode character",
"error decoding unicode character",
"error decoding Unicode character",
"error decoding Unicode character",
t,
))
}

View File

@ -41,7 +41,7 @@ impl WholeStreamCommand for Size {
.into()]),
},
Example {
description: "Counts unicode characters correctly in a string",
description: "Counts Unicode characters correctly in a string",
example: r#"echo "Amélie Amelie" | size"#,
result: Some(vec![UntaggedValue::row(indexmap! {
"lines".to_string() => UntaggedValue::int(0).into(),

View File

@ -68,7 +68,7 @@ impl WholeStreamCommand for SubCommand {
result: Some(vec![UntaggedValue::string("123").into_untagged_value()]),
},
Example {
description: "Use lpad to pad unicode",
description: "Use lpad to pad Unicode",
example: "echo '▉' | str lpad -l 10 -c '▉'",
result: Some(vec![
UntaggedValue::string("▉▉▉▉▉▉▉▉▉▉").into_untagged_value()

View File

@ -68,7 +68,7 @@ impl WholeStreamCommand for SubCommand {
result: Some(vec![UntaggedValue::string("123").into_untagged_value()]),
},
Example {
description: "Use rpad to pad unicode",
description: "Use rpad to pad Unicode",
example: "echo '▉' | str rpad -l 10 -c '▉'",
result: Some(vec![
UntaggedValue::string("▉▉▉▉▉▉▉▉▉▉").into_untagged_value()

View File

@ -212,7 +212,7 @@ async fn table(
{
// This is called when the pager finishes, to indicate to the
// while loop below to finish, in case of long running InputStream consumer
// that doesnt finish by the time the user quits out of the pager
// that doesn't finish by the time the user quits out of the pager
pager.lock().await.add_exit_callback(move || {
finished_within_callback.store(true, Ordering::Relaxed);
});