alt icon indicating copy to clipboard operation
alt copied to clipboard

C/C++ source/header files support

Open marcov opened this issue 6 years ago • 3 comments

Any plan to support alternate of C/C++ source code - header files? E.g.:

$ alt ./foo/bar/faz.c
./foo/bar/faz.h

$ alt ./fizz/bang.hpp
./fizz/bang.cpp

marcov avatar Oct 29 '19 11:10 marcov

+1, I gave alt a try hoping to get exactly this behavior.

Perhaps, even slightly generalized: I'd love to be able to cycle through same-basename files of whatever differing extensions, e.g.:

  • Cargo.tomlCargo.lockCargo.toml
  • FooDoc.mdFooDoc.htmlFooDoc.md
  • watched_template.j2watched_template.json

... etc, etc. This has gazillion handy uses.


On closer look, this isn't what's happening here: https://github.com/uptech/alt/blob/4575feb0727c52a0920aeb79056304a86304c53c/src/main.rs#L110-L117

Line 114 filters out candidates having similar is_test_file-ness; which is unfortunate.

Will you guys at @uptech be welcoming a patch which implements the above (without, of course, breaking the already working test/impl flow) ?

ulidtko avatar Dec 30 '19 16:12 ulidtko

Yes, we would welcome a patch.

@ulidtko The original intent was for it to be general like this. The filter on tests files etc was intended to just be a performance improvement significantly limiting the similarity comparisons that had to be done.

So if we can figure out a way to do this while still keeping the performance and still supporting the other use cases. Yeah I think we would want to support this use case.

drewdeponte avatar Jan 04 '22 23:01 drewdeponte

I just released a new major version of this, v4.0.0 which I believe should help this scenario.

drewdeponte avatar May 08 '23 04:05 drewdeponte