dschwen / switch-header-source

Quick switching between C/C++ header and source files
MIT License
13 stars 49 forks source link

switching between different directories #9

Closed acampove closed 8 years ago

acampove commented 8 years ago

Hi,

I have my definitions (.cxx) in a ./src directory and my headers in an ./include directory, but I seem to be unable to switch from header to source using that package, is that possible? It seems to work only if they both are in the same directory.

Thanks.

dschwen commented 8 years ago

What is your header file extension? It should work by design, this is the main use for this plugin. I tested it with a ./src/test.cxx and a ./include/test.h file and it switched fine.

acampove commented 8 years ago

I have a directory structure as follows:

Test_Pkg include text.h src test.cxx

And it works like that. But if I rename as:

include -> Test_Pkg and src->Root

then it stops working. It seems that the problem is the change in the names of the include and source directories. In general for us (CERN) the include directory is called as the package, and the source directory is called Root.

acampove commented 8 years ago

I see you hardcoded the src and include names in https://github.com/dschwen/switch-header-source/blob/master/lib/switch-header-source.coffee. Is there a fast way of changing the "include" name to the name of the directory that contains "include"? I think I can change src myself to "Root".

dschwen commented 8 years ago

Oh, I see! Well, you could add symbolic links to have the directories appear as src and include. I could also make this configurable. I can work on that next week at the earliest though.

On Sat, Aug 29, 2015, 23:31 acampove notifications@github.com wrote:

I see you hardcoded the src and include names in https://github.com/dschwen/switch-header-source/blob/master/lib/switch-header-source.coffee. Is there a fast way of changing the "include" name to the name of the directory that contains "include"? I think I can change src myself to "Root".

— Reply to this email directly or view it on GitHub https://github.com/dschwen/switch-header-source/issues/9#issuecomment-136087399 .

acampove commented 8 years ago

yes, i was thinking of symbolic links to.

Thanks.

acampove commented 8 years ago

Hi,

I think I got your package to do what I wanted, I just had to add a couple of things in the switch-header-source.coffee file.

If someone wants it it is liked below and has to replace the file in: $HOME/.atom/packages/switch-header-source/lib/

https://www.dropbox.com/s/ncfi8xw12y5607g/switch-header-source.coffee

dschwen commented 8 years ago

No drop box on my phone, but maybe you can do a pull request.