changeset 449:7d9fa9f7caf1

Rename tab completion functions.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 26 May 2012 04:09:03 +0300
parents 73ff0a592b2f
children a8373a1ce1eb
files main.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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;