Commit Briefs

Mark Jamsek

tog: make headline highlight extend the full view width

In splitscreen mode, make the active view headline highlight extend the full width of view->ncols. While here, format the tree view header like the blame view by moving the index to the path line. suggested by and ok stsp@


Mark Jamsek

tog: extend log view author highlight colour to full field width

ok stsp@


Mark Jamsek

tog: ensure stdin is a tty

This guards against {mis,ab}use such as `tog < /dev/null`. ok plus fix from op@


Omar Polo

plug leak in the commit graph iterator

We fail to release the memory for the nodes. To fix it however, we some consumer of the commit graph iterator need to be corrected: the returned pointer is safe to be used only up until the next iter_next call; save a copy it if it's needed afterwards too. ok stsp@


Mark Jamsek

tog: remove gcc ternary if extension

ok stsp@


Stefan Sperling

Group options in accordance with style(9)

patch by Josiah Frentsos


Stefan Sperling

tog: add missing checks for NULL pointers in log view state

ok jamsek


Mark Jamsek

tog: don't block when processing log view 'G' key map

As per stsp's TODO item, make tog respond to key presses while "loading..." history. Initial testing in src.git appears to work as intended. ok stsp@


Mark Jamsek

tog: fix delayed tree index update

If a child blame view has been opened, halfdelay() is reset to a 1 second refresh rate, so the index in the header lags behind subtree navigation as we set the index based on the selected tree entry, which isn't updated till that refresh cycle completes. Don't wait for the selected_entry to update; instead, compute the index from the first displayed entry and the currently selected line index. improved by and ok stsp@


Mark Jamsek

tog: move all 'G' logic into log_move_cursor_down()

Previously, we only handled 'G' in log_move_cursor_down() when all commits had not yet been loaded; move the case where all commits are already loaded into this routine too, and simplify by handling both cases the same. This change was prompted by Mikhail's observation of a redundant assignment in the previous 'G' handling in log_move_cursor_down(). ok stsp@


Mark Jamsek

tog: fix log 'd' keymap when last commit is displayed

When at the end of the log view such that the currently selected line is greater than nlines/2, add--don't assign--the page down value to the selected index so we don't jump up when the user expects tog to scroll down. While here, rework log page down logic for a smoother UX in horizontal split mode by moving the selection cursor down rather than scrolling when 'd' or 'f' is entered if the last commit is already on screen. ok stsp@


Mark Jamsek

tog: drop regex for line types to colour the diff view

ok stsp@


Mark Jamsek

tog: keymaps to jump to next/prev file/hunk in the diff

Add () and {} key maps to navigate to the previous and next file or hunk in the diff. This required changing Got's diff API to collect line type metadata in addition to the line offsets already produced as prompted by stsp. ok stsp@


Mark Jamsek

tog: add n{G,g} key map to jump to line n like less(1)

Available to all views; for example, 99g will navigate to line 99 in the file if in a blame view or the 99th commit if in a log view. Includes improvements suggested by naddy and stsp. ok naddy@




Mark Jamsek

tog: refactor key map -> new view initialisation

Deduplicate view initialisation boilerplate and simplify new key map view requests with dispatch routine. Includes improvements suggested by stsp. ok stsp@


Mark Jamsek

tog: uppercase alpha key maps that open new views

ok stsp@


Mark Jamsek

tog: reset view->offset when clearing log view state

Don't move the selection cursor due to a bogus offset after closing child views following use of 'B', C-l, and backspace log view key maps. ok stsp@


Mark Jamsek

tog: use view->resize idiom to ensure log is populated

Replace view->mode == TOG_VIEW_LOG checks for requesting commits to populate the log view with calls to view->resize(). ok stsp@


Mark Jamsek

tog: populate new child view log lines when switching split

When switching a child log view from a h- to a v-split, new log lines are empty. Rather than (mis)trace height and (not) call request_log_commits(), let resize_log_view() do the math and request commits if needed to draw new lines. ok op@


Florian Obser

Do not ignore error from format_author().

Found by llvm's scan-build (dead store). OK stsp


Mark Jamsek

tog: blame view keymap to open log of annotated line

As per stsp's TODO item: open a log view of the selected line with 'L'. helped by and ok stsp@


Mark Jamsek

tog: alias J and K to > and < keybindings for diff view

Use J and K to move to the next and previous commits, respectively, when the diff is loaded from the log or blame views. Patch by Mikhail ok stsp@


Omar Polo

tog: add key to toggle author/committer in log view

improvements and ok by jamsek and stsp