4coder»Forums»goto_next_jump_sticky relative path in build error
2 posts
goto_next_jump_sticky relative path in build error
1 year, 6 months ago Edited by AmosBuchanan on Feb. 14, 2019, 6:48 a.m. Reason: Initial post
Is there a good way of jumping to build errors with relative paths? I've seen a couple of references to this but not any solutions. So far the only ideas I've come up with are to copy and hack at the 4coder base jump functions; I'd rather not have to do that if I can help it.
Allen Webster
483 posts / 2 projects


goto_next_jump_sticky relative path in build error
1 year, 6 months ago
There's no built in way to do this right now, and it's not even very obvious to me how to make it work even as the author of all that code. I mean you could certainly do a better job approximating than I do right now by just trying to make base names work as much as possible, but I prefer to make everything accurate and reliable by just always having full paths in my errors as much as possible because I never found any other good ways to deal with this.
2 posts
goto_next_jump_sticky relative path in build error
1 year, 6 months ago
Unfortunately gcc doesn't show full path names, at least as far as I can tell. Also, because of my general workflow it's not particularly desirable for me to use full paths since I'm not building on the same machine I'm using for development.

I haven't made this work yet, and I've gone down a couple of rabbit-holes as I comb through the code and figure out how it works. My most recent idea is to use the same process for finding the directory of the build script and tack that onto the beginning of the relative error paths. It seems like there are some functions for that already so I've been trying to leverage them as much as possible.

Thanks for your response. I'm really enjoying the program. I've been wanting to do an emacs-like modal setup for a while and it was really easy to do with 4coder. This is really the only thing that's preventing me from switching over completely. I'll probably continue hacking away in my free time, which is unfortunately limited these days.
simon sutherington
4 posts
goto_next_jump_sticky relative path in build error
1 year, 6 months ago
I have the same issue, I use multiple different compilers and machines every day that all have their own unique ways of giving out the warnings and errors.

What I did, was modify the 4Coder 'jump' code. At the point where it gets the next line in the jump list, check the start of the path, if it starts with ./ prepend the known root to the file.
Likewise if it starts with ../ prepend the root, but drop the last directory.

You need to know what the root directory is, but you could use the projects root and just run your compiler from there.

I believe GCC will return the same path to a file that you supply it with, which may help,or you could go crazy and add something into the project file itself to specify the compilation root directory.

The string functions in 4coder have a lot of the work done for you, there are helpers to modify a path.

Not the best or most correct solution by far, but it works for 99% of the time for me at least.

Now that I’m writing this down, it sounds truly awful, but trust me it works for me day after day