From f36ed617933a33750b23bab4328c791631a452c1 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 26 Apr 2024 23:12:57 +0000 Subject: [PATCH] /ss didn't affect /up and /down --- r0c/ivt100.py | 19 ++++--------------- r0c/user.py | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/r0c/ivt100.py b/r0c/ivt100.py index 5cf85a4..5044416 100644 --- a/r0c/ivt100.py +++ b/r0c/ivt100.py @@ -2869,21 +2869,10 @@ class VT100_Client(object): self.linebuf = u"" self.linepos = 0 - elif act == "pgup" or act == "pgdn": - - steps = self.h - 4 - if self.scroll_i is not None: - steps = self.scroll_i - elif self.scroll_f is not None: - steps = int(steps * self.scroll_f) - else: - print("no scroll size?!") - - if act == "pgup": - steps *= -1 - - self.scroll_cmd += steps - + elif act == "pgup": + self.user.exec_cmd("u") + elif act == "pgdn": + self.user.exec_cmd("d") elif act == "redraw": self.user.exec_cmd("r") elif act == "view": diff --git a/r0c/user.py b/r0c/user.py index a4084bb..ceb6536 100644 --- a/r0c/user.py +++ b/r0c/user.py @@ -463,11 +463,20 @@ class User(object): self.world.send_chan_msg(self.nick, uchan.nchan, arg2) self.client.refresh(False, True) - elif cmd == u"up" or cmd == u"u": - self.client.scroll_cmd += -(self.client.h - 4) + elif cmd == u"up" or cmd == u"u" or cmd == u"down" or cmd == u"d": + cli = self.client + steps = cli.h - 4 + if cli.scroll_i is not None: + steps = cli.scroll_i + elif cli.scroll_f is not None: + steps = int(steps * cli.scroll_f) + else: + print("no scroll size?!") - elif cmd == u"down" or cmd == u"d": - self.client.scroll_cmd += +(self.client.h - 4) + if cmd == u"up" or cmd == u"u": + steps *= -1 + + cli.scroll_cmd += steps elif cmd == u"latest" or cmd == u"l": self.active_chan.lock_to_bottom = True