Print an empty line between previews (#536)

This commit is contained in:
Denis Isidoro 2021-04-22 09:58:20 -03:00 committed by GitHub
parent 30fbb30514
commit c9701db6ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 5 deletions

2
Cargo.lock generated
View file

@ -320,7 +320,7 @@ dependencies = [
[[package]]
name = "navi"
version = "2.16.0"
version = "2.16.1"
dependencies = [
"anyhow",
"clap",

View file

@ -1,6 +1,6 @@
[package]
name = "navi"
version = "2.16.0"
version = "2.16.1"
authors = ["Denis Isidoro <denis_isidoro@live.com>"]
edition = "2018"
description = "An interactive cheatsheet tool for the command-line"

View file

@ -76,14 +76,13 @@ fn prompt_finder(
};
let exe = fs::exe_string();
let extra = extra_preview.clone().unwrap_or_default();
let preview = if cfg!(target_os = "windows") {
format!(
r#"(@echo.{{+}}{eof}{{q}}{eof}{name}{eof}{extra}) | {exe} preview-var-stdin"#,
exe = exe,
name = variable_name,
extra = extra,
extra = extra_preview.clone().unwrap_or_default(),
eof = EOF,
)
} else {
@ -97,7 +96,10 @@ fn prompt_finder(
)" "{name}"; {extra}"#,
exe = exe,
name = variable_name,
extra = extra,
extra = extra_preview
.clone()
.map(|e| format!(" echo; {}", e))
.unwrap_or_default(),
eof = EOF,
)
};

View file

@ -15,6 +15,8 @@ pub fn main() -> Result<()> {
if let Some(extra) = parts.next() {
if !extra.is_empty() {
print!("");
shell::out()
.arg(extra)
.spawn()