Skip to content

Timer instead of 500m sleep #2805

@chakravala

Description

@chakravala

At the end of #2802 (comment) you mentioned I should open a new issue for the following:

One issue I had in the past is that I needed a custom autoload/vimtex/view/my_zathura.vim file containing

  if g:vimtex_view_automatic
    "
    " Search for existing window created by latexmk
    "   It may be necessary to wait some time before it is opened and
    "   recognized. Sometimes it is very quick, other times it may take
    "   a second. This way, we don't block longer than necessary.
    "
    if !has_key(self, 'started_through_callback') && g:vimtex_view_xwin_exists
      for l:dummy in range(30)
        sleep 50m
        if self.xwin_exists() | break | endif
      endfor
    endif

Specifically, I changed 500m to 50m, as half a second was too long. Now this same sleep timer is found here:

Currently, without changing the 500m it seems to be fine, but for some reasons in the past I had to change it. If I look at some of my previous issues on here, this comment may have been the original cause #1063 (comment) ... however, I don't remember at this point why exactly I changed it from 500 to 50, it may be that the changes to VimTex since then have made this unnecessary, as I did not notice any significant problems right now.

This is not necessarily an issue anymore, but I am sharing this based on the history that I previously had the issue which required customizing the sleep timer; I am not completely sure if it still matters or not.

Lervag has suggested using timer_start instead of sleep, so perhaps there is yet something to be improved.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions