Skip to content

Commit

Permalink
Print an empty line between previews (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
denisidoro committed Apr 22, 2021
1 parent 30fbb30 commit c9701db
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
@@ -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"
Expand Down
8 changes: 5 additions & 3 deletions src/actor.rs
Expand Up @@ -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 {
Expand All @@ -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,
)
};
Expand Down
2 changes: 2 additions & 0 deletions src/handler/preview_var_stdin.rs
Expand Up @@ -15,6 +15,8 @@ pub fn main() -> Result<()> {

if let Some(extra) = parts.next() {
if !extra.is_empty() {
print!("");

shell::out()
.arg(extra)
.spawn()
Expand Down

0 comments on commit c9701db

Please sign in to comment.