Hi,

I would like my tags files to be useful even after some editing.

Regenerating tags often (e.g. before each jump) is not an option
because tag generation can take long and moreover the file must be
able to compile to get correct tags for Haskell.

The tag address in the tags file is an ex expression. When the tag
address is generated for Haskell by GHCi the expression can be either
a line number or a regex which searches the whole line exactly.
Exuberant ctags generates regexes searching the whole lines too ... or
sometimes (for defines?) the line numbers are used.

I see two options how tags files can be made more long-lived:

1) if the tag address is a line number then it should be maintained
while file is edited the same way as the positions of marks are
maintained (e.g. adding a line will increment subsequent tag positions
by one etc)

2) if the tag address is a regex searching the whole line then vim
should find the line which has smallest edit distance from the one
requested

And finally the questions:

A) Are there any options which would allow me to switch on 1 or 2?

B) Are there any events which I could hook and which would allow me to
modify the way a tag is searched? I'm imagining an event which is
called after the buffer is switched to the one which should contain
the tag and which calls my function with the tag name, the tag
address, and the field name/value pairs so that the function does the
final positioning withing the file. This way I could write a vim
function which locates the line with the smallest edit distance from
the one requested.

C) Would it be easy to implement option 2 (or possibly also option 1)
in vim source code? Does such a change have a chance to be accepted
upstream?

Thanks,
  Peter.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to