commit 678cbce5579984eaa94e22c2d83d2a657b156238 from: Stefan Sperling date: Sun Jul 28 11:10:25 2019 UTC allow aborting search in 'tog log' with backspace key commit - 6fcd089d7c0acea8814f6d53518eb2f0df8d93db commit + 678cbce5579984eaa94e22c2d83d2a657b156238 blob - df3304bc66d7bf0b00bcf99bb34a5524c18dfbbe blob + ae70add69184bd2cc1ddee52adff172573724016 --- TODO +++ TODO @@ -21,4 +21,3 @@ tog: - allow moving to prev/next blamed line in diff view if opened from blame view, similar to how the diff view can switch commits if opened from log view - tog should have a command to list and log/browse references -- it should be possible to abort a running search in the log view blob - 98b634646628e868e9c779d14a0ac3dc5a12e063 blob + 0e9a3f0ce38fa4e708a2ee6c88f0da7f840032a1 --- tog/tog.1 +++ tog/tog.1 @@ -103,7 +103,10 @@ Open a .Cm tree view showing the tree for the currently selected commit. .It Cm Backspace -Show log entries for the parent directory of the currently selected path. +Show log entries for the parent directory of the currently selected path, +unless an active search is in progress in which case +.Cm Backspace +aborts the search. .It Cm / Prompt for a search pattern and start searching for matching commits. The search pattern is an extended regular expression which is matched @@ -113,8 +116,14 @@ Regular expression syntax is documented in .Xr re_format 7 . .It Cm n Find the next commit which matches the current search pattern. +Searching continues until either a match is found or the +.Cm Backspace +key is pressed. .It Cm N Find the previous commit which matches the current search pattern. +Searching continues until either a match is found or the +.Cm Backspace +key is pressed. .It Cm Ctrl+l Reload the log view with new commits found in the repository. .El blob - 419435b7c7b9acd5bed04c64feff1de3ccab0d23 blob + 4516ca1b006482d877a7e481e7aaba13ebcedb8e --- tog/tog.c +++ tog/tog.c @@ -1755,6 +1755,10 @@ search_next_log_view(struct tog_view *view) } if (s->search_entry) { + if (wgetch(view->window) == KEY_BACKSPACE) { + view->search_next_done = 1; + return NULL; + } if (view->searching == TOG_SEARCH_FORWARD) entry = TAILQ_NEXT(s->search_entry, entry); else