~alivema4ever/ubuntu/trusty/weechat/lp-1299347-fix

« back to all changes in this revision

Viewing changes to src/core/wee-completion.c

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bouthenot
  • Date: 2013-05-21 19:44:31 UTC
  • mfrom: (1.1.24)
  • Revision ID: package-import@ubuntu.com-20130521194431-o1n165ouj17uk0q1
Tags: 0.4.1-1
* New upstream release
* Move guile build dependency from to guile-2.0-dev (previous versions are
  no longer supported).
* Add supported protocols in long description. Thanks to Jonas Smedegaard
  for the suggestion (Closes: #705216)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
#include "../gui/gui-buffer.h"
47
47
#include "../gui/gui-color.h"
48
48
#include "../gui/gui-filter.h"
 
49
#include "../gui/gui-layout.h"
49
50
#include "../gui/gui-key.h"
50
51
#include "../gui/gui-nicklist.h"
51
52
#include "../gui/gui-window.h"
295
296
    (void) value;
296
297
 
297
298
    gui_completion_list_add ((struct t_gui_completion *)data,
298
 
                             (char *)key,
 
299
                             (const char *)key,
299
300
                             0, WEECHAT_LIST_POS_SORT);
300
301
}
301
302
 
1270
1271
}
1271
1272
 
1272
1273
/*
 
1274
 * Adds layout names to completion list.
 
1275
 */
 
1276
 
 
1277
int
 
1278
completion_list_add_layouts_names_cb (void *data,
 
1279
                                      const char *completion_item,
 
1280
                                      struct t_gui_buffer *buffer,
 
1281
                                      struct t_gui_completion *completion)
 
1282
{
 
1283
    struct t_gui_layout *ptr_layout;
 
1284
 
 
1285
    /* make C compiler happy */
 
1286
    (void) data;
 
1287
    (void) completion_item;
 
1288
    (void) buffer;
 
1289
 
 
1290
    for (ptr_layout = gui_layouts; ptr_layout;
 
1291
         ptr_layout = ptr_layout->next_layout)
 
1292
    {
 
1293
        gui_completion_list_add (completion, ptr_layout->name,
 
1294
                                 0, WEECHAT_LIST_POS_SORT);
 
1295
    }
 
1296
 
 
1297
    return WEECHAT_RC_OK;
 
1298
}
 
1299
 
 
1300
/*
1273
1301
 * Adds hooks for completions done by WeeChat core.
1274
1302
 */
1275
1303
 
1361
1389
    hook_completion (NULL, "cursor_areas",
1362
1390
                     N_("areas (\"chat\" or bar name) for free cursor movement"),
1363
1391
                     &completion_list_add_cursor_areas_cb, NULL);
 
1392
    hook_completion (NULL, "layouts_names",
 
1393
                     N_("names of layouts"),
 
1394
                     &completion_list_add_layouts_names_cb, NULL);
1364
1395
}