"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Re: tog: 'n' before '/'
To:
gameoftrees@openbsd.org
Date:
Sun, 24 Jan 2021 16:53:14 +0100

Download raw body.

Thread
Stefan Sperling:

> --- tog/tog.c
> +++ tog/tog.c
> @@ -939,7 +939,7 @@ view_input(struct tog_view **new, int *done, struct to
>  		break;
>  	case 'N':
>  	case 'n':
> -		if (view->search_next) {
> +		if (view->searching) {
>  			view->searching = (ch == 'n' ?
>  			    TOG_SEARCH_FORWARD : TOG_SEARCH_BACKWARD);
>  			view->search_next_done = 0;

The "if (view->search_next)" checks whether a view implements a
search_next function.  You don't want to drop that.

-               if (view->search_next) {
+               if (view->search_next && view->searching) {

That seems to do it.

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de