about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorjakanakae-envangel <jakanakaevangeli@chiru.no>2019-08-31 23:19:58 +0200
committertoonn <toonn@toonn.io>2021-09-02 13:15:54 +0200
commit4737c998eb562f014d005898e36a90c2c362d265 (patch)
tree2cd2a811bb270161c0fcf5376dd06eb46a02a5af /ranger
parent7e6a0aa6a144f6733a8000a2822c107c93e60c1a (diff)
downloadranger-4737c998eb562f014d005898e36a90c2c362d265.tar.gz
Make setlocal path=... argument a regex again
The man page says that the path argument to the setlocal command is a
regex. This commit fixes the regression in 5b0b73fc, which made it a
normal string.
Diffstat (limited to 'ranger')
-rwxr-xr-xranger/config/commands.py2
-rw-r--r--ranger/container/settings.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index d1d84e91..1bd6f96f 100755
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -506,7 +506,7 @@ class setlocal(set_):
         if path is None:
             path = self._re_shift(self.PATH_RE_UNQUOTED.match(self.arg(1)))
         if path is None and self.fm.thisdir:
-            path = self.fm.thisdir.path
+            path = "^" + re.escape(self.fm.thisdir.path) + "$"
         if not path:
             return
 
diff --git a/ranger/container/settings.py b/ranger/container/settings.py
index e083c5ac..80250d4f 100644
--- a/ranger/container/settings.py
+++ b/ranger/container/settings.py
@@ -281,7 +281,7 @@ class Settings(SignalDispatcher, FileManagerAware):
         if path:
             if path not in self._localsettings:
                 try:
-                    regex = re.compile(re.escape(path))
+                    regex = re.compile(path)
                 except re.error:  # Bad regular expression
                     return
                 self._localregexes[path] = regex