Skip to content

Commit a689da0

Browse files
committed
nvim: use emptyArgs variable
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent b3eb512 commit a689da0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

nvim/api_deprecated.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nvim/api_tool.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func NewEmbedded(options *EmbedOptions) (*Nvim, error) {
370370
// Deprecated: Use ExecLua instead.
371371
func (v *Nvim) ExecuteLua(code string, result interface{}, args ...interface{}) error {
372372
if args == nil {
373-
args = []interface{}{}
373+
args = emptyArgs
374374
}
375375
return v.call("nvim_execute_lua", result, code, args)
376376
}
@@ -380,7 +380,7 @@ func (v *Nvim) ExecuteLua(code string, result interface{}, args ...interface{})
380380
// Deprecated: Use ExecLua instead.
381381
func (b *Batch) ExecuteLua(code string, result interface{}, args ...interface{}) {
382382
if args == nil {
383-
args = []interface{}{}
383+
args = emptyArgs
384384
}
385385
b.call("nvim_execute_lua", result, code, args)
386386
}

nvim/nvim.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ func (b *Batch) Request(procedure string, result interface{}, args ...interface{
526526
// result is the result of the function call.
527527
func (v *Nvim) Call(fname string, result interface{}, args ...interface{}) error {
528528
if args == nil {
529-
args = []interface{}{}
529+
args = emptyArgs
530530
}
531531
return v.call("nvim_call_function", result, fname, args)
532532
}
@@ -542,7 +542,7 @@ func (v *Nvim) Call(fname string, result interface{}, args ...interface{}) error
542542
// result is the result of the function call.
543543
func (b *Batch) Call(fname string, result interface{}, args ...interface{}) {
544544
if args == nil {
545-
args = []interface{}{}
545+
args = emptyArgs
546546
}
547547
b.call("nvim_call_function", result, fname, args)
548548
}
@@ -560,7 +560,7 @@ func (b *Batch) Call(fname string, result interface{}, args ...interface{}) {
560560
// result is the result of the function call.
561561
func (v *Nvim) CallDict(dict []interface{}, fname string, result interface{}, args ...interface{}) error {
562562
if args == nil {
563-
args = []interface{}{}
563+
args = emptyArgs
564564
}
565565
return v.call("nvim_call_dict_function", result, fname, dict, args)
566566
}
@@ -578,7 +578,7 @@ func (v *Nvim) CallDict(dict []interface{}, fname string, result interface{}, ar
578578
// result is the result of the function call.
579579
func (b *Batch) CallDict(dict []interface{}, fname string, result interface{}, args ...interface{}) {
580580
if args == nil {
581-
args = []interface{}{}
581+
args = emptyArgs
582582
}
583583
b.call("nvim_call_dict_function", result, fname, dict, args)
584584
}
@@ -597,7 +597,7 @@ func (b *Batch) CallDict(dict []interface{}, fname string, result interface{}, a
597597
// The returned result value of Lua code if present or nil.
598598
func (v *Nvim) ExecLua(code string, result interface{}, args ...interface{}) error {
599599
if args == nil {
600-
args = []interface{}{}
600+
args = emptyArgs
601601
}
602602
return v.call("nvim_exec_lua", result, code, args)
603603
}
@@ -616,7 +616,7 @@ func (v *Nvim) ExecLua(code string, result interface{}, args ...interface{}) err
616616
// The returned result value of Lua code if present or nil.
617617
func (b *Batch) ExecLua(code string, result interface{}, args ...interface{}) {
618618
if args == nil {
619-
args = []interface{}{}
619+
args = emptyArgs
620620
}
621621
b.call("nvim_exec_lua", result, code, args)
622622
}

0 commit comments

Comments
 (0)