Open BrunoKrugel opened 1 month ago
Have you searched your title from the repo issue?
Have you searched your title from the repo issue?
Sorry if missed some information, but yes.
BufRead
, BufReadPre
, BufReadPost
, VeryLazy
but the issue still persists.output from UFO_LOG=debug:
[24-07-18 11:13:14] [INFO] manager.lua:202 : apply fold rowPairs: {}
[24-07-18 11:13:38] [DEBUG] init.lua:125 : attach bufnr: 634
[24-07-18 11:13:39] [DEBUG] init.lua:125 : attach bufnr: 634
[24-07-18 11:13:39] [INFO] init.lua:86 : providers: { <function 1> }
[24-07-18 11:13:39] [DEBUG] init.lua:53 : requestFoldingRange({ <function 1> }, 634) has elapsed: 0ms
[24-07-18 11:13:39] [INFO] init.lua:93 : selected provider: external
[24-07-18 11:15:05] [DEBUG] init.lua:125 : attach bufnr: 1
[24-07-18 11:15:06] [INFO] init.lua:86 : providers: { <function 1> }
[24-07-18 11:15:07] [DEBUG] init.lua:37 : using nvim as a lsp provider
[24-07-18 11:15:08] [DEBUG] init.lua:53 : requestFoldingRange({ <function 1> }, 1) has elapsed: 2020ms
[24-07-18 11:15:08] [INFO] init.lua:93 : selected provider: external
[24-07-18 11:15:08] [INFO] manager.lua:201 : apply fold ranges: { {
endLine = 14,
startLine = 5
}, {
endLine = 13,
startLine = 6
}, {
endLine = 12,
startLine = 7
}, {
endLine = 31,
startLine = 17
}, {
endLine = 29,
startLine = 19
}, {
endLine = 28,
startLine = 21
}, {
endLine = 27,
startLine = 22
}, {
endLine = 26,
startLine = 23
}, {
endLine = 35,
startLine = 34
} }
[24-07-18 11:15:08] [INFO] manager.lua:202 : apply fold rowPairs: {}
[24-07-18 11:15:14] [DEBUG] init.lua:125 : attach bufnr: 2
[24-07-18 11:15:15] [INFO] init.lua:86 : providers: { "indent" }
[24-07-18 11:15:15] [DEBUG] init.lua:53 : requestFoldingRange({ "indent" }, 2) has elapsed: 3ms
[24-07-18 11:15:15] [INFO] init.lua:93 : selected provider: indent
Have you searched your title from the repo issue?
Sorry if missed some information, but yes.
- index out of bounds #212 uses Index out of bounds #47 as a fix.
- Index out of bounds #47 uses different events as a fix, but I already tried:
BufRead
,BufReadPre
,BufReadPost
,VeryLazy
but the issue still persists.- Index out of bounds when closing some folds #174 has the same fix from Index out of bounds #47
output from UFO_LOG=debug:
[24-07-18 11:13:14] [INFO] manager.lua:202 : apply fold rowPairs: {} [24-07-18 11:13:38] [DEBUG] init.lua:125 : attach bufnr: 634 [24-07-18 11:13:39] [DEBUG] init.lua:125 : attach bufnr: 634 [24-07-18 11:13:39] [INFO] init.lua:86 : providers: { <function 1> } [24-07-18 11:13:39] [DEBUG] init.lua:53 : requestFoldingRange({ <function 1> }, 634) has elapsed: 0ms [24-07-18 11:13:39] [INFO] init.lua:93 : selected provider: external [24-07-18 11:15:05] [DEBUG] init.lua:125 : attach bufnr: 1 [24-07-18 11:15:06] [INFO] init.lua:86 : providers: { <function 1> } [24-07-18 11:15:07] [DEBUG] init.lua:37 : using nvim as a lsp provider [24-07-18 11:15:08] [DEBUG] init.lua:53 : requestFoldingRange({ <function 1> }, 1) has elapsed: 2020ms [24-07-18 11:15:08] [INFO] init.lua:93 : selected provider: external [24-07-18 11:15:08] [INFO] manager.lua:201 : apply fold ranges: { { endLine = 14, startLine = 5 }, { endLine = 13, startLine = 6 }, { endLine = 12, startLine = 7 }, { endLine = 31, startLine = 17 }, { endLine = 29, startLine = 19 }, { endLine = 28, startLine = 21 }, { endLine = 27, startLine = 22 }, { endLine = 26, startLine = 23 }, { endLine = 35, startLine = 34 } } [24-07-18 11:15:08] [INFO] manager.lua:202 : apply fold rowPairs: {} [24-07-18 11:15:14] [DEBUG] init.lua:125 : attach bufnr: 2 [24-07-18 11:15:15] [INFO] init.lua:86 : providers: { "indent" } [24-07-18 11:15:15] [DEBUG] init.lua:53 : requestFoldingRange({ "indent" }, 2) has elapsed: 3ms [24-07-18 11:15:15] [INFO] init.lua:93 : selected provider: indent
Which buffer is index out of bounds from your log? If you load ufo without lazy event, is there an issue?
It seems that the issue doesn't happen if I use lazy=false
, however, this issue started to happen in the last month because I have been using BufRead
for almost a year without issues.
Which buffer is index out of bounds from your log? What's the content? Actually, I have no idea to fix.
In this example my buffer is the bufnr 2.
https://github.com/user-attachments/assets/b14ea5c7-4fc4-4d88-bc4f-23896162cf0c
Log:
[24-07-18 12:15:09] [DEBUG] init.lua:125 : attach bufnr: 2
[24-07-18 12:15:09] [INFO] init.lua:86 : providers: { <function 1> }
[24-07-18 12:15:11] [DEBUG] init.lua:37 : using nvim as a lsp provider
[24-07-18 12:15:11] [DEBUG] init.lua:53 : requestFoldingRange({ <function 1> }, 2) has elapsed: 1995ms
[24-07-18 12:15:11] [INFO] init.lua:93 : selected provider: external
[24-07-18 12:15:11] [INFO] manager.lua:201 : apply fold ranges: { {
endLine = 14,
startLine = 5
}, {
endLine = 13,
startLine = 6
}, {
endLine = 12,
startLine = 7
}, {
endLine = 31,
startLine = 17
}, {
endLine = 29,
startLine = 19
}, {
endLine = 28,
startLine = 21
}, {
endLine = 27,
startLine = 22
}, {
endLine = 26,
startLine = 23
}, {
endLine = 35,
startLine = 34
} }
[24-07-18 12:15:11] [INFO] manager.lua:202 : apply fold rowPairs: {}
[24-07-18 12:15:13] [DEBUG] init.lua:125 : attach bufnr: 3
[24-07-18 12:15:13] [INFO] init.lua:86 : providers: { "indent" }
[24-07-18 12:15:13] [DEBUG] init.lua:53 : requestFoldingRange({ "indent" }, 3) has elapsed: 0ms
[24-07-18 12:15:13] [INFO] init.lua:93 : selected provider: indent
[24-07-18 12:15:25] [DEBUG] init.lua:125 : attach bufnr: 245
[24-07-18 12:15:25] [INFO] init.lua:86 : providers: { "indent" }
[24-07-18 12:15:25] [DEBUG] init.lua:53 : requestFoldingRange({ "indent" }, 245) has elapsed: 0ms
[24-07-18 12:15:25] [INFO] init.lua:93 : selected provider: indent
Leave this issue here, no ability to solve it.
Neovim version (nvim -v | head -n1)
NVIM v0.10.0
Operating system/version
macOS M1
How to reproduce the issue
cat mini.lua
nvim --clean +'so mini.lua'
Expected behavior
The code above should open a Go file with the imports folded.
When UFO works:![image](https://github.com/user-attachments/assets/3f4f39c9-6b8c-47a5-9cee-63839e2a81d0)
Actual behavior
The code works most of the time, but sometimes when I open a file the folded code has a
0
instead of the default text and I get a lot of index out of bounds error.Folded code:
Error