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

Laggy in diff-mode with a thousand lines folded #85

Closed
tknightz opened this issue Dec 30, 2023 · 3 comments
Closed

Laggy in diff-mode with a thousand lines folded #85

tknightz opened this issue Dec 30, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@tknightz
Copy link

Describe the bug
In diff-mode, Vim/Neovim uses different fold method, it can lead to thousands of unchanged lines will be folded. Rendering chunks in folded lines costs a lot of CPU resources and laggy while scrolling.

To Reproduce
Steps to reproduce the behavior:

  1. You have a file > 3000 lines of code.
  2. Make some changes near the end of file.
  3. Open diffview
  4. See the CPU percentage goes up and laggy while scrolling.

Expected behavior
Shouldn't render chunk in folded lines, or is there any way to disable it in diff-mode.

Screenshots
image

Additional context
Here is my hlchunk config:

{
    "shellRaining/hlchunk.nvim",
    config = function()
      require("hlchunk").setup({
        chunk = {
          notify = false,
          style = {
            { fg = "#c75ae8" },
            { fg = "#f65866" }, -- this fg is used to highlight wrong chunk
          },
        },
        blank = {
          enable = true,
          chars = { " " },
        },
        line_num = { enable = false },
      })
    end,
    event = "BufReadPre"
}
@shellRaining
Copy link
Owner

sorry for late reply, I found that whenever edit a big file (10w+ lines), it could be very laggy, and It not caused by my plugin, so... maybe I can't provide a solution if there are more info

or, maybe there is another way to prevent this, when the chunk is too big (like more than 500 lines), not render it, is this OK?

@shellRaining shellRaining added the enhancement New feature or request label Jan 23, 2024
@tknightz
Copy link
Author

Yes! Is there any way to turn it off when editing a big file?

PostCyberPunk added a commit to PostCyberPunk/hlchunk.nvim that referenced this issue Jan 31, 2024
add new options choke_at_linecount
check_choke
@PostCyberPunk
Copy link
Contributor

Yes! Is there any way to turn it off when editing a big file?

you can try #86 if you want to test,there is a new option choke_at_linecount,hint:you have to set for every mod

PostCyberPunk added a commit to PostCyberPunk/hlchunk.nvim that referenced this issue Jan 31, 2024
add new options choke_at_linecount
check_choke
PostCyberPunk added a commit to PostCyberPunk/hlchunk.nvim that referenced this issue Jan 31, 2024
add new options choke_at_linecount
check_choke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants