summary refs log tree commit diff stats
path: root/ranger
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 /ranger
parentd4979d452e269113fb5edd0da3d47ce5ce5c5786 (diff)
downloadranger-808a191c3cc848e25bd13356fe9300cb8fb04f2a.tar.gz
Revert "config/commands: added :scout command for faster ":find"ing"
This reverts commit f24817eece19aafba5dd7399c2dd3c212dacf29b.
Diffstat (limited to 'ranger')
-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>
alt'>
22bb7e35 ^
3dbefa71 ^
22bb7e35 ^


3dbefa71 ^
22bb7e35 ^








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59