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
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
AM_CFLAGS="$AM_CFLAGS -Wunused -Werror"
# AM_CFLAGS="$AM_CFLAGS -Wunused -Werror"
AM_CFLAGS="$AM_CFLAGS -Wunused"
fi
LIBS="$LIBS $DEPS_LIBS $NOTIFY_LIBS -lpthread -ldl -lutil -lm -lpython2.7"

View File

@ -980,6 +980,12 @@ cmd_init(void)
cmd_history_init();
}
void
cmd_autocomplete_add(const char * const command)
{
autocomplete_add(commands_ac, strdup(command));
}
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_next(char *inp, int *size);
void cmd_autocomplete_add(const char * const command);
#endif

View File

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

View File

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