2

Vimの表現については何も知りません。xdebugトレースファイルの構文ファイルが付属しているvimfoldexprがあります。既存の式は次のようになります。

foldexpr=strlen(substitute(substitute(substitute(substitute(getline(v:lnum),'^TR.*$','',''),'\\s>=>','->',\"g\"),'^\\s.\\{20\\}\\(\\s\\+\\)\\?->.*$','\\1',''),'\\s\\s','\',\"g\"))-2

これは、次のようなデフォルトのトレースファイルで問題なく機能します。

0.0974    3908596     -> GenericDispatcher->dispatch() /home/tomw/source/public_html/main.php:49
0.0975    3908676       -> ReflectionClass->getMethods() /home/tomw/source/presentation/framework/routing/GenericDispatcher.php:59
0.0975    3910532       -> ReflectionFunctionAbstract->getName() /home/tomw/source/presentation/framework/routing/GenericDispatcher.php:60

ただし、トレースにmemデルタを表示するようにXdebugを構成すると、トレースファイルは次のようになります(メモリデルタのある余分な列に注意してください。たとえば、+ 80)。

0.0964    3908336      +84     -> GenericDispatcher->dispatch() /home/tomw/source/public_html/main.php:49
0.0965    3908416      +80       -> ReflectionClass->getMethods() /home/tomw/source/presentation/framework/routing/GenericDispatcher.php:59
0.0965    3910272    +1856       -> ReflectionFunctionAbstract->getName() /home/tomw/source/presentation/framework/routing/GenericDispatcher.php:60 

2番目の例で折りたたみが正しく機能するように元の式を変更する方法を教えてもらえますか?頭も尻尾も作れません。

ありがとう

4

1 に答える 1