Слегка поменял EditorScript - теперь в случае только одного варианта окно не мигает
X++:
// util, bmi, 23.06.04
void go(Editor e)
{
boolean activate;
boolean hasSelection()
{
return e.selectionStartCol()!=e.selectionEndCol();
}
str selection()
{
;
return subStr(e.currentLine(),
e.selectionStartCol(),
e.selectionEndCol()-e.selectionStartCol());
}
boolean isIdentifier(str _char)
{
return match('[a-z0-9_]', _char);
}
str currentIdentifier()
{
str line = e.currentLine();
int pos;
int idStart;
;
for(pos = e.selectionStartCol(); pos >= 0 && isIdentifier(subStr(line, pos, 1)); pos--)
pos=pos;
idStart = pos + 1;
for(pos = e.selectionStartCol()+1; pos <= strLen(line) && isIdentifier(subStr(line, pos, 1)); pos++)
pos=pos;
return subStr(line, idStart, pos - idStart);
}
str currentText()
{
return hasSelection() ? selection() : currentIdentifier();
}
void goComponent(str _componentName="")
{
FormRun r;
Object o;
SysGlobalCache cache=infolog.globalCache();
boolean go;
;
if(cache.isSet(formStr(Dev_GoComponent), 'running'))
{
r=cache.get(formStr(Dev_GoComponent), 'running');
activate = true;
}
else
{
r=new FormRun(new Args(formStr(Dev_GoComponent)));
r.init();
}
o=r;
o.componentName(_componentName);
if (o.isSingle())
{
go = o.go();
}
if(go)
{
r.close();
}
else
{
if (activate)
infolog.activateWindow(r.hWnd());
else
r.run();
r.detach();
}
}
;
goComponent(currentText());
}