Source Insight中的多行注釋

2021-07-30 04:45:37 字數 1131 閱讀 7467

我們經常要對一整段**進行注釋,很多**編輯器都提供了這樣的功能:用快捷鍵「ctrl + /」來實現「//」的多行注釋。

但是在用source insight的時候,發現竟然沒有這樣的功能。於是在網上搜了一下,sourceinsight裡面的多行注釋可以用巨集來實現。

macro multilinecomment()

ln = lnfirst

buf = getbufline(hbuf, ln)

len = strlen(buf)

while(ln <= lnlast)

if(strmid(buf, 0, 1) == "/")

}if(strmid(buf,0,1) !="/")

ln = ln + 1

}setwndsel(hwnd, selection)

}

將上面的**另存為***.em檔案,開啟source insight,將該檔案新增到工程中,然後在options->keyassignments中你就可以看到這個巨集了,巨集的名字是multilinecomments,然後我們為它分配快捷鍵「ctrl + /」,然後就可以了。

這裡還有乙份新增「#ifdef 0」和「#endif」的巨集**:

macro addmacrocomment()

else

szifend = getbufline(hbuf, lnlast+1)

if (szifstart == "#if 0" && szifend =="#endif") else

setwndsel( hwnd, sel )

}

這份巨集的**可以把游標顯示的行注釋掉:

macro commentsingleline()

將一行中滑鼠選中部分注釋掉:

macro commentselstr()

最後是source insight

與巨集有關的資源:

·                 

source insight

官方的巨集庫

·                 

source insight

官方幫助文件

source insight中的多行注釋

我們經常要對一整段 進行注釋,很多 編輯器都提供了這樣的功能 用快捷鍵 ctrl 來實現 的多行注釋。但是在用source insight的時候,發現竟然沒有這樣的功能。於是在網上搜了一下,source insight裡面的多行注釋可以用巨集來實現。1 2 3 4 5 6 7 8 9 10 11 1...

Source Insight中的多行注釋

但是在用source insight的時候,發現竟然沒有這樣的功能。於是在網上搜了一下,sourceinsight裡面的多行注釋可以用巨集來實現。macro multilinecomment ln lnfirst buf getbufline hbuf,ln len strlen buf while...

SourceInsight 中字型間隔太大!

英文版 1.options style properties 2.在左邊style name下找到comment multi line.在其右邊對應的font屬性框下的font name中選 pick.設定為宋體 常規 小四。確定,退回style properties介面,size設為10。最後設定...