From 4f5491e753ac56ccdefbc30c1b5225f8bd618647 Mon Sep 17 00:00:00 2001 From: Christophe Badoit Date: Thu, 18 May 2017 18:55:54 +0200 Subject: Implement the terminology-based image previews --- ranger/core/fm.py | 3 +++ ranger/ext/img_display.py | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/ranger/core/fm.py b/ranger/core/fm.py index e53d36e1..b8d38397 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -23,6 +23,7 @@ from ranger.gui.ui import UI from ranger.container.bookmarks import Bookmarks from ranger.core.runner import Runner from ranger.ext.img_display import (W3MImageDisplayer, ITerm2ImageDisplayer, + TerminologyImageDisplayer, URXVTImageDisplayer, URXVTImageFSDisplayer, ImageDisplayer) from ranger.core.metadata import MetadataManager from ranger.ext.rifle import Rifle @@ -216,6 +217,8 @@ class FM(Actions, # pylint: disable=too-many-instance-attributes return W3MImageDisplayer() elif self.settings.preview_images_method == "iterm2": return ITerm2ImageDisplayer() + elif self.settings.preview_images_method == "terminology": + return TerminologyImageDisplayer() elif self.settings.preview_images_method == "urxvt": return URXVTImageDisplayer() elif self.settings.preview_images_method == "urxvt-full": diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py index c88b5a77..15eecd1b 100644 --- a/ranger/ext/img_display.py +++ b/ranger/ext/img_display.py @@ -312,6 +312,61 @@ class ITerm2ImageDisplayer(ImageDisplayer, FileManagerAware): file_handle.close() return width, height +class TerminologyImageDisplayer(ImageDisplayer, FileManagerAware): + """Implementation of ImageDisplayer using terminology image display support + (https://github.com/billiob/terminology). + + Ranger must be running in terminology for this to work. + Doesn't work with TMUX :/ + """ + + def __init__(self): + self.display_protocol = "\033" + self.close_protocol = "\000" + + def draw(self, path, start_x, start_y, width, height): + # Save cursor + curses.putp(curses.tigetstr("sc")) + + y = start_y + # Move to drawing zone + self._move_to(start_x, y) + + # Write intent + sys.stdout.write("%s}ic#%d;%d;%s%s" % ( + self.display_protocol, + width, height, + path, + self.close_protocol)) + + # Write Replacement commands ('#') + for x in range(0, height): + sys.stdout.write("%s}ib%s%s%s}ie%s" % ( + self.display_protocol, + self.close_protocol, + "#" * width, + self.display_protocol, + self.close_protocol)) + y = y + 1 + self._move_to(start_x, y) + + # Restore cursor + curses.putp(curses.tigetstr("rc")) + + sys.stdout.flush() + + def _move_to(self, x, y): + # curses.move(y, x) + tparm = curses.tparm(curses.tigetstr("cup"), y, x) + if sys.version_info[0] < 3: + sys.stdout.write(tparm) + else: + sys.stdout.buffer.write(tparm) # pylint: disable=no-member + + def clear(self, start_x, start_y, width, height): + self.fm.ui.win.redrawwin() + self.fm.ui.win.refresh() + class URXVTImageDisplayer(ImageDisplayer, FileManagerAware): """Implementation of ImageDisplayer working by setting the urxvt -- cgit From b5f5ffe69d0ae3668c34ffa14f907e98977d5e35 Mon Sep 17 00:00:00 2001 From: rage311 Date: Wed, 7 Jun 2017 17:56:28 -0600 Subject: Added the w3mimgdisplay path for OpenBSD systems to W3MIMGDISPLAY_PATHS --- ranger/ext/img_display.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py index c88b5a77..e561b80d 100644 --- a/ranger/ext/img_display.py +++ b/ranger/ext/img_display.py @@ -32,6 +32,7 @@ W3MIMGDISPLAY_PATHS = [ '/usr/libexec/w3m/w3mimgdisplay', '/usr/lib64/w3m/w3mimgdisplay', '/usr/libexec64/w3m/w3mimgdisplay', + '/usr/local/libexec/w3m/w3mimgdisplay', ] -- cgit From a9309d678fca664df67d8aa9a307669d7f275179 Mon Sep 17 00:00:00 2001 From: Marcin Zawada Date: Sun, 23 Jul 2017 11:08:47 +0200 Subject: Fix bug with custom linemode not applied for files Fix regression introduce by commit 433a44f9bdbd8d01254559815b5dc349d44e46f8 --- ranger/container/file.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ranger/container/file.py b/ranger/container/file.py index 17ca577c..d2daa169 100644 --- a/ranger/container/file.py +++ b/ranger/container/file.py @@ -48,7 +48,6 @@ class File(FileSystemObject): preview_data = None preview_known = False preview_loading = False - linemode = "filename" _firstbytes = None @property -- cgit From 57df5b72d00b140a5083c0bc1427c5542b44221d Mon Sep 17 00:00:00 2001 From: Marcin Zawada Date: Sun, 23 Jul 2017 13:37:26 +0200 Subject: Fix issue #852 incorrect cursor movement Fix bug with incorrect cursor movement in console mode for text length greater than terminal width --- ranger/gui/widgets/console.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index 2d905f62..159405c6 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -87,6 +87,15 @@ class Console(Widget): # pylint: disable=too-many-instance-attributes,too-many- fobj.close() Widget.destroy(self) + def _calculate_offset(self): + wid = self.wid - 2 + whalf = wid // 2 + if self.pos < whalf or len(self.line) < wid: + return 0 + if self.pos > len(self.line) - (wid - whalf): + return len(self.line) - wid + return self.pos - whalf + def draw(self): self.win.erase() if self.question_queue: @@ -97,11 +106,9 @@ class Console(Widget): # pylint: disable=too-many-instance-attributes,too-many- self.addstr(0, 0, self.prompt) line = WideString(self.line) - overflow = -self.wid + len(self.prompt) + len(line) + 1 - if overflow > 0: - self.addstr(0, len(self.prompt), str(line[overflow:])) - else: - self.addstr(0, len(self.prompt), self.line) + if line: + x = self._calculate_offset() + self.addstr(0, len(self.prompt), str(line[x:])) def finalize(self): move = self.fm.ui.win.move @@ -112,7 +119,8 @@ class Console(Widget): # pylint: disable=too-many-instance-attributes,too-many- pass else: try: - pos = uwid(self.line[0:self.pos]) + len(self.prompt) + x = self._calculate_offset() + pos = uwid(self.line[x:self.pos]) + len(self.prompt) move(self.y, self.x + min(self.wid - 1, pos)) except curses.error: pass -- cgit From e4ad5a953ec0127d65f16619e8b84e476bb6b362 Mon Sep 17 00:00:00 2001 From: ormung <30354722+ormung@users.noreply.github.com> Date: Mon, 18 Sep 2017 23:16:30 +0200 Subject: Faster mercurial vcs Use "chg", a faster client to mercurial shipped with mercurial itself. This fixes the unrecoverable hang I get when entering a folder with many hg repos. --- ranger/ext/vcs/vcs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py index ba28d141..ea38eb8b 100644 --- a/ranger/ext/vcs/vcs.py +++ b/ranger/ext/vcs/vcs.py @@ -112,7 +112,11 @@ class Vcs(object): # pylint: disable=too-many-instance-attributes def _run(self, args, path=None, # pylint: disable=too-many-arguments catchout=True, retbytes=False, rstrip_newline=True): """Run a command""" - cmd = [self.repotype] + args + if self.repotype == 'hg': + # use "chg", a faster built-in client + cmd = ['chg'] + args + else: + cmd = [self.repotype] + args if path is None: path = self.path -- cgit From 538986719e81987d7a08aa083757f345fa9acaee Mon Sep 17 00:00:00 2001 From: john Date: Sun, 22 Oct 2017 13:44:09 -0700 Subject: Add config opts for iTerm2 font size (for preview) Add two config options "iterm2_font_width" and "iterm2_font_height" that override the default values of _minimum_font_width and _minimum_font_height in ITerm2ImageDisplayer. The default values may cause preview distortion if set too high (Issue #499) or result in the preview being smaller than necessary if set too low. --- doc/ranger.1 | 6 +++++- doc/ranger.pod | 4 ++++ doc/rifle.1 | 2 +- ranger/config/rc.conf | 8 ++++++++ ranger/container/settings.py | 2 ++ ranger/ext/img_display.py | 6 ++---- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index f96c7f20..cd00cd95 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.9.0b5" "10/01/2017" "ranger manual" +.TH RANGER 1 "ranger-1.9.0b5" "10/22/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 @@ -296,6 +296,10 @@ ssh. .PP To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to iterm2. .PP +This feature relies on the dimensions of the terminal's font. By default, a +width of 8 and height of 11 are used. To use other values, set the options +\&\f(CW\*(C`iterm2_font_width\*(C'\fR and \f(CW\*(C`iterm2_font_height\*(C'\fR to the desired values. +.PP \fIurxvt\fR .IX Subsection "urxvt" .PP diff --git a/doc/ranger.pod b/doc/ranger.pod index 310ab1fd..43926f46 100644 --- a/doc/ranger.pod +++ b/doc/ranger.pod @@ -201,6 +201,10 @@ ssh. To enable this feature, set the option C to iterm2. +This feature relies on the dimensions of the terminal's font. By default, a +width of 8 and height of 11 are used. To use other values, set the options +C and C to the desired values. + =head3 urxvt This only works in urxvt compiled with pixbuf support. Does not work over ssh. diff --git a/doc/rifle.1 b/doc/rifle.1 index 4d501df0..9d9e08f9 100644 --- a/doc/rifle.1 +++ b/doc/rifle.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "RIFLE 1" -.TH RIFLE 1 "rifle-1.9.0b5" "10/01/2017" "rifle manual" +.TH RIFLE 1 "rifle-1.9.0b5" "10/22/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 9459a3d3..a306594a 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -80,6 +80,10 @@ set preview_images false # (http://iterm2.com/images.html). This requires using iTerm2 compiled # with image preview support. # +# This feature relies on the dimensions of the terminal's font. By default, a +# width of 8 and height of 11 are used. To use other values, set the options +# iterm2_font_width and iterm2_font_height to the desired values. +# # * urxvt: # Preview images in full color using urxvt image backgrounds. This # requires using urxvt compiled with pixbuf support. @@ -89,6 +93,10 @@ set preview_images false # whole terminal window. set preview_images_method w3m +# Default iTerm2 font size (see: preview_images_method: iterm2) +set iterm2_font_width 8 +set iterm2_font_height 11 + # Use a unicode "..." character to mark cut-off filenames? set unicode_ellipsis false diff --git a/ranger/container/settings.py b/ranger/container/settings.py index bb902f9d..2f38a2b6 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -47,6 +47,8 @@ ALLOWED_SETTINGS = { 'hidden_filter': str, 'hostname_in_titlebar': bool, 'idle_delay': int, + 'iterm2_font_width': int, + 'iterm2_font_height': int, 'line_numbers': str, 'max_console_history_size': (int, type(None)), 'max_history_size': (int, type(None)), diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py index c88b5a77..5bc1fbe5 100644 --- a/ranger/ext/img_display.py +++ b/ranger/ext/img_display.py @@ -205,8 +205,6 @@ class ITerm2ImageDisplayer(ImageDisplayer, FileManagerAware): Ranger must be running in iTerm2 for this to work. """ - _minimum_font_width = 8 - _minimum_font_height = 11 def draw(self, path, start_x, start_y, width, height): curses.putp(curses.tigetstr("sc")) @@ -246,8 +244,8 @@ class ITerm2ImageDisplayer(ImageDisplayer, FileManagerAware): return text def _fit_width(self, width, height, max_cols, max_rows): - max_width = self._minimum_font_width * max_cols - max_height = self._minimum_font_height * max_rows + max_width = self.fm.settings.iterm2_font_width * max_cols + max_height = self.fm.settings.iterm2_font_height * max_rows if height > max_height: if width > max_width: width_scale = max_width / width -- cgit From 64f2d2c8538a430d284c9f486d785c108e328a8b Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 20 Dec 2017 01:33:23 +0100 Subject: fix drasill's commit so it passes CI --- ranger/ext/img_display.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py index abcdd7b1..5c1ba3d1 100644 --- a/ranger/ext/img_display.py +++ b/ranger/ext/img_display.py @@ -315,6 +315,7 @@ class ITerm2ImageDisplayer(ImageDisplayer, FileManagerAware): file_handle.close() return width, height + class TerminologyImageDisplayer(ImageDisplayer, FileManagerAware): """Implementation of ImageDisplayer using terminology image display support (https://github.com/billiob/terminology). @@ -343,7 +344,7 @@ class TerminologyImageDisplayer(ImageDisplayer, FileManagerAware): self.close_protocol)) # Write Replacement commands ('#') - for x in range(0, height): + for _ in range(0, height): sys.stdout.write("%s}ib%s%s%s}ie%s" % ( self.display_protocol, self.close_protocol, @@ -358,8 +359,9 @@ class TerminologyImageDisplayer(ImageDisplayer, FileManagerAware): sys.stdout.flush() - def _move_to(self, x, y): - # curses.move(y, x) + @staticmethod + def _move_to(x, y): + # curses.move(y, x) tparm = curses.tparm(curses.tigetstr("cup"), y, x) if sys.version_info[0] < 3: sys.stdout.write(tparm) -- cgit From 9a3fc5d8c90048bd02c8ca5ed8c7b0d7c46fb898 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 20 Dec 2017 02:10:29 +0100 Subject: data/scope.sh: added --force to "highlight" command, fixes #988 --- ranger/data/scope.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 560e27da..35021129 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -142,7 +142,7 @@ handle_mime() { local highlight_format='ansi' fi highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \ - --style="${HIGHLIGHT_STYLE}" -- "${FILE_PATH}" && exit 5 + --style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" && exit 5 # pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5 exit 2;; -- cgit From 0ed04b63c94b8fdc557401f5986ca81651fd0a59 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 25 Dec 2017 17:30:39 +0100 Subject: .gitignore: add '*.orig' files (created by git merge) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 02a51413..88c75b90 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.pyo *~ +*.orig /.cache /build -- cgit From 23c657263099a2a0148e62805d2810bf44b01a23 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 25 Dec 2017 18:01:25 +0100 Subject: config.commands: import ranger for eval(). Fixes #1007 --- ranger/config/commands.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 299f17c2..efbfd774 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -891,6 +891,8 @@ class eval_(Command): resolve_macros = False def execute(self): + # The import is needed so eval() can access the ranger module + import ranger # NOQA pylint: disable=unused-import if self.arg(1) == '-q': code = self.rest(2) quiet = True -- cgit From e9f00850500712b6e905dc3d2392cc329f97cae3 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 25 Dec 2017 18:37:34 +0100 Subject: config.commands: fix pylint directive --- ranger/config/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index efbfd774..df8022cf 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -892,7 +892,7 @@ class eval_(Command): def execute(self): # The import is needed so eval() can access the ranger module - import ranger # NOQA pylint: disable=unused-import + import ranger # NOQA pylint: disable=unused-import,unused-variable if self.arg(1) == '-q': code = self.rest(2) quiet = True -- cgit From 64e7fcffe02b1c3c9bd302c50d6475c30d126974 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 30 Dec 2017 14:51:15 +0100 Subject: Simplified github issue template --- .github/ISSUE_TEMPLATE.md | 61 ++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index b7baa192..70214116 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,55 +1,40 @@ - - - - -#### ISSUE TYPE - -- Bug report -- Improvement/feature request - -#### RUNTIME ENVIRONMENT - - + + +#### Runtime Environment + - Operating system and version: - Terminal emulator and version: - Python version: - Ranger version/commit: - Locale: -#### EXPECTED BEHAVIOR - - +#### Current Behavior +#### Expected Behavior -#### CURRENT BEHAVIOR - - +#### Context + +#### Possible Solutions -#### CONTEXT - - - - -#### POSSIBLE SOLUTIONS - - - - -#### STEPS TO REPRODUCE - +#### Steps to reproduce 1. 2. 3. -4. -5. -#### TRACEBACK - - +#### Traceback + + + ``` ``` - -#### IMAGES / VIDEOS - -- cgit From 602851561f15f7029e537b0fd8177d701a65713d Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 30 Dec 2017 14:52:59 +0100 Subject: ISSUE_TEMPLATE.md: consistent quote usage --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 70214116..1f26944a 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -33,7 +33,7 @@ #### Traceback - + ``` -- cgit From 58a5c78b1ffada6228940b573ff6b89ed6e2ae83 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 30 Dec 2017 15:05:08 +0100 Subject: ISSUE_TEMPLATE: remove redundant line --- .github/ISSUE_TEMPLATE.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 1f26944a..468f0991 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -33,8 +33,6 @@ #### Traceback - - ``` ``` -- cgit From a965ba18b4735ef9c4cd3506c6b4988d1fd85e62 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 30 Dec 2017 15:05:40 +0100 Subject: update CONTRIBUTING.md --- CONTRIBUTING.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index abf25300..29ae33a1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,8 +2,11 @@ ## Tips for bug reports -* Always completely fill out the issue template that is automatically inserted - on issue creation. +* Was this issue already reported? Please do a quick search. +* Maybe the problem is solved in the current master branch already? + Simply clone ranger with `git clone https://github.com/ranger/ranger` or + download the git version via https://github.com/ranger/ranger/archive/master.zip + and run `./ranger.py` directly to find out. * You can obtain much better error messages with `ranger --debug`, please post those in bug reports rather than the usual, single-line error message. Also check the log by using the default map `W` or by running the command `display_log`. -- cgit From 62e8308fbef35ef76fbe3679fb08aa9734fbb313 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Wed, 3 Jan 2018 23:33:41 +0100 Subject: config.commands: Make the column_ratios setting completion actually useful A stringified list, as before, cannot be used in the :set command. --- ranger/config/commands.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index df8022cf..6fd34ee1 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -449,6 +449,8 @@ class set_(Command): if name == "colorscheme": return sorted(self.firstpart + colorscheme for colorscheme in get_all_colorschemes(self.fm)) + if name == "column_ratios": + return self.firstpart + ",".join(map(str, settings[name])) return self.firstpart + str(settings[name]) if bool in settings.types_of(name): if 'true'.startswith(value.lower()): -- cgit From 82cc5eaefcfded380254382ac2193b6fd76deb68 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Wed, 3 Jan 2018 23:47:54 +0100 Subject: config.commands: :set tab completion refactoring --- ranger/config/commands.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 6fd34ee1..841ac6f4 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -445,13 +445,18 @@ class set_(Command): return sorted(self.firstpart + setting for setting in settings if setting.startswith(name)) if not value: - # Cycle through colorschemes when name, but no value is specified - if name == "colorscheme": - return sorted(self.firstpart + colorscheme for colorscheme - in get_all_colorschemes(self.fm)) - if name == "column_ratios": - return self.firstpart + ",".join(map(str, settings[name])) - return self.firstpart + str(settings[name]) + value_completers = { + "colorscheme": lambda: + # Cycle through colorschemes when name, but no value is specified + sorted(self.firstpart + colorscheme for colorscheme + in get_all_colorschemes(self.fm)), + + "column_ratios": lambda: + self.firstpart + ",".join(map(str, settings[name])), + } + def default_value_completer(): + return self.firstpart + str(settings[name]) + return value_completers.get(name, default_value_completer)() if bool in settings.types_of(name): if 'true'.startswith(value.lower()): return self.firstpart + 'True' -- cgit From 2e93ab65a1e71ebca8c44e08312667401b4ffbfa Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Thu, 4 Jan 2018 00:07:37 +0100 Subject: config.commands: Coding style fix --- ranger/config/commands.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 841ac6f4..7d690b4a 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -446,16 +446,18 @@ class set_(Command): if setting.startswith(name)) if not value: value_completers = { - "colorscheme": lambda: + "colorscheme": # Cycle through colorschemes when name, but no value is specified - sorted(self.firstpart + colorscheme for colorscheme - in get_all_colorschemes(self.fm)), + lambda: sorted(self.firstpart + colorscheme for colorscheme + in get_all_colorschemes(self.fm)), - "column_ratios": lambda: - self.firstpart + ",".join(map(str, settings[name])), + "column_ratios": + lambda: self.firstpart + ",".join(map(str, settings[name])), } + def default_value_completer(): return self.firstpart + str(settings[name]) + return value_completers.get(name, default_value_completer)() if bool in settings.types_of(name): if 'true'.startswith(value.lower()): -- cgit From 7769d0f2cdccf1c257f03d808248dbdf9b7ea593 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 4 Jan 2018 20:39:24 +0100 Subject: Fix spectre vulnerability --- ranger/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ranger/__init__.py b/ranger/__init__.py index f3495197..a00b813a 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -29,7 +29,6 @@ DEFAULT_PAGER = 'less' USAGE = '%prog [options] [path]' VERSION = 'ranger-master {0}'.format(__version__) - # These variables are ignored if the corresponding # XDG environment variable is non-empty and absolute CACHEDIR = os.path.expanduser('~/.cache/ranger') -- cgit From ed70a4e90457eb433796515d9ccaa5a2a2e02f22 Mon Sep 17 00:00:00 2001 From: Peter Stevenson <2e0pgs@gmail.com> Date: Sun, 7 Jan 2018 14:11:19 +0000 Subject: Fix ranger not opening in chrome, chromium on Ubuntu. Added `has google-chrome` and `has chromium-browser` then adjusted the spacing to adjust for new longer `has chromium-browser` line. This allows Ubuntu users to open in google-chrome and chromium-browser packages. --- ranger/config/rifle.conf | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index 8bd5f565..d783f54e 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -54,30 +54,32 @@ # Rarely installed browsers get higher priority; It is assumed that if you # install a rare browser, you probably use it. Firefox/konqueror/w3m on the # other hand are often only installed as fallback browsers. -ext x?html?, has surf, X, flag f = surf -- file://"$1" -ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@" -ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@" -ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@" -ext x?html?, has dwb, X, flag f = dwb -- "$@" -ext x?html?, has jumanji, X, flag f = jumanji -- "$@" -ext x?html?, has luakit, X, flag f = luakit -- "$@" -ext x?html?, has uzbl, X, flag f = uzbl -- "$@" -ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@" -ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@" -ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@" -ext x?html?, has midori, X, flag f = midori -- "$@" -ext x?html?, has chromium, X, flag f = chromium -- "$@" -ext x?html?, has opera, X, flag f = opera -- "$@" -ext x?html?, has firefox, X, flag f = firefox -- "$@" -ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@" -ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@" -ext x?html?, has epiphany, X, flag f = epiphany -- "$@" -ext x?html?, has konqueror, X, flag f = konqueror -- "$@" -ext x?html?, has elinks, terminal = elinks "$@" -ext x?html?, has links2, terminal = links2 "$@" -ext x?html?, has links, terminal = links "$@" -ext x?html?, has lynx, terminal = lynx -- "$@" -ext x?html?, has w3m, terminal = w3m "$@" +ext x?html?, has surf, X, flag f = surf -- file://"$1" +ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@" +ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@" +ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@" +ext x?html?, has dwb, X, flag f = dwb -- "$@" +ext x?html?, has jumanji, X, flag f = jumanji -- "$@" +ext x?html?, has luakit, X, flag f = luakit -- "$@" +ext x?html?, has uzbl, X, flag f = uzbl -- "$@" +ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@" +ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@" +ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@" +ext x?html?, has midori, X, flag f = midori -- "$@" +ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@" +ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@" +ext x?html?, has chromium, X, flag f = chromium -- "$@" +ext x?html?, has opera, X, flag f = opera -- "$@" +ext x?html?, has firefox, X, flag f = firefox -- "$@" +ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@" +ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@" +ext x?html?, has epiphany, X, flag f = epiphany -- "$@" +ext x?html?, has konqueror, X, flag f = konqueror -- "$@" +ext x?html?, has elinks, terminal = elinks "$@" +ext x?html?, has links2, terminal = links2 "$@" +ext x?html?, has links, terminal = links "$@" +ext x?html?, has lynx, terminal = lynx -- "$@" +ext x?html?, has w3m, terminal = w3m "$@" #------------------------------------------- # Misc -- cgit From b1e08bf5b52746da2f0e5d9995e8dbc8c8505f62 Mon Sep 17 00:00:00 2001 From: Peter Stevenson <2e0pgs@gmail.com> Date: Thu, 11 Jan 2018 18:20:11 +0000 Subject: Updated rifle.conf moved google-chrome below chromium. Prioritise chromium as I think most Linux users would prefer that as default over google-chrome. --- ranger/config/rifle.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf index d783f54e..2c081479 100644 --- a/ranger/config/rifle.conf +++ b/ranger/config/rifle.conf @@ -66,9 +66,9 @@ ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@" ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@" ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@" ext x?html?, has midori, X, flag f = midori -- "$@" -ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@" ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@" ext x?html?, has chromium, X, flag f = chromium -- "$@" +ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@" ext x?html?, has opera, X, flag f = opera -- "$@" ext x?html?, has firefox, X, flag f = firefox -- "$@" ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@" -- cgit