aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-24 14:30:05 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-24 14:30:05 -0300
commitd19903262cd69991c4c8beec0e8c9de5e85c81a8 (patch)
treecbc4c447b88496d0a55c9a21f277bea01763e052 /packages
parent3214919f1b27515769c3d9b72858483295033768 (diff)
downloadfinder-d19903262cd69991c4c8beec0e8c9de5e85c81a8.tar.gz
finder-d19903262cd69991c4c8beec0e8c9de5e85c81a8.tar.bz2
Fix: rename output_buffer to list_buffer
Diffstat (limited to 'packages')
-rw-r--r--packages/finder/main.py22
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())