[英]Textmate code folding
我正在做一個大項目,所以我經常使用代碼折疊。 我基本上有兩種類型的代碼:
1。
help.scroll = function() {
// some code
}
2。
help.scroll = {
// some code
};
因此,Textmate會折疊第一個代碼,但不會折疊第二個代碼。
原始的折疊開始標記看起來像這樣
foldingStartMarker = '^.*\\bfunction\\s*(\\w+\\s*)?\\([^\\)]*\\)(\\s*\\{[^\\}]*)?\\s*$';
我想結束標記是可以的
foldingStopMarker = '^\\s*\\}';
所以我的問題是-如何修改“ foldingStartMarker”,以便Textmate可以折疊兩個代碼塊。
提前
不知道您的textmate版本,但以下內容可能與textmate 2.0(9283)一樣工作:
{ foldingStartMarker = '\{\s*(//.*)?$|\[\s*(//.*)?$|\(\s*(//.*)?$';
foldingStopMarker = '^\s*\}|^\s*\]|^\s*\)';
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.