Closed stefandtw closed 10 years ago
Thank you for the report.
vim-vspec runs a test script with a Vim process in Ex mode (-e
) for automation. And :read
behaves differently in Ex mode. This is an intentional behavior. From :help new-posix
:
- In Ex mode with an empty buffer ":read file" doesn't keep an empty line above or below the new lines.
So, if you want to emulate the normal :read
in an empty buffer, you have to mark the current buffer is not empty -- for example:
describe 'the read command'
it 'inserts text after the current line'
Expect getline(1) ==# ''
call setline(1, '')
read ~/.vimrc
Expect getline(1) ==# ''
end
end
That behaviour is fine. I just couldn't figure out why it worked that way. Thanks for the explanation!
Try this test. It wil fail:
Vim normally leaves an empty line if you read a file. For some reason vim-vspec does not seem to do this.