Why not either
let s:taglist = taglist()
to save the tags before switching windows or
wincmd p
" Do something with taglist()
wincmd p
so that you return to the right window before issuing the taglist() command.
Variants: s:taglist could be a Dictionary, keyed on the buffer name or number. If you save the buffer number, then you can switch to the right buffer even if there are more window-switching commands than you have told us about.
IWBNI taglist() accepted an optional buffer identifier.
HTH --Benji Fisher
On Tue, Jun 11, 2013 at 9:33 PM, Charles Campbell <Charles.E.Campbell@nasa.gov> wrote:
Hello!
I'm putting together a script that
* reads a log file which contains procedure names and line numbers
* uses taglist() to obtain a filename associated with a procedure name
The relevant script:
exe s:prcwin."wincmd w"
" an echomsg shows that taglist() can obtain a filename associated with a procedure name here
exe "sil! e! ".fnameescape(proc["filename"])
" an echomsg here shows that taglist() comes up empty
So, clearly the editing of a file causes a loss of the tags. (btw, I used the same filename in both echomsg s)
* how can I prevent that loss of tags from occurring?
* or how can I get vim to re-read that tags file?
Thanks!
Chip Campbell
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
--- You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment