Skip to content

Commit 4c305e1

Browse files
authored
[bug fix] only shows upper few lines (#14)
* add comment * fix_10
1 parent 8b3fad9 commit 4c305e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/misc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ pub fn print_error(error_message: String) {
1313
println!("[ERR] {}", error_message);
1414
}
1515

16+
// TODO: Maybe skim related could be combined into one module.
1617
pub fn get_params<'a>() -> (SkimOptions<'a>, Option<Receiver<Arc<dyn SkimItem>>>) {
1718
// TODO: use cat when bat is unavailable
18-
let preview_command = "bat --style=numbers --color=always --highlight-line $(bat Makefile | grep -nE '^{}' | sed -e 's/:.*//g') Makefile";
19+
let preview_command = r"line=$(bat Makefile | grep -nE '^{}\s*:' | sed -e 's/:.*//g'); bat --style=numbers --color=always --line-range $line: --highlight-line $line Makefile";
1920
// TODO: hide fzf window when fzf-make terminated
2021
let options = SkimOptionsBuilder::default()
2122
.height(Some("50%"))

0 commit comments

Comments
 (0)