Commit 1ba6fb7
committed
feat: handle possible issue with initial load when lazy loading
## Details
Issue: #309
Depending on how the plugin manager implements lazy loading, this plugin can
miss the initial buffer that triggered it to load.
This is because we setup a `FileType` autocommand to check which buffers
we should attach to. If the user configures this plugin to load based on
a filetype that event will not be processed by the autocommand (since it
has not been created yet). Instead everything will be setup but the
current buffer will end up ignored.
I'm unsure why this is not an issue with `lazy.nvim`, maybe it executes
autocommands after the initial load. This would make sense, but I have
not verified it.
To get around this attempt to attach to the current buffer at the start,
similar to the command based lazy loading edge case.1 parent c85d682 commit 1ba6fb7
2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
0 commit comments