From 3221f9fa6d40512b402fa5b87ae558811d0211f1 Mon Sep 17 00:00:00 2001 From: Christian Harke Date: Thu, 14 Sep 2023 23:54:35 +0200 Subject: [PATCH] Update ranger to current master release --- home/programs/ranger/config/commands.py | 275 +++++++++++++++++------- home/programs/ranger/config/rc.conf.nix | 41 +++- home/programs/ranger/config/rifle.conf | 73 ++++--- home/programs/ranger/config/scope.sh | 205 ++++++++++++++---- home/programs/ranger/default.nix | 8 +- home/programs/ranger/package.nix | 38 ++++ 6 files changed, 480 insertions(+), 160 deletions(-) create mode 100644 home/programs/ranger/package.nix diff --git a/home/programs/ranger/config/commands.py b/home/programs/ranger/config/commands.py index 5defa677..969be61f 100644 --- a/home/programs/ranger/config/commands.py +++ b/home/programs/ranger/config/commands.py @@ -94,7 +94,9 @@ from collections import deque import os import re +from io import open +from ranger import PY3 from ranger.api.commands import Command @@ -141,6 +143,12 @@ def execute(self): if os.path.isfile(destination): self.fm.select_file(destination) return + elif self.arg(1) == '-e': + self.shift() + destination = os.path.realpath(os.path.expandvars(self.rest(1))) + if os.path.isfile(destination): + self.fm.select_file(destination) + return else: destination = self.rest(1) @@ -337,7 +345,7 @@ class open_with(Command): def execute(self): app, flags, mode = self._get_app_flags_mode(self.rest(1)) self.fm.execute_file( - files=[f for f in self.fm.thistab.get_selection()], + files=self.fm.thistab.get_selection(), app=app, flags=flags, mode=mode) @@ -480,36 +488,106 @@ def default_value_completer(): return None -class setlocal(set_): - """:setlocal path=