Download raw body.
tog: horizontal split
On Thu, Jun 30, 2022 at 12:17:59AM +1000, Mark Jamsek wrote: > On 22-06-26 11:08pm, Mark Jamsek wrote: > > The below diff adds support for horizontal splits in tog. > > > > There are a couple bugs that need squishing: > > - resizing with an open hsplit sometimes kills the border and there > > seems to be an OB1 that makes the top split misrender a line > > - the double-width bug in the log view has returned where we overwrite > > the vertical border by one column; strangely enough if you open the > > commit in ja.git in a vsplit then press F, tab, tab, F, it renders > > correctly > > > > Thanks to Omar, the above bugs (plus the double-width char bug in vsplit > that the diff broke) have been squished. > > In short, the main problem was that we were trying to account for the > border when initialising the split, which left us a line short when > later reszing because we'd deducted the line. The fix was to account for > the border when scrolling rather than try to account for it in sizing. > > This also makes the diff a lot cleaner imo. op's and stsp's suggestions > have been applied and the split config removed. The scale is set with > HSPLIT_SCALE. To test hsplit: `$ TOG_VIEW_SPLIT_MODE=h tog` > > Also in the diff, echo count prefix to the bottom left of the _terminal_ > screen irrespective of the split or active window (rather than the > bottom left of the top horizontal or right vertical split. I haven't > changed the location of the search "/" prompt except for in hsplits; > I thought I'd see what the consensus is first. At present, we draw the > search prompt in the bottom left of the active view when in a vsplit. So > we can either continue this behaviour with hsplits, or always echo to > the absolute bottom left of the screen. I wanted to get a feel for what > they both look like, but I don't feel strongly one way or the other. > I suppose it feels a little surprsing to have it in different locations > but that's subjective. I think displaying the counter at the bottom of the active view makes more sense than always using the last line of the terminal. But such behaviour can always be tweaked later. And horizontal split is not yet enabled by default anyway. This patch is a great start. I would be fine with this going in as it is, with further tweaks to be expected on top later. For example, horizontal splitting should work via tog log -> tree -> blame just like it does for tog tree -> blame. That is the most urgent usability issue I can see.
tog: horizontal split