Skip to content

Commit 452bdaa

Browse files
committed
nvim/plugin: support once to AutocmdOptions
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 36b5064 commit 452bdaa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

nvim/plugin/plugin.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,11 @@ type AutocmdOptions struct {
291291
// :help autocmd-nested
292292
Nested bool
293293

294+
// Once supplys the command is executed once, then removed ("one shot").
295+
//
296+
// :help autocmd-once
297+
Once bool
298+
294299
// Eval is evaluated in Nvim and the result is passed the the handler
295300
// function.
296301
Eval string
@@ -314,6 +319,9 @@ func (p *Plugin) HandleAutocmd(options *AutocmdOptions, fn interface{}) {
314319
if options.Nested {
315320
m["nested"] = "1"
316321
}
322+
if options.Once {
323+
m["once"] = "1"
324+
}
317325
if options.Eval != "" {
318326
m["eval"] = eval(options.Eval, fn)
319327
}

0 commit comments

Comments
 (0)