AndrewRadev / vimrunner

Control a vim instance through ruby code
MIT License
238 stars 13 forks source link

Doesn't select padding #43

Closed hgiesel closed 8 years ago

hgiesel commented 8 years ago

Given: I open Vimrunner and create a sample document:

require 'vimrunner'
vim = Vimrunner.start
vim.insert 'foo(   asdf   );'
vim.normal 'Fa'

When: I execute vim.normal 'yib'; vim.command 'echo getreg(\'"\')'; Then: I expect an output of ␣␣␣asdf␣␣␣. However: I get an output of asdf (without the padding).

Tested under: vimrunner (0.3.1)

AndrewRadev commented 8 years ago

I should have realized a long time ago that running strip on the output would be an issue for a situation like this :). I've applied a fix to master. Could you try it out and let me know if it works for you? I'll cut a new version afterwards.

hgiesel commented 8 years ago

Yes, it works now, thanks very much. Great project by the way!