CTags icon indicating copy to clipboard operation
CTags copied to clipboard

CTags plugin does not always jump to a const

Open anatol opened this issue 6 years ago • 2 comments

I use Sublime3 with CTags plugin.

Here is a part of Linux code, file arch/x86/include/asm/page_types.h:

#include <linux/mem_encrypt.h>

/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT		12
#define PAGE_SIZE		(_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK		(~(PAGE_SIZE-1))

Here is generated .tags file

PAGE_SHARED	arch/x86/include/asm/pgtable_types.h	/^#define PAGE_SHARED	/;"	d
PAGE_SHARED_EXEC	arch/x86/include/asm/pgtable_types.h	/^#define PAGE_SHARED_EXEC	/;"	d
PAGE_SHIFT	arch/x86/include/asm/page_types.h	/^#define PAGE_SHIFT	/;"	d
PAGE_SHIFT	include/asm-generic/page.h	/^#define PAGE_SHIFT	/;"	d
PAGE_SHIFT_4K	drivers/infiniband/hw/bnxt_re/qplib_fp.h	

When I want to jump to PAGE_SHIFT the plugin shows me 2 possible files as expected. I select arch/x86/include/asm/page_types.h it opens the file but for some reason cursor does not jump to the constant definition.

anatol avatar Dec 04 '19 02:12 anatol

Hi @anatol a similar problem got fixed for me by adding "--excmd=n" to opts in CTags settings. It seems that when using only the line number it works a lot better and also it is definetly faster. I hope it helps. :D

Rtyui avatar Apr 22 '20 05:04 Rtyui

Hi @Rtyui. Thank you very much for this advice.

{
	"opts": ["--excmd=n"]
}

makes a huge improvement.

anatol avatar Apr 22 '20 08:04 anatol