comparison mcabber/mcabber/screen.c @ 1756:e2c084204583

Add (optional) suffix after nick completion in Multi-User Chats New option: 'completion_muc_suffix' Closes issue #20 in mcabber-crew BTS.
author Mikael Berthe <mikael@lilotux.net>
date Sat, 13 Mar 2010 13:18:07 +0100
parents 51a23403cc80
children 61f0482d3993
comparison
equal deleted inserted replaced
1755:84487d78d0ea 1756:e2c084204583
3520 GSList *list = compl_get_category_list(compl_categ, &dynlist); 3520 GSList *list = compl_get_category_list(compl_categ, &dynlist);
3521 if (list) { 3521 if (list) {
3522 guint n; 3522 guint n;
3523 char *prefix = g_strndup(row, ptr_inputline-row); 3523 char *prefix = g_strndup(row, ptr_inputline-row);
3524 // Init completion 3524 // Init completion
3525 n = new_completion(prefix, list); 3525 n = new_completion(prefix, list,
3526 (compl_categ == COMPL_RESOURCE ?
3527 settings_opt_get("completion_muc_suffix") : NULL));
3526 g_free(prefix); 3528 g_free(prefix);
3527 if (n == 0 && nrow == -1) { 3529 if (n == 0 && nrow == -1) {
3528 // This is a MUC room and we can't complete from the beginning of the 3530 // This is a MUC room and we can't complete from the beginning of the
3529 // line. Let's try a bit harder and complete the current word. 3531 // line. Let's try a bit harder and complete the current word.
3530 row = prev_char(ptr_inputline, inputLine); 3532 row = prev_char(ptr_inputline, inputLine);
3538 row = prev_char((char*)row, inputLine); 3540 row = prev_char((char*)row, inputLine);
3539 } 3541 }
3540 // There's no need to try again if row == inputLine 3542 // There's no need to try again if row == inputLine
3541 if (row > inputLine) { 3543 if (row > inputLine) {
3542 prefix = g_strndup(row, ptr_inputline-row); 3544 prefix = g_strndup(row, ptr_inputline-row);
3543 new_completion(prefix, list); 3545 new_completion(prefix, list, NULL);
3544 g_free(prefix); 3546 g_free(prefix);
3545 } 3547 }
3546 } 3548 }
3547 // Free the list if it's a dynamic one 3549 // Free the list if it's a dynamic one
3548 if (dynlist) { 3550 if (dynlist) {