在 TextMate 1.5.10 r1623 中,你可以使用小箭头折叠方法块:
不幸的是,如果你有一个多行的 Python 注释,它无法识别,因此你无法将其折叠:
![alt text](https://istack.dev59.com/mbcBX.webp)
不幸的是,如果你有一个多行的 Python 注释,它无法识别,因此你无法将其折叠:
def foo():
"""
How do
I fold
these comments?
"""
print "bar"
TextMate网站上有关于如何自定义折叠的内容:http://manual.macromates.com/en/navigation_overview#customizing_foldings
但我不太擅长正则表达式,无法对其进行任何修改。TextMate使用Oniguruma正则表达式API,而我正在使用通过GetBundles更新到最新版本的默认Python.tmbundle。
有人知道如何实现吗?感谢您提前的帮助! :)
在Bundle Editor中的Python语言下添加默认的foldingStartMarker
和foldingStopMarker
正则表达式值:
foldingStartMarker = '^\s*(def|class)\s+([.a-zA-Z0-9_ <]+)\s*(\((.*)\))?\s*:|\{\s*$|\(\s*$|\[\s*$|^\s*"""(?=.)(?!.*""")';
foldingStopMarker = '^\s*$|^\s*\}|^\s*\]|^\s*\)|^\s*"""\s*$';
"""|'''
的事吗? - user395760