summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--doc/ranger.116
-rw-r--r--doc/ranger.pod7
-rw-r--r--doc/rifle.12
-rw-r--r--ranger/config/rc.conf3
-rw-r--r--ranger/container/directory.py10
-rw-r--r--ranger/container/settings.py1
-rw-r--r--ranger/ext/img_display.py2
7 files changed, 36 insertions, 5 deletions
diff --git a/doc/ranger.1 b/doc/ranger.1
index 03687636..c0971d47 100644
--- a/doc/ranger.1
+++ b/doc/ranger.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RANGER 1"
-.TH RANGER 1 "ranger-1.6.1" "06/21/2013" "ranger manual"
+.TH RANGER 1 "ranger-1.6.1" "04/11/2014" "ranger manual"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -559,6 +559,12 @@ The different types of settings and an example for each type:
 .PP
 You can view a list of all settings and their current values by pressing \*(L"3?\*(R"
 in ranger.
+.IP "automatically_count_files [bool]" 4
+.IX Item "automatically_count_files [bool]"
+Should ranger count and display the number of files in each directory
+as soon as it's visible?  This gets slow with remote file sytems.  Turning it
+off will still allow you to see the number of files after entering the
+directory.
 .IP "autosave_bookmarks [bool]" 4
 .IX Item "autosave_bookmarks [bool]"
 Save bookmarks (used with mX and `X) instantly?  This helps to synchronize
@@ -570,6 +576,10 @@ You can display the \*(L"real\*(R" cumulative size of directories by using the c
 :get_cumulative_size or typing \*(L"dc\*(R".  The size is expensive to calculate and
 will not be updated automatically.  You can choose to update it automatically
 though by turning on this option.
+.IP "cd_bookmarks [bool]" 4
+.IX Item "cd_bookmarks [bool]"
+Specify whether bookmarks should be included in the tab completion of the \*(L"cd\*(R"
+command.
 .IP "collapse_preview [bool] <zc>" 4
 .IX Item "collapse_preview [bool] <zc>"
 When no preview is visible, should the last column be squeezed to make use of
@@ -645,6 +655,10 @@ Preview files in the preview column?
 .IP "preview_images [bool]" 4
 .IX Item "preview_images [bool]"
 Draw images inside the console with the external program w3mimgpreview?
+.IP "preview_max_size [int]" 4
+.IX Item "preview_max_size [int]"
+Avoid previewing files that exceed a certain size, in bytes.  Use a value of 0
+to disable this feature.
 .IP "preview_script [string, none]" 4
 .IX Item "preview_script [string, none]"
 Which script should handle generating previews?  If the file doesn't exist, or
diff --git a/doc/ranger.pod b/doc/ranger.pod
index b48cdcf7..7dc50d32 100644
--- a/doc/ranger.pod
+++ b/doc/ranger.pod
@@ -517,6 +517,13 @@ in ranger.
 
 =over
 
+=item automatically_count_files [bool]
+
+Should ranger count and display the number of files in each directory
+as soon as it's visible?  This gets slow with remote file sytems.  Turning it
+off will still allow you to see the number of files after entering the
+directory.
+
 =item autosave_bookmarks [bool]
 
 Save bookmarks (used with mX and `X) instantly?  This helps to synchronize
diff --git a/doc/rifle.1 b/doc/rifle.1
index 6395a34d..df63d118 100644
--- a/doc/rifle.1
+++ b/doc/rifle.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RIFLE 1"
-.TH RIFLE 1 "rifle-1.6.1" "06/21/2013" "rifle manual"
+.TH RIFLE 1 "rifle-1.6.1" "04/11/2014" "rifle manual"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index e5d68926..7487e8be 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -41,6 +41,9 @@ set preview_script ~/.config/ranger/scope.sh
 # Use the external preview script or display simple plain text or image previews?
 set use_preview_script true
 
+# Automatically count files in the directory, even before entering them?
+set automatically_count_files false
+
 # Open all images in this directory when running certain image viewers
 # like feh or sxiv?  You can still open selected files by marking them.
 set open_all_images true
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index b63907db..136cc8ac 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -395,14 +395,20 @@ class Directory(FileSystemObject, Accumulator, Loadable):
     @lazy_property
     def size(self):
         try:
-            size = len(os.listdir(self.path))  # bite me
+            if self.fm.settings.automatically_count_files:
+                size = len(os.listdir(self.path))
+            else:
+                size = None
         except OSError:
             self.infostring = BAD_INFO
             self.accessible = False
             self.runnable = False
             return 0
         else:
-            self.infostring = ' %d' % size
+            if size is None:
+                self.infostring = ''
+            else:
+                self.infostring = ' %d' % size
             self.accessible = True
             self.runnable = True
             return size
diff --git a/ranger/container/settings.py b/ranger/container/settings.py
index 44bd60e0..90b6f7ce 100644
--- a/ranger/container/settings.py
+++ b/ranger/container/settings.py
@@ -9,6 +9,7 @@ import re
 import os.path
 
 ALLOWED_SETTINGS = {
+    'automatically_count_files': bool,
     'autosave_bookmarks': bool,
     'autoupdate_cumulative_size': bool,
     'cd_bookmarks': bool,
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py
index d470fb24..a70fe366 100644
--- a/ranger/ext/img_display.py
+++ b/ranger/ext/img_display.py
@@ -30,12 +30,12 @@ class ImageDisplayer(object):
 
     def initialize(self):
         """start w3mimgdisplay"""
-        self.is_initialized = True
         self.binary_path = os.environ.get("W3MIMGDISPLAY_PATH", None)
         if not self.binary_path:
             self.binary_path = W3MIMGDISPLAY_PATH
         self.process = Popen([self.binary_path] + W3MIMGDISPLAY_OPTIONS,
                 stdin=PIPE, stdout=PIPE, universal_newlines=True)
+        self.is_initialized = True
 
     def draw(self, path, start_x, start_y, width, height):
         """Draw an image at the given coordinates."""