Skip to content

feat: allow overriding the detection of big files#16

Merged
LostInTheLogs merged 2 commits intomainfrom
feat/override_detection
Jun 28, 2023
Merged

feat: allow overriding the detection of big files#16
LostInTheLogs merged 2 commits intomainfrom
feat/override_detection

Conversation

@LostInTheLogs
Copy link
Copy Markdown
Member

fixes #11

adds override_detection to the config

override_detection nil|fun(bufnr: number, filesize_mib: number): boolean|nil callback to override detection of big files

@LostInTheLogs LostInTheLogs requested a review from kylo252 June 15, 2023 07:30
Copy link
Copy Markdown
Collaborator

@kylo252 kylo252 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you give an example use case? I just want to make sure we're not creating duplicate functionality

@LostInTheLogs
Copy link
Copy Markdown
Member Author

can you give an example use case? I just want to make sure we're not creating duplicate functionality

Different file size per filetype, using line count for some file types,

@kylo252
Copy link
Copy Markdown
Collaborator

kylo252 commented Jun 15, 2023

Different file size per filetype, using line count for some file types,

I think there's some overlap with pattern, we need to make it clearer how they interact or maybe allow patttern to also be a function instead.

Copy link
Copy Markdown
Collaborator

@kylo252 kylo252 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about this:

  • if pattern is a function then the autocmd will apply to * instead, but the buffer will only be considered big if pattern returns true (maybe size should still be a fallback)

@LostInTheLogs LostInTheLogs requested a review from kylo252 June 27, 2023 06:10
Copy link
Copy Markdown
Collaborator

@kylo252 kylo252 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@LostInTheLogs LostInTheLogs merged commit 9616b73 into main Jun 28, 2023
@LostInTheLogs LostInTheLogs deleted the feat/override_detection branch June 28, 2023 09:57
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.

Disable based on number of lines

2 participants