aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/textadept.c
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-13 10:45:12 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-13 10:45:12 -0400
commit24de99fb828441c367a62886cc6800babe72cc57 (patch)
treeeec1f5ac5dca8682d575dd6fefff903f3301837f /src/textadept.c
parent9292a335d7a9dfd102c10ca66a1210aa39ac3739 (diff)
Moved `ui.command_entry.active` into C.
It's more reliable and is similar to `ui.find.active`.
Diffstat (limited to 'src/textadept.c')
-rw-r--r--src/textadept.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/textadept.c b/src/textadept.c
index 994002c1..8695bc0f 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -1321,7 +1321,10 @@ static int buffer_index(lua_State *L) {
//#elif CURSES
// TODO: tabs
#endif
- } else if (strcmp(lua_tostring(L, 2), "height") == 0 &&
+ } else if (strcmp(lua_tostring(L, 2), "active") == 0 &&
+ lua_todoc(L, 1) == SS(command_entry, SCI_GETDOCPOINTER, 0, 0))
+ lua_pushboolean(L, command_entry_focused);
+ else if (strcmp(lua_tostring(L, 2), "height") == 0 &&
lua_todoc(L, 1) == SS(command_entry, SCI_GETDOCPOINTER, 0, 0)) {
// Return the command entry's pixel height.
#if GTK