From 56f380c61f62a18b39375da7e7cd93d443be8aef Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 28 Aug 2010 08:10:34 +0200 Subject: cleaned up and fine tuned :find command --- ranger/defaults/commands.py | 18 +++++++----------- 1 file 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 -- cgit 1.4.1-2-gfad0