From 4d3d292b1826d361df5f8396c5b5cc0dd85132f8 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Tue, 22 Apr 2025 11:10:36 -0400 Subject: [PATCH] use fzf --scheme=history Per the man page, this is the scoring scheme tailored for chronological history data. It could also be nice to remove duplicates. --- changelog.md | 1 + mycli/packages/toolkit/fzf.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 6c8547d0..3638bae3 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ Upcoming Release (TBD) Features -------- * Added explicit error handle to get_password_from_file with EAFP. +* Use the "history" scheme for fzf searches. Internal -------- diff --git a/mycli/packages/toolkit/fzf.py b/mycli/packages/toolkit/fzf.py index 5aeebe3b..8eb2763e 100644 --- a/mycli/packages/toolkit/fzf.py +++ b/mycli/packages/toolkit/fzf.py @@ -34,7 +34,7 @@ def search_history(event: KeyPressEvent): formatted_history_items.append(f"{timestamp} {formatted_item}") original_history_items.append(item) - result = fzf.prompt(formatted_history_items, fzf_options="--tiebreak=index") + result = fzf.prompt(formatted_history_items, fzf_options="--scheme=history --tiebreak=index") if result: selected_index = formatted_history_items.index(result[0])