From dc2d267244d6dd9d991207fe193e987b6477c415 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 1 Nov 2025 23:29:36 +0200 Subject: Fix fzf not opening on empty input (v0.3.1) Amp-Thread-ID: https://ampcode.com/threads/T-9aec59d6-cd27-4607-ac11-baac5f2ca758 Co-authored-by: Amp --- geheim.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/geheim.rb b/geheim.rb index 992e4af..8c1b7ed 100755 --- a/geheim.rb +++ b/geheim.rb @@ -10,7 +10,7 @@ require 'openssl' require 'json' require 'readline' -VERSION = 'v0.3.0' +VERSION = 'v0.3.1' # Configuration class Config @@ -641,13 +641,12 @@ class CLI input = Readline.readline('% ', true) break if input.nil? # Handle Ctrl+D + argv = input.strip.split + # Don't add empty lines or duplicates to history - Readline::HISTORY.pop if input.strip.empty? || + Readline::HISTORY.pop if argv.empty? || (Readline::HISTORY.length > 1 && Readline::HISTORY[-1] == Readline::HISTORY[-2]) - - argv = input.strip.split - next if argv.empty? end geheim = Geheim.new -- cgit v1.2.3