rename Con_CompleteCommandLine to Con_BasicCompleteCommandLine and make it

use inputline_t rather than the key_lines junk.
This commit is contained in:
Bill Currie 2001-07-18 18:29:38 +00:00
parent f70e2e8296
commit 882de10388

View file

@ -42,15 +42,10 @@
#include "QF/cvar.h" #include "QF/cvar.h"
//FIXME eww //FIXME eww
#define MAXCMDLINE 256
extern char key_lines[32][MAXCMDLINE];
extern int edit_line;
extern int key_linepos;
extern int con_linewidth; extern int con_linewidth;
/* /*
Con_CompleteCommandLine Con_BasicCompleteCommandLine
New function for tab-completion system New function for tab-completion system
Added by EvilTypeGuy Added by EvilTypeGuy
@ -59,7 +54,7 @@ extern int con_linewidth;
*/ */
void void
Con_CompleteCommandLine (void) Con_BasicCompleteCommandLine (inputline_t *il)
{ {
const char *cmd = ""; const char *cmd = "";
char *s; char *s;
@ -67,7 +62,7 @@ Con_CompleteCommandLine (void)
int cmd_len; int cmd_len;
const char **list[3] = {0, 0, 0}; const char **list[3] = {0, 0, 0};
s = key_lines[edit_line] + 1; s = il->lines[il->edit_line] + 1;
if (*s == '\\' || *s == '/') if (*s == '\\' || *s == '/')
s++; s++;
@ -135,14 +130,14 @@ Con_CompleteCommandLine (void)
} }
if (cmd) { if (cmd) {
key_lines[edit_line][1] = '/'; il->lines[il->edit_line][1] = '/';
strncpy(key_lines[edit_line] + 2, cmd, cmd_len); strncpy(il->lines[il->edit_line] + 2, cmd, cmd_len);
key_linepos = cmd_len + 2; il->linepos = cmd_len + 2;
if (c + v + a == 1) { if (c + v + a == 1) {
key_lines[edit_line][key_linepos] = ' '; il->lines[il->edit_line][il->linepos] = ' ';
key_linepos++; il->linepos++;
} }
key_lines[edit_line][key_linepos] = 0; il->lines[il->edit_line][il->linepos] = 0;
} }
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
if (list[i]) if (list[i])