comparison mcabber/src/screen.c @ 285:edc263a5d350

Add /alias command Add /alias command and update completion sytem. Aliases are expanded before cmd_get() is called.
author Mikael Berthe <mikael@lilotux.net>
date Thu, 07 Jul 2005 23:25:20 +0100
parents f562b9af2de7
children 1eea0fa0955e
comparison
equal deleted inserted replaced
284:f879b17ecb8e 285:edc263a5d350
1372 1372
1373 if (nrow == 0) { // Command completion 1373 if (nrow == 0) { // Command completion
1374 row = &inputLine[1]; 1374 row = &inputLine[1];
1375 compl_categ = COMPL_CMD; 1375 compl_categ = COMPL_CMD;
1376 } else { // Other completion, depending on the command 1376 } else { // Other completion, depending on the command
1377 cmd *com = cmd_get(inputLine); 1377 int alias = FALSE;
1378 if (!com || !row) { 1378 cmd *com;
1379 char *xpline = expandalias(inputLine);
1380 com = cmd_get(xpline);
1381 if (xpline != inputLine) {
1382 // This is an alias, so we can't complete rows > 0
1383 alias = TRUE;
1384 g_free(xpline);
1385 }
1386 if ((!com && (!alias || !completion_started)) || !row) {
1379 scr_LogPrint("I cannot complete that..."); 1387 scr_LogPrint("I cannot complete that...");
1380 return; 1388 return;
1381 } 1389 }
1382 compl_categ = com->completion_flags[nrow-1]; 1390 if (!alias)
1391 compl_categ = com->completion_flags[nrow-1];
1392 else
1393 compl_categ = 0;
1383 } 1394 }
1384 1395
1385 if (!completion_started) { 1396 if (!completion_started) {
1386 GSList *list = compl_get_category_list(compl_categ); 1397 GSList *list = compl_get_category_list(compl_categ);
1387 if (list) { 1398 if (list) {