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

feat(bigfile): take into account lines length #576

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chrisands
Copy link

@chrisands chrisands commented Jan 17, 2025

Added check for long lines
#372

@chrisands chrisands changed the title Add columns limit file Add columns limit to bigfile #372 Jan 17, 2025
@chrisands chrisands changed the title Add columns limit to bigfile #372 Add columns limit to bigfile Jan 17, 2025
@chrisands chrisands changed the title Add columns limit to bigfile Add columns limit to bigfile #372 Jan 17, 2025
@chrisands chrisands changed the title Add columns limit to bigfile #372 feat(bigfile): take into account lines length Jan 17, 2025
@folke
Copy link
Owner

folke commented Jan 17, 2025

Sorry, but this is a big no for performance.
I'm willing to accept a PR that checks the length of the first buffer line vim.api.nvim_bug_get_lines,
but not like how you did it.

That filetype check will run very frequently, so loading files inside of it is not something I want to see here

@folke
Copy link
Owner

folke commented Jan 17, 2025

And please change it to line_length

@chrisands
Copy link
Author

From issue

It may be slow to find and count the max line length, in which case we could also allow configuring the maximum number of lines to search from the top. Note that we can't always assume the first line will be long (e.g. it could be a short license comment with the long minified lines further down).

@folke is it okay to make configurable how many lines it can scan?
I would like to make minimum two lines since first line can be short license line and second be the long one.

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

Successfully merging this pull request may close these issues.

2 participants