Skip to content

Commit

Permalink
Fix segfault when pressing Enter in a child main view
Browse files Browse the repository at this point in the history
This fixes a segmentation fault when trying to forward request to
the child view while we are in the child view. It occured only with
focus-child = no and send-child-enter = yes.
  • Loading branch information
koutcher committed Feb 21, 2021
1 parent a037377 commit 3041805
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tig.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ view_request(struct view *view, enum request request)
if (!view || !view->lines)
return request;

if (request == REQ_ENTER && !opt_focus_child && opt_send_child_enter &&
if (request == REQ_ENTER && view == display[0] &&
!opt_focus_child && opt_send_child_enter &&
view_has_flags(view, VIEW_SEND_CHILD_ENTER)) {
struct view *child = display[1];

Expand Down

0 comments on commit 3041805

Please sign in to comment.