an experimental irc client

ui: fix scrolling of window when scrolled-to-last-read

rockorager.dev 03b76b47 97aed916

verified
+4 -1
+4 -1
src/irc.zig
··· 141 141 offset: u16 = 0, 142 142 /// Message offset into the list of messages. We use this to lock the viewport if we have a 143 143 /// scroll. Otherwise, when offset == 0 this is effectively ignored (and should be 0) 144 - msg_offset: ?u16 = null, 144 + msg_offset: ?usize = null, 145 145 146 146 /// Pending scroll we have to handle while drawing. This could be up or down. By convention 147 147 /// we say positive is a scroll up. ··· 1183 1183 } 1184 1184 // Our scroll offset gets adjusted as well 1185 1185 self.scroll.offset += adjustment; 1186 + // We will set the msg offset too to prevent any bumping of the scroll state when we get 1187 + // a new message 1188 + self.scroll.msg_offset = self.messages.items.len; 1186 1189 } 1187 1190 1188 1191 if (did_scroll_to_last_read) {