jalcine / cmake.vim

:hammer: CMake functionality within Vim.
https://jalcine.github.io/cmake.vim
MIT License
74 stars 11 forks source link

opening arbitrary cpp file not related to cmake project #21

Closed sigidagi closed 10 years ago

sigidagi commented 10 years ago

"main.cpp" 25L, 512C Error detected while processing function cmake#augroup#on_buf_read..cmake#buffer#has_project..cmake#util#has_project..cmake#util#binary_dir: line 18: E121: Undefined variable: b:cmake_root_binary_dir E116: Invalid arguments for function fnamemodify(b:cmake_root_binary_dir,':p') E15: Invalid expression: fnamemodify(b:cmake_root_binary_dir,':p')

jalcine commented 10 years ago

Thanks for reporting this bug! I'm still working on the test suite; but I might need a few days to knock this particular issue down and resolve it.

jalcine commented 10 years ago

Alright; took me a while, but going to try to replicate this bug.

jalcine commented 10 years ago

Hey @sigidagi, you know what commit this happened at? I'm looking at 69fe70c50f89daa and the checking block in util.vim and don't see how this could occur.

I'd give this two more days before resolving as fixed but unconfirmed.

sigidagi commented 10 years ago

I was using revision f7bca911fd3b0ffa139a6145c6602279fdef52ab https://github.com/jalcine/cmake.vim/blob/f7bca911fd3b0ffa139a6145c6602279fdef52ab/autoload/cmake/util.vim

It seems that changing to global scope of "cmake_root_binary_dir" variable helped to fix this bug.

jalcine commented 10 years ago

Gotcha; it makes more sense anyway. Thanks for helping out!