aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/textadept.c
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-07 10:39:19 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-09-07 10:39:19 -0400
commitc97f531abfb3053317b10d605eabf3aaaabab413 (patch)
treec102e9904e128e6bbd3ff4e86449366b6abf9dd3 /src/textadept.c
parentb1af2bb28476440eb10716e6b734b0d4e68bc57a (diff)
Added `ui.find.active` and prevent word highlighting when searching.
Word auto-highlighting when searching is too distracting.
Diffstat (limited to 'src/textadept.c')
-rw-r--r--src/textadept.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/textadept.c b/src/textadept.c
index 7b8ef5f7..e7f1e8f4 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -131,6 +131,7 @@ static ListStore *find_history, *repl_history;
#define set_label_text(l, t) gtk_label_set_text_with_mnemonic(GTK_LABEL(l), t)
#define set_button_label(b, l) gtk_button_set_label(GTK_BUTTON(b), l)
#define set_option_label(o, _, l) gtk_button_set_label(GTK_BUTTON(o), l)
+#define find_active(w) gtk_widget_get_visible(w)
// GTK command entry.
#define command_entry_focused gtk_widget_has_focus(command_entry)
#elif CURSES
@@ -176,6 +177,7 @@ static ListStore find_history[10], repl_history[10];
copyfree(&option_labels[i], lua_tostring(L, -1)); \
if (!*option) option_labels[i] += 4; \
} while (false)
+#define find_active(w) (w != NULL)
// Curses command entry and statusbar.
static bool command_entry_focused;
int statusbar_length[2];
@@ -490,6 +492,8 @@ static int find_index(lua_State *L) {
lua_pushboolean(L, checked(regex));
else if (strcmp(key, "in_files") == 0)
lua_pushboolean(L, checked(in_files));
+ else if (strcmp(key, "active") == 0)
+ lua_pushboolean(L, find_active(findbox));
else
lua_rawget(L, 1);
return 1;