{"issue":{"created_at":"2011-12-05T18:11:35Z","state":"closed","updated_at":"2011-12-09T11:45:34Z","comments":1,"user":{"gravatar_id":"4942559088fccf554183697067e55f80","id":312943,"url":"https://api.github.com/users/atrerus","avatar_url":"https://secure.gravatar.com/avatar/4942559088fccf554183697067e55f80?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"atrerus"},"body":"I'm noticing the plugin has trouble selecting rspec blocks.  Take this for example:\r\n\r\n```\r\ndescribe 'Web Service'\r\n    it 'should respond to GET' do\r\n        GET '/'\r\n        last_response.should_be\r\n    end\r\nend\r\n```\r\n\r\nFor selecting the 'it' block, if I place my cursor at the end of the 'do' the selection works, but if I'm at the beginning of 'it' then it selects the surrounding describe block.\r\n\r\nAssuming you're using regex to parse the block delimeters, I'm thinking something like /.*do$/\r\n\r\nThis would also work for methods in ruby that expect a block, which is a pretty common idiom.","assignee":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"id":2452510,"number":10,"labels":[],"title":"Has trouble selecting rspec blocks","closed_at":"2011-12-09T11:45:34Z","html_url":"https://github.com/nelstrom/vim-textobj-rubyblock/issues/10","url":"https://api.github.com/repos/nelstrom/vim-textobj-rubyblock/issues/10","milestone":null},"action":"created","comment":{"created_at":"2011-12-09T11:45:34Z","updated_at":"2011-12-09T11:45:34Z","user":{"gravatar_id":"802afd5856ed0054d7d1851ea21cbabe","id":7069,"url":"https://api.github.com/users/nelstrom","avatar_url":"https://secure.gravatar.com/avatar/802afd5856ed0054d7d1851ea21cbabe?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"nelstrom"},"body":"It feels as though the `it 'should respond to GET'` line is part of the block, but it's not. The block only begins with the `do` keyword. If you consider the `do` keyword as opening parenthesis, and the `end` keyword as closing parenthesis, then the behaviour of `vir` is correct.\r\n\r\nSince the `do` keyword is the last word on the line, you can jump to it with `$`. So burn this into your finger-memory:\r\n\r\n    $vir\r\n\r\np.s. I think there's a missing `do` at the end of the first line of code in your example.\r\n","id":3078086,"url":"https://api.github.com/repos/nelstrom/vim-textobj-rubyblock/issues/comments/3078086"}}