From 9d3120a55336173c46eeefb5138a2cf91699bd94 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 24 Jul 2024 13:30:42 -0300 Subject: Feat: display file names relative to the current path --- packages/finder/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'packages') 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 -- cgit v1.2.3