Небольшое логическое продолжение по итогам активного использования hot-keys для скриптов:
AXSaveLocation ver. 1.0.0 beta (for AX4, AX5), 16.02.2012
Назначение:
Скрипт для сохранения текущей позиции курсора в редакторе с целью последующего возврата к ней скриптом AXGoBack.
X++:
//AXSaveLocation ver. 1.0.0 beta (for AX4, AX5), 16.02.2012
//Developed by alex55 (AXforum.info)
//Home page: axforum.info/forums/showthread.php?p=226663
void aaAXSaveLocation(Editor e)
{
#define.SaveLocationParamsCache('AXSaveLocationParams')
Column editorColumn;
Line editorLine;
TreeNodePath methodNodePath; //Initial method path
;
editorLine = e.currentLineNo() + 1;
editorColumn = e.ColumnNo() + 1;
methodNodePath = e.path();
infolog.globalCache().set(#SaveLocationParamsCache, #SaveLocationParamsCache, [methodNodePath, editorLine, editorColumn]);
return;
}
AXGoBack ver. 1.0.1 beta (for AX4, AX5), 16.02.2012
Доработано:
- Возможность однократного возврата после перехода к объявлению переменной объединена с возможностью многократного возврата к позиции курсора, сохраненной скриптом AXSaveLocation. Думаю в таком варианте будет удобно использовать на общем hot-key.
- Убрана поддержка AX3.
X++:
//AXGoBack ver. 1.0.1 beta (for AX4, AX5), 16.02.2012
//Developed by alex55 (AXforum.info)
//Home page: axforum.info/forums/showthread.php?p=226663
//Thanks to Alex_KD and kashperuk from AXForum.info for some used ideas
void aaAXGoBack(Editor e)
{
#AOT
#if.ReferencesPath
#define.AX4OrAX5
#endif
#define.ThisClassCache('AXGoToDeclarationXRefClass')
#define.ParamsCache('AXGoToDeclarationXRefParams')
#define.GoBackParamsCache('AXGoBackParams')
#define.SaveLocationParamsCache('AXSaveLocationParams')
SysGlobalCache globalCache;
Column editorColumn;
Line editorLine;
TreeNodePath methodNodePath;
TreeNode treeNode;
;
globalCache = infolog.globalCache();
if (globalCache)
{
[methodNodePath, editorLine, editorColumn] = globalCache.get(#GoBackParamsCache, #GoBackParamsCache, conNull());
treeNode = TreeNode::findNode(methodNodePath);
if (treeNode)
{
#if.AX4OrAX5
treeNode.AOTedit(editorLine, editorColumn);
#endif
globalCache.clear(#GoBackParamsCache);
}
else
{
[methodNodePath, editorLine, editorColumn] = globalCache.get(#SaveLocationParamsCache, #SaveLocationParamsCache, conNull());
treeNode = TreeNode::findNode(methodNodePath);
if (treeNode)
{
#if.AX4OrAX5
treeNode.AOTedit(editorLine, editorColumn);
#endif
}
}
}
return;
}