cdelledonne / vim-cmake

Vim/Neovim plugin for working with CMake projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change directory

ahmedaljaali opened this issue · comments

Request description

When I change my directory, vim-cmake can locate where is the new CMakeLists file is

For example, when I build this project:
2022-08-28_21:41:19

And then try to build another project:
2022-08-28_21:45:44
It tries to build the old project

Alternatives solutions

Command that we can use to clear build history

Hi, thanks for opening this, and sorry for replying with such a delay.

Vim-CMake was designed in such a way that it only detects project locations when it's first invoked, and as you noticed if you switch to a different project without closing and re-opening the editor it will build the first project it bound to. I don't think it would be very difficult to implement a mechanism to refresh Vim-CMake when changing the current directory, I'll look into this asap and get back to you.

I just updated the behavior of Vim-CMake to reinitialize itself upon a change of the current directory (this behavior can be disabled by setting g:cmake_reinit_on_dir_changed to 0). Let me know if that is what you were expecting.

Perfect 👌