Console autocompletion: List candidates when repeatedly pressing tab (bash-style)

openmw-30
scrawl 11 years ago
parent 92467ba6bc
commit df1694c27b

@ -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…
Cancel
Save