# HG changeset patch # User Matti Hamalainen # Date 1337994543 -10800 # Node ID 7d9fa9f7caf155519227ba5b1f10c830b1a2d8e1 # Parent 73ff0a592b2f51d59d6d567bdc38b41c9db3b7ab Rename tab completion functions. diff -r 73ff0a592b2f -r 7d9fa9f7caf1 main.c --- a/main.c Sat May 26 03:43:09 2012 +0300 +++ b/main.c Sat May 26 04:09:03 2012 +0300 @@ -1340,7 +1340,7 @@ } -void tabCompletionProd(nn_editbuf_t *buf, size_t *pi, const size_t startPos, const size_t endPos, char *c) +static void nn_tabcomplete_replace(nn_editbuf_t *buf, size_t *pi, const size_t startPos, const size_t endPos, char *c) { size_t i; @@ -1354,7 +1354,7 @@ } -void tabCompletionFinish(nn_editbuf_t *buf, char **previous, const size_t startPos, const char *name) +static void nn_tabcomplete_finish(nn_editbuf_t *buf, char **previous, const size_t startPos, const char *name) { nn_editbuf_setpos(buf, startPos + 1 + strlen(name)); th_free(*previous); @@ -1362,7 +1362,7 @@ } -BOOL performTabCompletion(nn_editbuf_t *buf) +BOOL nn_tabcomplete_buffer(nn_editbuf_t *buf) { static char *previous = NULL, *pattern = NULL; BOOL again = FALSE, hasSeparator = FALSE, @@ -1449,7 +1449,7 @@ if (user) { size_t i; - tabCompletionProd(buf, &i, startPos, endPos, user->name); + nn_tabcomplete_replace(buf, &i, startPos, endPos, user->name); if (!hasSeparator && startPos == 0) { @@ -1463,7 +1463,7 @@ if (!hasSpace) nn_editbuf_insert(buf, i++, ' '); - tabCompletionFinish(buf, &previous, startPos, user->name); + nn_tabcomplete_finish(buf, &previous, startPos, user->name); return TRUE; } } @@ -2205,8 +2205,8 @@ exitProg = TRUE; break; - case 0x09: // Tab = complete username - performTabCompletion(editBuf); + case 0x09: // Tab = complete username or command + nn_tabcomplete_buffer(editBuf); update = TRUE; break;