summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-15 19:43:53 +0100
committerhut <hut@lavabit.com>2013-02-15 19:43:53 +0100
commit808a191c3cc848e25bd13356fe9300cb8fb04f2a (patch)
tree736b9fd2d8eebea7f9f454f6ddb0879aee58b1bd
parentd4979d452e269113fb5edd0da3d47ce5ce5c5786 (diff)
downloadranger-808a191c3cc848e25bd13356fe9300cb8fb04f2a.tar.gz
Revert "config/commands: added :scout command for faster ":find"ing"
This reverts commit f24817eece19aafba5dd7399c2dd3c212dacf29b.
-rw-r--r--ranger/config/commands.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 7411face..863de2e6 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -1056,65 +1056,6 @@ class pmap(map_):
     context = 'pager'
 
 
-class scout(Command):
-    def quick(self, cycle=False):
-        count = 0
-        cwd = self.fm.thisdir
-        arg = self.rest(1)
-        emptyline = "%s " % self.__class__.__name__
-
-        if not arg:
-            return False
-
-        if arg == '.':
-            self.fm.thistab.enter_dir("..")
-            self.updated_line = emptyline
-            return False
-
-        # build regular expression
-        regex = "%s"
-        if arg.endswith("$"):
-            arg = arg[:-1]
-            regex += "$"
-        if arg.startswith("^"):
-            arg = arg[1:]
-            regex = "^" + regex
-
-        case_insensitive = arg.lower() == arg
-        regex = re.compile(regex % ".*".join(arg), case_insensitive and re.I)
-
-        def check(name):
-            return re.search(regex, name)
-
-        # build deque of files and cycle through them
-        deq = deque(cwd.files)
-        deq.rotate(-cwd.pointer)
-        i = 0
-        if cycle:
-            # make another step forward when TAB was pressed
-            deq.rotate(-1)
-            i += 1
-        moved = False
-        for fsobj in deq:
-            if check(fsobj.basename):
-                count += 1
-                if not moved:
-                    cwd.move(to=(cwd.pointer + i) % len(cwd.files))
-                    moved = True
-            i += 1
-
-        if count == 1:
-            if self.fm.thisfile.is_directory:
-                self.fm.move(right=1)
-                self.updated_line = emptyline
-            else:
-                return True
-        return False
-
-    def tab(self):
-        self.quick(cycle=True)
-
-
 class filter(Command):
     """
     :filter <string>