相信阅读过大型源代码的,都知道Source Insight。
今天花了点时间,整理了两个宏,使用快捷键生成代码注释。很方便。
废话少说,进入主题!
①打开Source Insight > Project > Open Project > Base > OK
②打开Utils.em 宏文件
③添加以下宏(跟C语言的函数差不多)
//多行代码注释
macro MultiLineComment()
{
hwnd = GetCurrentWnd() //获得文本窗口
selection = GetWndSel(hwnd) //获得选择对象
LnFirst = GetWndSelLnFirst(hwnd) //取首行行号
LnLast = GetWndSelLnLast(hwnd) //取末行行号
hbuf = GetCurrentBuf() //获得当前窗口文本
Ln = LnFirst
while(Ln <= Lnlast) {
//取Ln对应的行
buf = GetBufLine(hbuf, Ln)
//跳过空行
if(buf == ""){
Ln = Ln + 1
continue
}
//若已注释则取消注释
if(StrMid(buf, 0, 1) == "/") {
if(S