diff options
Diffstat (limited to 'ranger/core/actions.py')
-rw-r--r-- | ranger/core/actions.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 5b18fae4..115faaa0 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -14,6 +14,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import os +import re import shutil from os.path import join, isdir from os import symlink, getcwd @@ -275,6 +276,12 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): # -- Searching # -------------------------- + def search_file(self, text, regexp=True): + if isinstance(text, str) and regexp: + text = re.compile(text, re.L | re.U | re.I) + self.env.last_search = text + self.search(order='search') + def search(self, order=None, forward=True): original_order = order if self.search_forward: |