From 4ce737379f2dab00b7e72670258a39295d0a8d06 Mon Sep 17 00:00:00 2001
From: Petr Baudis <pasky@ucw.cz>
Date: Wed, 12 Oct 2005 09:50:41 +0200
Subject: [PATCH] Call option_changed() on two more appropriate places

This should fix the bug with toggled options not getting saved, and
changehooks wouldn't be called on certain circumstances (if there were
any to be called, anyway - but it is more correct now).
---
 src/config/options.c     | 1 +
 src/viewer/text/search.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/config/options.c b/src/config/options.c
index fe5e943b5..f1af14eb8 100644
--- a/src/config/options.c
+++ b/src/config/options.c
@@ -956,6 +956,7 @@ toggle_option(struct session *ses, struct option *option)
 
 	/* TODO: call change hooks. --jonas */
 	option->value.number = (number <= option->max) ? number : option->min;
+	option_changed(ses, option, option);
 }
 
 static int
diff --git a/src/viewer/text/search.c b/src/viewer/text/search.c
index f063e69a6..b14e098ba 100644
--- a/src/viewer/text/search.c
+++ b/src/viewer/text/search.c
@@ -1330,7 +1330,7 @@ text_typeahead_handler(struct input_line *line, int action_id)
 
 			opt->value.number = (opt->value.number + 1)
 					    % (opt->max + 1);
-			opt->flags |= OPT_TOUCHED;
+			option_changed(ses, opt, opt);
 		}
 		/* Fall thru */