From da6ad5df452ea4304728d4137f9fd5603b95071a Mon Sep 17 00:00:00 2001 From: Robert Ricci Date: Mon, 4 Jun 2018 15:43:03 -0600 Subject: [PATCH] Switch to generic hash instead of sha1 specifically Suggested by @maximbaz --- kittens/hints/main.py | 6 +++--- kitty/kitty.conf | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kittens/hints/main.py b/kittens/hints/main.py index 49b2a7d25..880c4639a 100644 --- a/kittens/hints/main.py +++ b/kittens/hints/main.py @@ -244,8 +244,8 @@ def functions_for(args): post_processors.extend((brackets, quotes)) elif args.type == 'line': pattern = '(?m)^\\s*(.+)[\\s\0]*$' - elif args.type == 'sha1': - pattern = '[0-9a-f]{7,40}' + elif args.type == 'hash': + pattern = '[0-9a-f]{7,128}' elif args.type == 'word': chars = args.word_characters if chars is None: @@ -315,7 +315,7 @@ terminal window instead. A value of :file:`@` will copy the match to the clipboa --type default=url -choices=url,regex,path,line,sha1,word +choices=url,regex,path,line,hash,word The type of text to search for. diff --git a/kitty/kitty.conf b/kitty/kitty.conf index d2592202c..5756d0f41 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -490,9 +490,9 @@ map kitty_mod+e kitten hints # run git commands on a filename output from a previous git command. map kitty_mod+p>f kitten hints --type path --program - -# Select something that looks like a SHA1 hash and insert it into the terminal. +# Select something that looks like a hash and insert it into the terminal. # Useful with git, which uses sha1 hashes to identify commits -map kitty_mod+p>s kitten hints --type sha1 --program - +map kitty_mod+p>h kitten hints --type hash --program - # Select a path/filename and open it with the default open program. map kitty_mod+p>shift+f kitten hints --type path