Cleanup al_list from builtin_complete.cpp

This commit is contained in:
ridiculousfish
2012-02-08 00:45:07 -08:00
parent 191eeab589
commit 063fc0c48b
4 changed files with 57 additions and 204 deletions

View File

@@ -1043,9 +1043,7 @@ static void highlight_universal_internal( const wchar_t * buff,
*/
if( (buff[pos] == L'\'') || (buff[pos] == L'\"') )
{
array_list_t l;
al_init( &l );
std::deque<long> lst;
int level=0;
wchar_t prev_q=0;
@@ -1066,7 +1064,7 @@ static void highlight_universal_internal( const wchar_t * buff,
if( level == 0 )
{
level++;
al_push_long( &l, (long)(str-buff) );
lst.push_back((long)(str-buff));
prev_q = *str;
}
else
@@ -1076,7 +1074,7 @@ static void highlight_universal_internal( const wchar_t * buff,
long pos1, pos2;
level--;
pos1 = al_pop_long( &l );
pos1 = lst.back();
pos2 = str-buff;
if( pos1==pos || pos2==pos )
{
@@ -1090,7 +1088,7 @@ static void highlight_universal_internal( const wchar_t * buff,
else
{
level++;
al_push_long( &l, (long)(str-buff) );
lst.push_back((long)(str-buff));
prev_q = *str;
}
}
@@ -1102,8 +1100,6 @@ static void highlight_universal_internal( const wchar_t * buff,
str++;
}
al_destroy( &l );
if( !match_found )
color[pos] = HIGHLIGHT_ERROR<<16;