From f4c6a6f8dc072b821ee42129a2905beaaa8d0320 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sat, 9 Feb 2013 16:35:39 +0100 Subject: [PATCH] Added flags to enable search highlight feature. --- config.mk | 1 + src/command.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.mk b/config.mk index 961fe8b..1f06e1f 100644 --- a/config.mk +++ b/config.mk @@ -37,6 +37,7 @@ LDFLAGS += $(shell pkg-config --libs $(LIBS)) -lX11 -lXext # features CPPFLAGS += -DFEATURE_COOKIE +CPPFLAGS += -DFEATURE_SEARCH_HIGHLIGHT CPPFLAGS += -DVERSION=\"${VERSION}\" ifeq ($(USEGTK3), 1) diff --git a/src/command.c b/src/command.c index a44458d..f14a77f 100644 --- a/src/command.c +++ b/src/command.c @@ -367,7 +367,9 @@ gboolean command_search(const Arg* arg) if (arg->i == VP_SEARCH_OFF && state->search_query) { OVERWRITE_STRING(state->search_query, NULL); +#ifdef FEATURE_SEARCH_HIGHLIGHT webkit_web_view_unmark_text_matches(vp.gui.webview); +#endif return TRUE; } @@ -382,9 +384,10 @@ gboolean command_search(const Arg* arg) } if (state->search_query) { +#ifdef FEATURE_SEARCH_HIGHLIGHT webkit_web_view_mark_text_matches(vp.gui.webview, state->search_query, FALSE, 0); webkit_web_view_set_highlight_text_matches(vp.gui.webview, TRUE); - +#endif webkit_web_view_search_text(vp.gui.webview, state->search_query, FALSE, forward, TRUE); } -- 2.20.1