Skip to content

Commit

Permalink
/ss didn't affect /up and /down
Browse files Browse the repository at this point in the history
  • Loading branch information
9001 committed Apr 26, 2024
1 parent d9c584f commit f36ed61
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
19 changes: 4 additions & 15 deletions r0c/ivt100.py
Original file line number Diff line number Diff line change
Expand Up @@ -2869,21 +2869,10 @@ def read_cb(self, full_redraw, growth):
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":
Expand Down
17 changes: 13 additions & 4 deletions r0c/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,20 @@ def exec_cmd(self, cmd_str):
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?!")

if cmd == u"up" or cmd == u"u":
steps *= -1

elif cmd == u"down" or cmd == u"d":
self.client.scroll_cmd += +(self.client.h - 4)
cli.scroll_cmd += steps

elif cmd == u"latest" or cmd == u"l":
self.active_chan.lock_to_bottom = True
Expand Down

0 comments on commit f36ed61

Please sign in to comment.