Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Repeated 'ie' positions cursor on 'end'.

The line:
  let start_pos[1] = start_pos[1] - 1
was a bit indecipherable. It changes the startpos to the line above the
current line. Instead, now using normal mode `k`.

For inner block select:
    If the cursor is currently on the word 'end', then the current word
should be allowed.
  • Loading branch information...
commit bc584f55763877204735637665a20ce561acc7ee 1 parent b887150
@nelstrom authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 plugin/textobj/rubyblock.vim
View
9 plugin/textobj/rubyblock.vim
@@ -28,10 +28,15 @@ function! s:select_a()
endfunction
function! s:select_i()
- call searchpair(s:start_pattern,'',s:end_pattern, 'W')
+ let s:flags = 'W'
+ if expand('<cword>') == 'end'
+ let s:flags = 'cW'
+ endif
+ call searchpair(s:start_pattern,'',s:end_pattern, s:flags)
+ normal k^
let end_pos = getpos('.')
- let end_pos[1] = end_pos[1] - 1
+ normal j^
normal %
let start_pos = getpos('.')
let start_pos[1] = start_pos[1] + 1
Please sign in to comment.
Something went wrong with that request. Please try again.