1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Add plugin commands to command autocompleter

This commit is contained in:
James Booth 2013-08-03 03:20:17 +01:00
parent c3acda5da7
commit 17e14347e3
5 changed files with 16 additions and 1 deletions

View File

@ -90,7 +90,8 @@ fi
# Default parameters # Default parameters
AM_CFLAGS="-Wall -I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -L/usr/lib/python2.7/config -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions" AM_CFLAGS="-Wall -I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -L/usr/lib/python2.7/config -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions"
if test "x$PACKAGE_STATUS" = xdevelopment; then if test "x$PACKAGE_STATUS" = xdevelopment; then
AM_CFLAGS="$AM_CFLAGS -Wunused -Werror" # AM_CFLAGS="$AM_CFLAGS -Wunused -Werror"
AM_CFLAGS="$AM_CFLAGS -Wunused"
fi fi
LIBS="$LIBS $DEPS_LIBS $NOTIFY_LIBS -lpthread -ldl -lutil -lm -lpython2.7" LIBS="$LIBS $DEPS_LIBS $NOTIFY_LIBS -lpthread -ldl -lutil -lm -lpython2.7"

View File

@ -980,6 +980,12 @@ cmd_init(void)
cmd_history_init(); cmd_history_init();
} }
void
cmd_autocomplete_add(const char * const command)
{
autocomplete_add(commands_ac, strdup(command));
}
void void
cmd_close(void) cmd_close(void)
{ {

View File

@ -49,4 +49,6 @@ void cmd_history_append(char *inp);
char *cmd_history_previous(char *inp, int *size); char *cmd_history_previous(char *inp, int *size);
char *cmd_history_next(char *inp, int *size); char *cmd_history_next(char *inp, int *size);
void cmd_autocomplete_add(const char * const command);
#endif #endif

View File

@ -20,7 +20,11 @@
* *
*/ */
#include "command/command.h"
#include "plugins/command.h" #include "plugins/command.h"
#include "tools/autocomplete.h"
#include "ui/ui.h"
// API functions // API functions
@ -30,6 +34,7 @@ void
add_command(PluginCommand *command) add_command(PluginCommand *command)
{ {
p_commands = g_slist_append(p_commands, command); p_commands = g_slist_append(p_commands, command);
cmd_autocomplete_add(command->command_name);
} }
gboolean gboolean

View File

@ -23,6 +23,7 @@
#include <Python.h> #include <Python.h>
#include "plugins/api.h" #include "plugins/api.h"
#include "plugins/command.h"
#include "plugins/plugins.h" #include "plugins/plugins.h"
#include "ui/ui.h" #include "ui/ui.h"