diff options
author | hut <hut@hut.pm> | 2017-07-16 06:48:11 +0200 |
---|---|---|
committer | hut <hut@hut.pm> | 2017-07-16 06:50:33 +0200 |
commit | 5c0555501aeb32301dacd4bf1c973b216b207644 (patch) | |
tree | c6dc55c6d4e813b7b639ae49c194c3e688191202 | |
parent | d7849c70acbb0704931abdb3869d961f189cb8e0 (diff) | |
download | ranger-5c0555501aeb32301dacd4bf1c973b216b207644.tar.gz |
add "F" key to toggle new "freeze_files" option
Excerpt from man page: Toggle "freeze_files" setting. When active, directories and files will not be loaded, improving performance when all the files you need are already loaded. This does not affect file previews, which can be toggled with "zI".
-rw-r--r-- | doc/ranger.1 | 13 | ||||
-rw-r--r-- | doc/ranger.pod | 13 | ||||
-rw-r--r-- | doc/rifle.1 | 2 | ||||
-rw-r--r-- | ranger/config/rc.conf | 1 | ||||
-rw-r--r-- | ranger/container/directory.py | 2 | ||||
-rw-r--r-- | ranger/container/fsobject.py | 5 | ||||
-rw-r--r-- | ranger/container/settings.py | 1 |
7 files changed, 34 insertions, 3 deletions
diff --git a/doc/ranger.1 b/doc/ranger.1 index 045d8b95..4c8267f2 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.0b5" "2017-06-16" "ranger manual" +.TH RANGER 1 "ranger-1.9.0b5" "07/16/2017" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -489,6 +489,12 @@ Move up and down in the parent directory. .IP "^R" 14 .IX Item "^R" Reload everything +.IP "F" 14 +.IX Item "F" +Toggle \fIfreeze_files\fR setting. When active, directories and files will not be +loaded, improving performance when all the files you need are already loaded. +This does not affect file previews, which can be toggled with \fIzI\fR. Also try +disabling the preview of directories with \fIzP\fR. .IP "^L" 14 .IX Item "^L" Redraw the screen @@ -767,6 +773,11 @@ currently running tasks which support progress bars? Flush the input after each key hit? One advantage is that when scrolling down with \*(L"j\*(R", ranger stops scrolling instantly when you release the key. One disadvantage is that when you type commands blindly, some keys might get lost. +.IP "freeze_files [bool] <F>" 4 +.IX Item "freeze_files [bool] <F>" +When active, directories and files will not be loaded, improving performance +when all the files you need are already loaded. This does not affect file +previews. .IP "hidden_filter [string]" 4 .IX Item "hidden_filter [string]" A regular expression pattern for files which should be hidden. For example, diff --git a/doc/ranger.pod b/doc/ranger.pod index d9dd6b3d..f5e03b5a 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -401,6 +401,13 @@ Move up and down in the parent directory. Reload everything +=item F + +Toggle I<freeze_files> setting. When active, directories and files will not be +loaded, improving performance when all the files you need are already loaded. +This does not affect file previews, which can be toggled with I<zI>. Also try +disabling the preview of directories with I<zP>. + =item ^L Redraw the screen @@ -758,6 +765,12 @@ Flush the input after each key hit? One advantage is that when scrolling down with "j", ranger stops scrolling instantly when you release the key. One disadvantage is that when you type commands blindly, some keys might get lost. +=item freeze_files [bool] <F> + +When active, directories and files will not be loaded, improving performance +when all the files you need are already loaded. This does not affect file +previews. + =item hidden_filter [string] A regular expression pattern for files which should be hidden. For example, diff --git a/doc/rifle.1 b/doc/rifle.1 index 95c9ce50..aefc3979 100644 --- a/doc/rifle.1 +++ b/doc/rifle.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RIFLE 1" -.TH RIFLE 1 "rifle-1.9.0b5" "2017-03-23" "rifle manual" +.TH RIFLE 1 "rifle-1.9.0b5" "07/16/2017" "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 e088b660..92428312 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -271,6 +271,7 @@ map q quit copymap q ZZ ZQ map R reload_cwd +map F set freeze_files! map <C-r> reset map <C-l> redraw_window map <C-c> abort diff --git a/ranger/container/directory.py b/ranger/container/directory.py index c73e2408..97a3f0aa 100644 --- a/ranger/container/directory.py +++ b/ranger/container/directory.py @@ -471,6 +471,8 @@ class Directory( # pylint: disable=too-many-instance-attributes,too-many-public Use this sparingly since it takes rather long. """ self.content_outdated = False + if self.settings.freeze_files: + return if not self.loading: if not self.loaded: diff --git a/ranger/container/fsobject.py b/ranger/container/fsobject.py index 121fac22..640d0c48 100644 --- a/ranger/container/fsobject.py +++ b/ranger/container/fsobject.py @@ -270,9 +270,12 @@ class FileSystemObject( # pylint: disable=too-many-instance-attributes,too-many filesystem and caches it for later use """ + self.loaded = True + if self.settings.freeze_files: + return + self.display_data = {} self.fm.update_preview(self.path) - self.loaded = True # Get the stat object, either from preload or from [l]stat self.permissions = None diff --git a/ranger/container/settings.py b/ranger/container/settings.py index 243e1eb8..521583c4 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -41,6 +41,7 @@ ALLOWED_SETTINGS = { 'draw_borders': bool, 'draw_progress_bar_in_status_bar': bool, 'flushinput': bool, + 'freeze_files': bool, 'global_inode_type_filter': str, 'hidden_filter': str, 'idle_delay': int, |