{"action":"created","issue":{"url":"https://api.github.com/repos/vim-jp/issues/issues/708","labels_url":"https://api.github.com/repos/vim-jp/issues/issues/708/labels{/name}","comments_url":"https://api.github.com/repos/vim-jp/issues/issues/708/comments","events_url":"https://api.github.com/repos/vim-jp/issues/issues/708/events","html_url":"https://github.com/vim-jp/issues/issues/708","id":59598113,"number":708,"title":"showmatch for ruby is too slow","user":{"login":"koron","id":468368,"avatar_url":"https://avatars.githubusercontent.com/u/468368?v=3","gravatar_id":"","url":"https://api.github.com/users/koron","html_url":"https://github.com/koron","followers_url":"https://api.github.com/users/koron/followers","following_url":"https://api.github.com/users/koron/following{/other_user}","gists_url":"https://api.github.com/users/koron/gists{/gist_id}","starred_url":"https://api.github.com/users/koron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koron/subscriptions","organizations_url":"https://api.github.com/users/koron/orgs","repos_url":"https://api.github.com/users/koron/repos","events_url":"https://api.github.com/users/koron/events{/privacy}","received_events_url":"https://api.github.com/users/koron/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vim-jp/issues/labels/kind/bug","name":"kind/bug","color":"e10c02"},{"url":"https://api.github.com/repos/vim-jp/issues/labels/kind/performance","name":"kind/performance","color":"e10c02"},{"url":"https://api.github.com/repos/vim-jp/issues/labels/related/kaoriya","name":"related/kaoriya","color":"02e10c"},{"url":"https://api.github.com/repos/vim-jp/issues/labels/related/windows","name":"related/windows","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-03-03T05:47:08Z","updated_at":"2015-03-03T14:52:50Z","closed_at":null,"body":"gvim +kaoriya 7.4.648 (+ruby/dyn だけど Ruby 自体のpathが通ってないので、利用不可)\r\n\r\n`showmatch` を設定 & `syntax on` にした状態で、以下の内容の ruby ファイル を開きカーソルを動かすと、カーソルがカッコの上に重なる時=showmatchが稼働する時に、明らかに遅くなる。\r\n\r\n```ruby\r\ndef foo\r\n  return call_very_long_long_long_long_long_long_long_long_long_long_long_long_func({\r\n                                                                                      aaa: 111,\r\n                                                                                      bbb: 222,\r\n                                                                                      ccc: 333,\r\n                                                                                      ddd: 444,\r\n                                                                                      eee: 555,\r\n                                                                                      fff: 666,\r\n  })\r\nend\r\n```\r\n\r\nポイントはインデントが深い、もしくは1行が長いことだと推測される。その根拠として、以下の、内容は一緒だがインデントが浅い、ファイルに対して同様の操作を行なっても、この問題は発生しない。\r\n\r\n```ruby\r\ndef foo\r\n  return call_very_long_long_long_long_long_long_long_long_long_long_long_long_func({\r\n    aaa: 111,\r\n    bbb: 222,\r\n    ccc: 333,\r\n    ddd: 444,\r\n    eee: 555,\r\n    fff: 666,\r\n  })\r\nend\r\n```\r\n\r\n付け加えて、以下のようにJavaScriptでインデントの深いファイルに対しては問題が発生しないことから、ruby(ftplugin or syntax?)特有の問題であると推測される。\r\n\r\n```javascript\r\nfunction foo() {\r\n  return call_very_long_long_long_long_long_long_long_long_long_long_long_long_func({\r\n                                                                                      aaa: 111,\r\n                                                                                      bbb: 222,\r\n                                                                                      ccc: 333,\r\n                                                                                      ddd: 444,\r\n                                                                                      eee: 555,\r\n                                                                                      fff: 666\r\n  });\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/vim-jp/issues/issues/comments/76959399","html_url":"https://github.com/vim-jp/issues/issues/708#issuecomment-76959399","issue_url":"https://api.github.com/repos/vim-jp/issues/issues/708","id":76959399,"user":{"login":"koron","id":468368,"avatar_url":"https://avatars.githubusercontent.com/u/468368?v=3","gravatar_id":"","url":"https://api.github.com/users/koron","html_url":"https://github.com/koron","followers_url":"https://api.github.com/users/koron/followers","following_url":"https://api.github.com/users/koron/following{/other_user}","gists_url":"https://api.github.com/users/koron/gists{/gist_id}","starred_url":"https://api.github.com/users/koron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koron/subscriptions","organizations_url":"https://api.github.com/users/koron/orgs","repos_url":"https://api.github.com/users/koron/repos","events_url":"https://api.github.com/users/koron/events{/privacy}","received_events_url":"https://api.github.com/users/koron/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T14:52:50Z","updated_at":"2015-03-03T14:52:50Z","body":"> カーソル移動のたびに <kbd>Ctrl</kbd> + <kbd>L</kbd> による再描画と同程度のsyntax処理が起動されうる\r\n\r\nこれ不可避だった。 plugin/matchparen.vim が `s:Highlight_Matching_Pair()` の最後にやってる `matchaddpos()` が再描画相当の処理を引き起こしている。なので syntax 側を十分高速であるようにメンテするか、plugin/matchparen を使わないようにするべき。\r\n\r\n個人的には plugin/matchparen を使わないだけで十分だが…"}}