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

fix bug of disable_preview #577

Merged
merged 4 commits into from
Feb 13, 2025
Merged

Conversation

forestchen1224
Copy link
Contributor

When open the preview,the preview is very lag,even though disable_preview is set.This is because the bug in the code that disable_preview is not used in the if statement.

    if
      entry_is_file
      and config.preview_win.preview_method ~= "load"
      and not util.file_matches_bufreadcmd(normalized_url)
      and not config.preview_win.disable_preview(normalized_url)
    then
      filebufnr =
        util.read_file_to_scratch_buffer(normalized_url, config.preview_win.preview_method)

file should not loaded if disable_preview is true
@github-actions github-actions bot requested a review from stevearc February 6, 2025 07:59
@github-actions github-actions bot requested a review from stevearc February 12, 2025 10:29
switch the condition checking `disable_preview` of `if`
move the longer condition to the `elseif`
swap their repective code blocks to maintain the same functionality
@stevearc
Copy link
Owner

Thanks for the PR!

@stevearc stevearc merged commit 7cde5aa into stevearc:master Feb 13, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants