From 23345a7875357405c774d47335322aee933692c0 Mon Sep 17 00:00:00 2001 From: Nikolay Puzanov Date: Tue, 3 Dec 2013 14:58:59 +0400 Subject: Add preview_max_size option. --- ranger/container/file.py | 2 ++ ranger/container/settings.py | 1 + 2 files changed, 3 insertions(+) diff --git a/ranger/container/file.py b/ranger/container/file.py index 7c11dc63..3205ce61 100644 --- a/ranger/container/file.py +++ b/ranger/container/file.py @@ -68,6 +68,8 @@ class File(FileSystemObject): return False if not self.accessible: return False + if self.size > self.fm.settings.preview_max_size: + return False if self.fm.settings.preview_script and \ self.fm.settings.use_preview_script: return True diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 58ddffc9..29e6d729 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -31,6 +31,7 @@ ALLOWED_SETTINGS = { 'preview_files': bool, 'preview_images': bool, 'preview_script': (str, type(None)), + 'preview_max_size': int, 'save_console_history': bool, 'scroll_offset': int, 'shorten_title': int, -- cgit 1.4.1-2-gfad0