From: Stefan Sperling Subject: Re: [rfc] tog horizontal scroll (diff & blame view) To: Mark Jamsek Cc: gameoftrees@openbsd.org Date: Thu, 16 Jun 2022 09:15:24 +0200 On Thu, Jun 16, 2022 at 04:13:20PM +1000, Mark Jamsek wrote: > The updated diff is below. Rather than refactor expanded_strsz(), > I decided to call format_line() earlier to get the width. I think this > is better for a couple reasons: less code; and expanded_strsz() would > duplicate a lot of that routine--in most cases, we'll be drawing the > line so I think it's more efficient like this. > > But if you think we should go the other way, I'm happy to do that too, > just let me know :) I like it, thanks! > Also, I've added horizontal scroll to the log view now too. Rather than > scroll the whole line, we just scroll the log message. I think this is > pretty cool, but let me know if you don't like it and we can change it. Yes, it is nice. The patch has been committed now. I found two issues while testing it: Horizontal scrolling in the log view only works within a certain terminal width limit. In an 80x24 terminal after starting tog in got.git, horizontal scrolling can be triggered as expected. Now stretch the terminal such that its width is at least 156 columns (e.g. by making it fullscreen), and horizontal scrolling no longer works. Is this intentional? In the blame view, in an 80x24 terminal, horizontal scrolling has a rendering issue where separate lines get merged together. Even commit annotations are move up and get merged to the end of the previous line. Ncurses will need a specific line break after as many wide chars as fit into COLUMNS as per wcwidth(), in order to render the display correctly.