* Overhaul of console autocompletion
- No longer does weird stuff like move the cursor inappropriately - Autocomplete works with compound commands - Special autocomplete on some commands e.g. \map, \demo - Removed various hacks used to counter the original autocomplete code
This commit is contained in:
1 parent
893629fb0f
commit
c3f7915a8b
8 files changed
+340
-103
No files matched your search
+20
-3
@@ -439,7 +439,7 @@ will point into this temporary buffer.
|
||||
*/
|
||||
// NOTE TTimo define that to track tokenization issues
|
||||
//#define TKN_DBG
|
||||
void Cmd_TokenizeString( const char *text_in ) {
|
||||
static void Cmd_TokenizeString2( const char *text_in, qboolean ignoreQuotes ) {
|
||||
const char *text;
|
||||
char *textOut;
|
||||
|
||||
@@ -495,7 +495,7 @@ void Cmd_TokenizeString( const char *text_in ) {
|
||||
|
||||
// handle quoted strings
|
||||
// NOTE TTimo this doesn't handle \" escaping
|
||||
if ( *text == '"' ) {
|
||||
if ( !ignoreQuotes && *text == '"' ) {
|
||||
cmd_argv[cmd_argc] = textOut;
|
||||
cmd_argc++;
|
||||
text++;
|
||||
@@ -516,7 +516,7 @@ void Cmd_TokenizeString( const char *text_in ) {
|
||||
|
||||
// skip until whitespace, quote, or command
|
||||
while ( *text > ' ' ) {
|
||||
if ( text[0] == '"' ) {
|
||||
if ( !ignoreQuotes && text[0] == '"' ) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -541,6 +541,23 @@ void Cmd_TokenizeString( const char *text_in ) {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cmd_TokenizeString
|
||||
============
|
||||
*/
|
||||
void Cmd_TokenizeString( const char *text_in ) {
|
||||
Cmd_TokenizeString2( text_in, qfalse );
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cmd_TokenizeStringIgnoreQuotes
|
||||
============
|
||||
*/
|
||||
void Cmd_TokenizeStringIgnoreQuotes( const char *text_in ) {
|
||||
Cmd_TokenizeString2( text_in, qtrue );
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
|
||||
Reference in new issue
Block a user