diff options
-rw-r--r-- | packages/finder/main.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/packages/finder/main.py b/packages/finder/main.py index b9023ad..a23b22c 100644 --- a/packages/finder/main.py +++ b/packages/finder/main.py @@ -53,19 +53,19 @@ class FinderMain(): return True def change(self, _): - self.update_list(self.searcher.filter(self.input_field.text)) + self.update_list_buffer(self.searcher.filter(self.input_field.text)) def open(self): - item = self.output_buffer.document.current_line + item = self.list_buffer.document.current_line self.opener.open(os.path.join(self.path, item)) - def update_list(self, items): + def update_list_buffer(self, items): # This only works when the buffer is read-write - #self.output_buffer.text = self.format(items) + #self.list_buffer.text = self.format(items) # For read-only buffers - self.output_buffer.set_document(Document(self.format(items)), bypass_readonly=True) + self.list_buffer.set_document(Document(self.format(items)), bypass_readonly=True) def bindings(self): self.keybindings = KeyBindings() @@ -88,11 +88,11 @@ class FinderMain(): def _(event): event.app.layout.focus_next() - @self.keybindings.add("enter", filter = has_focus(self.output_buffer)) + @self.keybindings.add("enter", filter = has_focus(self.list_buffer)) def _(event): self.open() - @self.keybindings.add("q", filter = has_focus(self.output_buffer)) + @self.keybindings.add("q", filter = has_focus(self.list_buffer)) def _(event): "Pressing 'q' on the selection buffer will exit the user interface" event.app.exit() @@ -108,7 +108,7 @@ class FinderMain(): if self.state['loading']: return "Loading...." - lines = self.output_buffer.document.line_count + lines = self.list_buffer.document.line_count return f"Results: {lines}" @@ -124,10 +124,10 @@ class FinderMain(): } # Buffers - self.output_buffer = Buffer(read_only = True) + self.list_buffer = Buffer(read_only = True) # UI fields - self.output_field = BufferControl(buffer=self.output_buffer) + self.output_field = BufferControl(buffer=self.list_buffer) self.input_field = TextArea( height = 1, prompt = "finder> ", @@ -177,7 +177,7 @@ class FinderMain(): self.opener = FinderPluginFileXdgOpener() self.state['loading'] = False - self.update_list(await self.searcher.finder()) + self.update_list_buffer(await self.searcher.finder()) def run(self): return asyncio.run(self.main()) |