File tree 2 files changed +12
-4
lines changed 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,15 @@ local function watch_ft(fts)
8
8
group = group ,
9
9
pattern = fts ,
10
10
callback = function (args )
11
- format .attach_to_buf (args .buf )
11
+ if
12
+ # api .nvim_get_autocmds ({
13
+ group = group ,
14
+ event = ' BufWritePre' ,
15
+ buffer = args .buf ,
16
+ }) == 0
17
+ then
18
+ format .attach_to_buf (args .buf )
19
+ end
12
20
end ,
13
21
desc = ' guard' ,
14
22
})
Original file line number Diff line number Diff line change @@ -211,11 +211,11 @@ local function attach_to_buf(buf)
211
211
api .nvim_create_autocmd (' BufWritePre' , {
212
212
group = require (' guard.events' ).group ,
213
213
buffer = buf ,
214
- callback = function (opt )
215
- if not vim .bo [opt . buf ].modified then
214
+ callback = function ()
215
+ if not vim .bo [buf ].modified then
216
216
return
217
217
end
218
- require (' guard.format' ).do_fmt (opt . buf )
218
+ require (' guard.format' ).do_fmt (buf )
219
219
end ,
220
220
})
221
221
end
You can’t perform that action at this time.
0 commit comments