summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2014-02-15 13:05:48 +0100
committerhut <hut@lepus.uberspace.de>2014-02-15 13:05:48 +0100
commitaa594ec92b015c5d26698136e6aca61815d1e4b4 (patch)
tree88084faea9514de03266f362372f708d85df5d20
parenta4f1c363597fe63e94f6f9a48a05fe63e9903b82 (diff)
parent23345a7875357405c774d47335322aee933692c0 (diff)
downloadranger-aa594ec92b015c5d26698136e6aca61815d1e4b4.tar.gz
Merge branch 'master' of https://github.com/punzik/ranger
-rw-r--r--ranger/container/file.py2
-rw-r--r--ranger/container/settings.py1
2 files changed, 3 insertions, 0 deletions
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 27fed711..f46acd38 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,