summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-05-22 01:32:11 +0200
committermathieui <mathieui@mathieui.net>2020-05-23 16:10:13 +0200
commitb7423ee43bb14fc97b5db090206cee7a76e8b368 (patch)
treea3771551450ee001bff82e93b734f4f23e94acc3
parente488b75737f0d691b606b4ac00afcae2ea4ed7b0 (diff)
downloadpoezio-b7423ee43bb14fc97b5db090206cee7a76e8b368.tar.gz
poezio-b7423ee43bb14fc97b5db090206cee7a76e8b368.tar.bz2
poezio-b7423ee43bb14fc97b5db090206cee7a76e8b368.tar.xz
poezio-b7423ee43bb14fc97b5db090206cee7a76e8b368.zip
Remove "top" message logic
-rw-r--r--poezio/text_buffer.py3
-rw-r--r--poezio/ui/render.py2
-rw-r--r--poezio/windows/text_win.py10
3 files changed, 4 insertions, 11 deletions
diff --git a/poezio/text_buffer.py b/poezio/text_buffer.py
index 15869676..121a797a 100644
--- a/poezio/text_buffer.py
+++ b/poezio/text_buffer.py
@@ -163,8 +163,7 @@ class TextBuffer:
nick_size=nick_size)
if ret_val == 0:
ret_val = nb
- top = isinstance(msg, Message) and msg.top
- if window.pos != 0 and top is False:
+ if window.pos != 0:
window.scroll_up(nb)
return min(ret_val, 1)
diff --git a/poezio/ui/render.py b/poezio/ui/render.py
index a431b4e7..c85d3cc5 100644
--- a/poezio/ui/render.py
+++ b/poezio/ui/render.py
@@ -94,8 +94,6 @@ def build_message(msg: Message, width: int, timestamp: bool, nick_size: int = 10
offset = msg.compute_offset(timestamp, nick_size)
lines = poopt.cut_text(txt, width - offset - 1)
generated_lines = generate_lines(lines, msg, default_color='')
- if msg.top:
- generated_lines.reverse()
return generated_lines
diff --git a/poezio/windows/text_win.py b/poezio/windows/text_win.py
index 9e6641f7..2cb75271 100644
--- a/poezio/windows/text_win.py
+++ b/poezio/windows/text_win.py
@@ -95,14 +95,10 @@ class TextWin(Win):
lines = build_lines(
message, self.width, timestamp=timestamp, nick_size=nick_size
)
- if isinstance(message, Message) and message.top:
- for line in lines:
- self.built_lines.insert(0, line)
+ if self.lock:
+ self.lock_buffer.extend(lines)
else:
- if self.lock:
- self.lock_buffer.extend(lines)
- else:
- self.built_lines.extend(lines)
+ self.built_lines.extend(lines)
if not lines or not lines[0]:
return 0
if isinstance(message, Message) and message.highlight: