From 1472b417c3d4990ab34572f43150423800f32b19 Mon Sep 17 00:00:00 2001 From: William Ting Date: Tue, 17 Dec 2013 12:04:11 -0600 Subject: [PATCH] clarify detect_smartcase docstring --- bin/autojump | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/autojump b/bin/autojump index a1ea8d9..7beff5e 100755 --- a/bin/autojump +++ b/bin/autojump @@ -191,6 +191,14 @@ def decrease_path(config, path, increment=15): return path, data[path] +def detect_smartcase(needles): + """ + If any needles contain an uppercase letter then use case sensitive + searching. Otherwise use case insensitive searching. + """ + return not any(imap(has_uppercase, needles)) + + def find_matches(config, needles, count=1): """Return [count] paths matching needles.""" entriefy = lambda tup: Entry(*tup)