Mercurial > hg > nnchat
comparison main.c @ 448:73ff0a592b2f
Remove some debug cruft from tab completion code.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 26 May 2012 03:43:09 +0300 |
parents | 2d650408f5de |
children | 7d9fa9f7caf1 |
comparison
equal
deleted
inserted
replaced
447:2d650408f5de | 448:73ff0a592b2f |
---|---|
1394 endPos = startPos; | 1394 endPos = startPos; |
1395 while (startPos > 0 && str[startPos - 1] != ' ') startPos--; | 1395 while (startPos > 0 && str[startPos - 1] != ' ') startPos--; |
1396 newPattern = TRUE; | 1396 newPattern = TRUE; |
1397 } | 1397 } |
1398 else | 1398 else |
1399 { | |
1400 if (optDebug) | |
1401 printMsg(currWin, "no mode\n"); | |
1402 return FALSE; | 1399 return FALSE; |
1403 } | |
1404 | 1400 |
1405 // Check if this is a command completion | 1401 // Check if this is a command completion |
1406 isCommand = (str[0] == '/' && startPos == 0); | 1402 isCommand = (str[0] == '/' && startPos == 0); |
1407 | 1403 |
1408 if (!isCommand && str[endPos] == optNickSep) | 1404 if (!isCommand && str[endPos] == optNickSep) |
1409 { | 1405 { |
1410 endPos--; | 1406 endPos--; |
1411 if (startPos > 0) | 1407 if (startPos > 0) |
1412 { | |
1413 if (optDebug) | |
1414 printMsg(currWin, "str[endPos] == optNickSep && startPos > 0 (%d)\n", startPos); | |
1415 return FALSE; | 1408 return FALSE; |
1416 } | |
1417 hasSeparator = TRUE; | 1409 hasSeparator = TRUE; |
1418 } | 1410 } |
1419 | 1411 |
1420 hasSpace = (buf->pos > 0 && str[buf->pos - 1] == ' ') || | 1412 hasSpace = (buf->pos > 0 && str[buf->pos - 1] == ' ') || |
1421 (buf->pos <= buf->len && str[buf->pos] == ' '); | 1413 (buf->pos <= buf->len && str[buf->pos] == ' '); |
1433 if (!again) | 1425 if (!again) |
1434 { | 1426 { |
1435 th_free(previous); | 1427 th_free(previous); |
1436 previous = NULL; | 1428 previous = NULL; |
1437 } | 1429 } |
1438 } | |
1439 | |
1440 if (optDebug) | |
1441 { | |
1442 printMsg(currWin, "sPos=%d, ePos=%d <-> bPos=%d, bufLen=%d : pat='%s' (again=%s, hassep=%s, hasspc=%s, newpat=%s, mode=%d)\n", | |
1443 startPos, endPos, buf->pos, buf->len, pattern, | |
1444 again ? "yes" : "no", | |
1445 hasSeparator ? "yes" : "no", | |
1446 hasSpace ? "yes" : "no", | |
1447 newPattern ? "yes" : "no", mode); | |
1448 } | 1430 } |
1449 | 1431 |
1450 if (!pattern) | 1432 if (!pattern) |
1451 return FALSE; | 1433 return FALSE; |
1452 | 1434 |