forked from teamnwah/openmw-tes3coop
Console autocompletion: List candidates when repeatedly pressing tab (bash-style)
This commit is contained in:
parent
92467ba6bc
commit
df1694c27b
1 changed files with 14 additions and 8 deletions
|
@ -215,16 +215,22 @@ namespace MWGui
|
|||
{
|
||||
std::vector<std::string> matches;
|
||||
listNames();
|
||||
mCommandLine->setCaption(complete( mCommandLine->getOnlyText(), matches ));
|
||||
#if 0
|
||||
int i = 0;
|
||||
for(std::vector<std::string>::iterator it=matches.begin(); it < matches.end(); ++it,++i )
|
||||
std::string oldCaption = mCommandLine->getCaption();
|
||||
std::string newCaption = complete( mCommandLine->getOnlyText(), matches );
|
||||
mCommandLine->setCaption(newCaption);
|
||||
|
||||
// List candidates if repeatedly pressing tab
|
||||
if (oldCaption == newCaption && matches.size())
|
||||
{
|
||||
printOK( *it );
|
||||
if( i == 50 )
|
||||
break;
|
||||
int i = 0;
|
||||
printOK("");
|
||||
for(std::vector<std::string>::iterator it=matches.begin(); it < matches.end(); ++it,++i )
|
||||
{
|
||||
printOK( *it );
|
||||
if( i == 50 )
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if(mCommandHistory.empty()) return;
|
||||
|
|
Loading…
Reference in a new issue