Skip to content

Inverse search doesn't work until reload plugin with \lx #3119

@user202729

Description

@user202729

Currently, the inverse search logic in autoload/vimtex/view.vim has

  " Only activate in relevant VimTeX projects
  let l:file = resolve(a:filename)
  let l:sources = b:vimtex.get_sources()
  if vimtex#paths#is_abs(l:file)
    call map(l:sources, {_, x -> vimtex#paths#join(b:vimtex.root, x)})
  endif
  if index(l:sources, l:file) < 0 | return -2 | endif

which does nothing if the file is not in the source list.

However, the problem is I'm using inkscape-figures https://github.com/gillescastel/inkscape-figures , so the source list regularly changes (every time I add a figure, another .pdf_tex file is added to the source list), but this change is not picked up until late (e.g. \lx pressed).

Do you see a good solution for this issue?

What I can think of:

  • re-parse the source file on inverse_search (is this too slow?)
  • make a configuration option to set a whitelist e.g. "if the relative path starts with figures/ then always allow"
  • make a key binding to reparse source file for list of source files (clumsy but probably work? :VimtexReloadState sort of do this but it also stops the compiler…)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions