diff options
author | hut <hut@lavabit.com> | 2010-08-28 08:10:34 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-08-28 08:10:34 +0200 |
commit | 56f380c61f62a18b39375da7e7cd93d443be8aef (patch) | |
tree | 026dd8a65b8af9c5553d56f16e9382925e42f4c5 | |
parent | b80a91f6fc0f8fb7af50fff9956d54da20304c9c (diff) | |
download | ranger-56f380c61f62a18b39375da7e7cd93d443be8aef.tar.gz |
cleaned up and fine tuned :find command
-rw-r--r-- | ranger/defaults/commands.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index adc166df..f1c92274 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -260,22 +260,13 @@ class find(Command): tab = Command._tab_directory_content def execute(self): - import re - search = parse(self.line).rest(1) - search = re.escape(search) - self.fm.env.last_search = re.compile(search, re.IGNORECASE) - self.fm.search_method = 'search' - if self.count == 1: self.fm.move(right=1) self.fm.block_input(0.5) + else: + self.fm.cd(parse(self.line).rest(1)) def quick(self): - self._search() - if self.count == 1: - return True - - def _search(self): self.count = 0 line = parse(self.line) cwd = self.fm.env.cwd @@ -284,6 +275,11 @@ class find(Command): except IndexError: return False + if arg == '.': + return False + if arg == '..': + return True + deq = deque(cwd.files) deq.rotate(-cwd.pointer) i = 0 |