aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-24 13:30:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-24 13:30:42 -0300
commit9d3120a55336173c46eeefb5138a2cf91699bd94 (patch)
treebc5cbd1234c53c4e6900e6ee32c39243a9069bf5 /packages
parent51812b78c8b82532e0fc4747106ec98f8ee910ad (diff)
downloadfinder-9d3120a55336173c46eeefb5138a2cf91699bd94.tar.gz
finder-9d3120a55336173c46eeefb5138a2cf91699bd94.tar.bz2
Feat: display file names relative to the current path
Diffstat (limited to 'packages')
-rw-r--r--packages/finder/main.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/finder/main.py b/packages/finder/main.py
index ae75571..21932c5 100644
--- a/packages/finder/main.py
+++ b/packages/finder/main.py
@@ -57,7 +57,7 @@ class FinderMain():
def open(self):
item = self.output_buffer.document.current_line
- self.opener.open(item)
+ self.opener.open(os.path.join(self.path, item))
def bindings(self):
self.keybindings = KeyBindings()
@@ -201,7 +201,10 @@ class FinderMain():
loader = tg.create_task(self.load())
def format(self, items):
- return '\n'.join(sorted(items))
+ return '\n'.join(
+ sorted(
+ [ item.removeprefix(self.path).removeprefix(os.sep) for item in items ]
+ ))
def finish(self):
# If we have to exit the application depending on the input buffer