summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-11-01 23:29:36 +0200
committerPaul Buetow <paul@buetow.org>2025-11-01 23:29:36 +0200
commitdc2d267244d6dd9d991207fe193e987b6477c415 (patch)
tree99e13fa68e0add5afd6d0901a90be440d9fc6561
parentbb9f2c6f49103fdc3a771c09ac96811e0745c1ec (diff)
Fix fzf not opening on empty input (v0.3.1)HEADv0.3.1master
Amp-Thread-ID: https://ampcode.com/threads/T-9aec59d6-cd27-4607-ac11-baac5f2ca758 Co-authored-by: Amp <amp@ampcode.com>
-rwxr-xr-xgeheim.rb9
1 files 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