summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@hut.pm>2018-01-25 12:45:03 +0100
committerhut <hut@hut.pm>2018-01-25 12:45:03 +0100
commite347b6cf556b4a39f5547ec9fd1ae5884d7820a9 (patch)
tree1e6351b6abdc0389f1f753f62a85c0d8b25e3aff /ranger
parent4bb5e4931bf5ccbbc3d9f71e516d607415b7baa7 (diff)
downloadranger-e347b6cf556b4a39f5547ec9fd1ae5884d7820a9.tar.gz
Renamed `cd_tab_smart` to `cd_tab_fuzzy`
"Fuzzy" is the more applicable term here.  "Smart" is often associated
with case sensitivity.  So it would avoid confusion between
`set cd_tab_case smart` and `set cd_tab_smart true`.
Diffstat (limited to 'ranger')
-rwxr-xr-xranger/config/commands.py10
-rw-r--r--ranger/config/rc.conf5
-rw-r--r--ranger/container/settings.py2
3 files changed, 9 insertions, 8 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 2450c1c5..d426b72e 100755
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -200,7 +200,7 @@ class cd(Command):
 
         return [os.path.join(dest_dir, d) for d in dirnames if self._tab_match(dest_base, d)], ''
 
-    def _tab_smart_match(self, basepath, tokens):
+    def _tab_fuzzy_match(self, basepath, tokens):
         """ Find directories matching tokens recursively """
         if not tokens:
             tokens = ['']
@@ -221,7 +221,7 @@ class cd(Command):
 
         return None
 
-    def _tab_smart(self, dest, dest_abs):
+    def _tab_fuzzy(self, dest, dest_abs):
         tokens = []
         basepath = dest_abs
         while True:
@@ -234,7 +234,7 @@ class cd(Command):
                 break
             tokens.append(token)
 
-        paths = self._tab_smart_match(basepath, tokens)
+        paths = self._tab_fuzzy_match(basepath, tokens)
         if not os.path.isabs(dest):
             paths_rel = basepath
             paths = [os.path.relpath(path, paths_rel) for path in paths]
@@ -249,8 +249,8 @@ class cd(Command):
 
         paths, paths_rel = self._tab_paths(dest, dest_abs, ends_with_sep)
         if paths is None:
-            if self.fm.settings.cd_tab_smart:
-                paths, paths_rel = self._tab_smart(dest, dest_abs)
+            if self.fm.settings.cd_tab_fuzzy:
+                paths, paths_rel = self._tab_fuzzy(dest, dest_abs)
             else:
                 paths, paths_rel = self._tab_normal(dest, dest_abs)
 
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index 6bb8f0d0..388e56e6 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -207,8 +207,9 @@ set cd_bookmarks true
 # Changes case sensitivity for the cd command tab completion
 set cd_tab_case sensitive
 
-# Use smart tab completion with less typing? E.g. ":cd /f/b/b<tab>" yields ":cd /foo/bar/baz".
-set cd_tab_smart false
+# Use fuzzy tab completion with the "cd" command. For example,
+# ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
+set cd_tab_fuzzy false
 
 # Avoid previewing files larger than this size, in bytes.  Use a value of 0 to
 # disable this feature.
diff --git a/ranger/container/settings.py b/ranger/container/settings.py
index 2f38a2b6..d0b094d0 100644
--- a/ranger/container/settings.py
+++ b/ranger/container/settings.py
@@ -29,7 +29,7 @@ ALLOWED_SETTINGS = {
     'autoupdate_cumulative_size': bool,
     'cd_bookmarks': bool,
     'cd_tab_case': str,
-    'cd_tab_smart': bool,
+    'cd_tab_fuzzy': bool,
     'clear_filters_on_dir_change': bool,
     'collapse_preview': bool,
     'colorscheme': str,