1、打开Source Insight,【项目】---【打开项目】,打开base项目;
2、在utils.em代码当中添加如下代码:macroMultiLineComment猾诮沓靥(){hwnd=GetCurrentWnd()selection=GetWndSel(hwnd)讣嘬铮篌LnFirst=GetWndSelLnFirst(hwnd)//取首行行号LnLast=GetWndSelLnLast(hwnd)//取末行行号hbuf=GetCurrentBuf()if(GetBufLine(hbuf,0)=="//magic-number:tph85666031"){stop}Ln=Lnfirstbuf=GetBufLine(hbuf,Ln)len=strlen(buf)while(Ln<=Lnlast){buf=GetBufLine(hbuf,Ln)//取Ln对应的行if(buf==""){//跳过空行Ln=Ln+1continue}if(StrMid(buf,0,1)=="/"){//需要取消注释,防止只有单字符的行if(StrMid(buf,1,2)=="/"){PutBufLine(hbuf,Ln,StrMid(buf,2,Strlen(buf)))}}if(StrMid(buf,0,1)!="/"){//需要添加注释PutBufLine(hbuf,Ln,Cat("//",buf))}Ln=Ln+1}SetWndSel(hwnd,selection)}
3、【选项】---【菜单分配】,命令栏选择刚才加入的宏MultiLineComment,menu栏选择你方便操作的菜单就行,一般选择工作,点击插入;
4、点击确定后,会在菜单栏显示工作菜单,在工作菜单下拉列表中就有MultiLineComment,今后使用时,选中要注释的行,点击这个标签就注释掉了。