Documentation for skipping indexing of bigger files misleading
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 72/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- lua
- Domain
- documentation
Research direction
Start with README.md lines 215-223 and compare the documented snippet with the proposed buffer-filtering example in the issue. Update the documentation so it clearly describes skipping oversized buffers without implying that other buffers are excluded; the README should reflect the intended behavior.
Written by the indexing model from the issue text.
Description
Hi!
This part of the readme suggest to use the snippet to skip indexing of big buffers. Unfortunately, this also means that only the current buffer is indexed (if small enough) and no other buffer at all. This was surprising to me (although completely my fault for not carefully reading through this snippet and only testing it in a limited context).
How about we change the snippet to something like this instead?
get_bufnrs = function()
local is_small_buf = function(index, buf)
local byte_size = vim.api.nvim_buf_get_offset(buf, vim.api.nvim_buf_line_count(buf))
return byte_size <= 1024*1024 -- 1 Megabyte max
end
local all_bufs = vim.api.nvim_list_bufs()
return vim.fn.filter(all_bufs, is_small_buf)
end
Thank you for this great plugin!
- Dominant language
- Lua
- Stars
- 672
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hrsh7th/cmp-buffer
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
hrsh7th/cmp-buffer#84 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 52/100
hrsh7th/cmp-buffer#82 · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
hrsh7th/cmp-buffer#81 ·
-
Completing Unicode (using \k regex) is broken because common prefix uses bytes instead of characters Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
hrsh7th/cmp-buffer#80 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
hrsh7th/cmp-buffer#78 ·
All issues in hrsh7th/cmp-buffer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
api7/lua-resty-saml#62 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nvim-tree/nvim-tree.lua#3357 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
codymikol/multiverse.nvim#320 ·
-
Data Correction tbc
Difficulty 2/5 1-3 hours Newbie friendliness 68/100