vis-ctags icon indicating copy to clipboard operation
vis-ctags copied to clipboard

Fix the inability to jump back after going to a symlinked file

Open raedwulf opened this issue 3 years ago • 3 comments

When jumping to a tag that is present in a symlinked file, the path being set in vis may not match the path stored in the tags file. This will result in being unable to jump back because of the condition. This commit uses the test command to resolve this; the flag '-ef' isn't standard but commonly implemented in BSDs and Linux. If you have OS X, Solaris, AIX... you may run into some difficulties where the fallback behaviour will be handy.

Signed-off-by: Tai Chi Minh Ralph Eastwood [email protected]

raedwulf avatar Oct 25 '21 20:10 raedwulf

How can this be reproduced? I just created a symlink and went there and back without a problem.

Also, can the same problem be reproduced in vim?

kupospelov avatar Oct 30 '21 19:10 kupospelov

I've been trying to reproduce it with a simpler condition but am unfortunately finding it difficult. I'm currently using exuberant ctags and generating for:

ctags -R * /usr/lib64/gcc/x86_64-unknown-linux-gnu/10.2.1/include /usr/local/include /usr/lib64/gcc/x86_64-unknown-linux-gnu/10.2.1/include-fixed /usr/include

where lib64 is are relative symlink to lib and 10.2.1 is relatively symlinked to 10.2.

I've not checked the code but it seems that vis resolves the path somewhere and it affects this case... but I'm not sure why.

vim has no issues with this symlinking.

raedwulf avatar Nov 02 '21 17:11 raedwulf

Got it, thanks.

I think this is a bug in vis. When I open the same file in a symlinked directory in vim, the path does not change.

Since this must be easy to work around (e.g. by specifying /usr/lib instead of /usr/lib64), I would suggest not fixing it here (at least for now) and opening an issue for vis first.

kupospelov avatar Nov 14 '21 14:11 kupospelov