summaryrefslogtreecommitdiff
path: root/alot/buffers
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-04-19 18:31:11 +0200
committerAnton Khirnov <anton@khirnov.net>2020-04-19 18:31:11 +0200
commitffb02915a33b722e8ce078ed062799320b706e42 (patch)
tree90e4861468807c2a9520e7bae986b55faff045cd /alot/buffers
parent708f33e83c9cf8a128f0765d49cc38ee6ca0066d (diff)
buffers/search: drop unused code
Diffstat (limited to 'alot/buffers')
-rw-r--r--alot/buffers/search.py20
1 files changed, 3 insertions, 17 deletions
diff --git a/alot/buffers/search.py b/alot/buffers/search.py
index 17023c16..d1b3e556 100644
--- a/alot/buffers/search.py
+++ b/alot/buffers/search.py
@@ -17,14 +17,13 @@ class PipeWalker(urwid.ListWalker):
:attr lines: the lines obtained from the pipe
:type lines: list(`containerclass`)
"""
- def __init__(self, pipe, containerclass, reverse=False, **kwargs):
+ def __init__(self, pipe, containerclass, **kwargs):
self.pipe = pipe
self.kwargs = kwargs
self.containerclass = containerclass
self.lines = []
self.focus = 0
self.empty = False
- self.direction = -1 if reverse else 1
def __len__(self):
while not self.empty:
@@ -39,20 +38,10 @@ class PipeWalker(urwid.ListWalker):
self._modified()
def get_next(self, start_from):
- return self._get_at_pos(start_from + self.direction)
+ return self._get_at_pos(start_from + 1)
def get_prev(self, start_from):
- return self._get_at_pos(start_from - self.direction)
-
- def remove(self, obj):
- next_focus = self.focus % len(self.lines)
- if self.focus == len(self.lines) - 1 and self.empty:
- next_focus = self.focus - 1
-
- self.lines.remove(obj)
- if self.lines:
- self.set_focus(next_focus)
- self._modified()
+ return self._get_at_pos(start_from - 1)
def _get_at_pos(self, pos):
if pos < 0: # pos too low
@@ -86,9 +75,6 @@ class PipeWalker(urwid.ListWalker):
self.empty = True
return next_widget
- def get_lines(self):
- return self.lines
-
class SearchBuffer(Buffer):
"""shows a result list of threads for a query"""