Commit 6a18bb3
committed
fix(lint): give the plugin-loading buffer its initial lint
The lint autocmd lints on every event except FileType, which is resolve-only:
lazy.nvim replays the plugin-loading buffer's BufReadPost before ftdetect, so
that replayed lint sees ft="" and no-ops, and FileType only resolves the real
ft. That one buffer got its linters resolved but never linted until the next
InsertLeave/save.
Register a buffer-scoped, one-shot FileType autocmd for the load buffer only
when its ft is still "" at config time. For a BufReadPost load the timeline is
replay-noop + resolve-only FileType + this one-shot = exactly one lint. For a
BufWritePost load (ft already set) the replayed trigger event lints via the
main handler, so the guard skips registration to avoid a double lint. Placed in
the NvimLint group so a config re-source's clear=true wipes a stale one-shot
instead of stacking a second copy.1 parent 9ba25cb commit 6a18bb3
1 file changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
425 | 450 | | |
0 commit comments