I upgraded from SlickEdit v21 to v22 and now my color coding macros broke. Can someone from the SlickEdit team please help me make them work again? It is way too slow to use the GUI to add tokens, I don't understand why Slick does not ship with macros for this.
Here are my macros that worked great for v21:
_command
vusrmacs_colorCode1() name_info(',')
{
_macro('R',1);
vusrmacs_colorCode('punctuation');
}
_command
vusrmacs_colorCode2() name_info(',')
{
_macro('R',1);
vusrmacs_colorCode('libkeywords');
}
_command
vusrmacs_colorCode3() name_info(',')
{
_macro('R',1);
vusrmacs_colorCode('operators');
}
_command
vusrmacs_colorCode4() name_info(',')
{
_macro('R',1);
vusrmacs_colorCode('userkeywords');
}
_command
vusrmacs_colorCode5() name_info(',')
{
_macro('R',1);
vusrmacs_colorCode('keywords');
}
static void
vusrmacs_colorCode(
_str colorName)
{
int result;
_str newSymbol = cur_word(result);
CLEXDEF clexdef;
_init_clexdef(clexdef);
LoadLexer(p_lexer_name, clexdef);
_str colorNames[];
colorNames :+= 'punctuation';
colorNames :+= 'libkeywords';
colorNames :+= 'operators';
colorNames :+= 'userkeywords';
colorNames :+= 'keywords';
int i;
for (i = 0; i < colorNames._length(); i++)
{
STRARRAYPTR array;
if (i == 0) array = &clexdef.symbol1;
else if (i == 1) array = &clexdef.symbol2;
else if (i == 2) array = &clexdef.symbol3;
else if (i == 3) array = &clexdef.symbol4;
else array = &clexdef.keywords;
int j, deleteIndex = -1;
for (j = 0; j < array->_length(); j++)
{
if (newSymbol == (*array)[j])
{
deleteIndex = j;
break;
}
}
if (deleteIndex >= 0)
{
array->_deleteel(deleteIndex);
}
else if (colorName == colorNames[i])
{
array->_insertel(newSymbol, 0);
}
}
SaveLexer(p_lexer_name, clexdef);
_clex_load(p_lexer_name);
cursor_down();
}