Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer instead of 500m sleep #2805

Closed
chakravala opened this issue Oct 5, 2023 · 3 comments
Closed

Timer instead of 500m sleep #2805

chakravala opened this issue Oct 5, 2023 · 3 comments

Comments

@chakravala
Copy link

chakravala commented Oct 5, 2023

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.

lervag added a commit that referenced this issue Oct 9, 2023
@lervag
Copy link
Owner

lervag commented Oct 9, 2023

I believe this is fixed now. Please test.

@lervag lervag closed this as completed Oct 9, 2023
@chakravala
Copy link
Author

I believe it works, thank you for your continued efforts on general improvement

@lervag
Copy link
Owner

lervag commented Oct 10, 2023

Great, glad to hear it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants