Smarter ii #6

Closed
nashbridges opened this Issue Apr 7, 2013 · 2 comments

Projects

None yet

2 participants

@nashbridges

Given code sample below:

>def hello
  output = "hello!"

  output.upcase
end

def bye
  "bye!"
end

when I run vii, I get

|def hello
| output = "hello!"

  output.upcase
end

def bye
  "bye!"
end

while vai gives me

|def hello
| output = "hello!"
|  
| output.upcase
|end
|
|def bye
| "bye!"
|end

I see current logic here, but with vii I'd rather have

|def hello
| output = "hello!"
|  
| output.upcase
|end

def bye
  "bye!"
end

i. e. do not give up on an empty line if the following line is more indented than current one.

However, this case is probably language specific and should be addressed in a separate plugin (I've found https://github.com/rhysd/vim-textobj-ruby, haven't tested it though)

@nashbridges nashbridges closed this Apr 7, 2013
Owner
kana commented Apr 7, 2013

As you noticed, what you want to do is specific to Ruby language. While vim-textobj-indent provides generic text objects like ap, ip, and others. In this case, use other, language-specific, text objects instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment