bogado / file-line

Plugin for vim to enabling opening a file in a given line
http://www.vim.org/scripts/script.php?script_id=2184
299 stars 61 forks source link

Revert hooking into VimEnter #37

Closed blueyed closed 9 years ago

blueyed commented 9 years ago

This mainly reverts the hooking into VimEnter (https://github.com/bogado/file-line/commit/f74d3f55), which appears to be meant as a workaround for #11.

The proper fix for #11 appears to be using bufhidden=wipe, instead of wiping the buffer during the BufNewFile event, which Vim does not appear to handle properly / as expected.

bogado commented 9 years ago

This still don't work correctly with the following case:

$ vim README.md:10 plugin/file_line.vim:10 -o

I end up with two views one showing "README.md" on the correct cursor position and another one with "README.md:10". Sounds like you're wiping out the wrong buffer.

bogado commented 9 years ago

$ vim README.md:10 plugin/file_line.vim:10 ~/.vimrc:19 -o

This will open README.md and two views of "README.md:10"

blueyed commented 9 years ago

Too bad. I've only tested it with -p.

I'll put together a small test case an submit it to the vim issue tracker.

But for the time being, I'd say that it's already better than before going the VimEnter route.

blueyed commented 9 years ago

Submitted at: https://code.google.com/p/vim/issues/detail?id=293

jby commented 9 years ago

Any status update on this?

blueyed commented 9 years ago

I've switched to https://github.com/kopischke/vim-fetch in the meantime, so won't maintain/update/fix this PR.

Therefore I am closing it for now, but feel free to adopt it in a new PR.