@@ -517,13 +517,13 @@ func (b *Batch) Request(procedure string, result interface{}, args ...interface{
517
517
518
518
// Call calls a VimL function with the given arguments.
519
519
//
520
- // On execution error: fails with VimL error, does not update v:errmsg.
520
+ // Fails with VimL error, does not update " v:errmsg" .
521
521
//
522
- // The fn arg is Function to call.
522
+ // fn is Function to call.
523
523
//
524
- // The args arg is Function arguments packed in an Array.
524
+ // args is Function arguments packed in an Array.
525
525
//
526
- // The result is result of the function call.
526
+ // result is the result of the function call.
527
527
func (v * Nvim ) Call (fname string , result interface {}, args ... interface {}) error {
528
528
if args == nil {
529
529
args = []interface {}{}
@@ -533,45 +533,49 @@ func (v *Nvim) Call(fname string, result interface{}, args ...interface{}) error
533
533
534
534
// Call calls a VimL function with the given arguments.
535
535
//
536
- // On execution error: fails with VimL error, does not update v:errmsg.
536
+ // Fails with VimL error, does not update " v:errmsg" .
537
537
//
538
- // The fn arg is Function to call.
538
+ // fn is Function to call.
539
539
//
540
- // The args arg is Function arguments packed in an Array .
540
+ // args is function arguments packed in an array .
541
541
//
542
- // The result is result of the function call.
542
+ // result is the result of the function call.
543
543
func (b * Batch ) Call (fname string , result interface {}, args ... interface {}) {
544
544
if args == nil {
545
545
args = []interface {}{}
546
546
}
547
547
b .call ("nvim_call_function" , result , fname , args )
548
548
}
549
549
550
- // CallDict calls a VimL Dictionary function with the given arguments.
550
+ // CallDict calls a VimL dictionary function with the given arguments.
551
551
//
552
- // The dict arg is Dictionary, or String evaluating to a VimL "self" dict .
552
+ // Fails with VimL error, does not update "v:errmsg" .
553
553
//
554
- // The fn arg is name of the function defined on the VimL dict.
554
+ // dict is dictionary, or string evaluating to a VimL "self" dict.
555
555
//
556
- // The args arg is Function arguments packed in an Array .
556
+ // fn is name of the function defined on the VimL dict .
557
557
//
558
- // The result is result of the function call.
558
+ // args is function arguments packed in an array.
559
+ //
560
+ // result is the result of the function call.
559
561
func (v * Nvim ) CallDict (dict []interface {}, fname string , result interface {}, args ... interface {}) error {
560
562
if args == nil {
561
563
args = []interface {}{}
562
564
}
563
565
return v .call ("nvim_call_dict_function" , result , fname , dict , args )
564
566
}
565
567
566
- // CallDict calls a VimL Dictionary function with the given arguments.
568
+ // CallDict calls a VimL dictionary function with the given arguments.
569
+ //
570
+ // Fails with VimL error, does not update "v:errmsg".
567
571
//
568
- // The dict arg is Dictionary , or String evaluating to a VimL "self" dict.
572
+ // dict is dictionary , or string evaluating to a VimL "self" dict.
569
573
//
570
- // The fn arg is name of the function defined on the VimL dict.
574
+ // fn is name of the function defined on the VimL dict.
571
575
//
572
- // The args arg is Function arguments packed in an Array.
576
+ // args is Function arguments packed in an Array.
573
577
//
574
- // The result is result of the function call.
578
+ // result is the result of the function call.
575
579
func (b * Batch ) CallDict (dict []interface {}, fname string , result interface {}, args ... interface {}) {
576
580
if args == nil {
577
581
args = []interface {}{}
@@ -581,11 +585,16 @@ func (b *Batch) CallDict(dict []interface{}, fname string, result interface{}, a
581
585
582
586
// ExecLua execute Lua code.
583
587
//
584
- // The code arg is Lua code to execute.
588
+ // Parameters are available as `...` inside the chunk. The chunk can return a value.
589
+ //
590
+ // Only statements are executed. To evaluate an expression, prefix it
591
+ // with `return` is "return my_function(...)".
585
592
//
586
- // The args arg is arguments to the code .
593
+ // code is Lua code to execute .
587
594
//
588
- // Parameters (if any) are available as "..." inside the chunk. The chunk can return a value.
595
+ // args is arguments to the code.
596
+ //
597
+ // The returned result value of Lua code if present or nil.
589
598
func (v * Nvim ) ExecLua (code string , result interface {}, args ... interface {}) error {
590
599
if args == nil {
591
600
args = []interface {}{}
@@ -595,11 +604,16 @@ func (v *Nvim) ExecLua(code string, result interface{}, args ...interface{}) err
595
604
596
605
// ExecLua execute Lua code.
597
606
//
598
- // The code arg is Lua code to execute.
607
+ // Parameters are available as `...` inside the chunk. The chunk can return a value.
608
+ //
609
+ // Only statements are executed. To evaluate an expression, prefix it
610
+ // with `return` is "return my_function(...)".
611
+ //
612
+ // code is Lua code to execute.
599
613
//
600
- // The args arg is arguments to the code.
614
+ // args is arguments to the code.
601
615
//
602
- // Parameters (if any) are available as "..." inside the chunk. The chunk can return a value .
616
+ // The returned result value of Lua code if present or nil .
603
617
func (b * Batch ) ExecLua (code string , result interface {}, args ... interface {}) {
604
618
if args == nil {
605
619
args = []interface {}{}
@@ -612,11 +626,11 @@ func (b *Batch) ExecLua(code string, result interface{}, args ...interface{}) {
612
626
// Relays the call to vim.notify. By default forwards your message in the
613
627
// echo area but can be overriden to trigger desktop notifications.
614
628
//
615
- // The msg arg is message to display to the user.
629
+ // msg is message to display to the user.
616
630
//
617
- // The logLevel arg is the LogLevel.
631
+ // logLevel is the LogLevel.
618
632
//
619
- // The opts arg is reserved for future use.
633
+ // opts is reserved for future use.
620
634
func (v * Nvim ) Notify (msg string , logLevel LogLevel , opts map [string ]interface {}) error {
621
635
if logLevel == LogErrorLevel {
622
636
return v .WritelnErr (msg )
@@ -635,11 +649,11 @@ func (v *Nvim) Notify(msg string, logLevel LogLevel, opts map[string]interface{}
635
649
// Relays the call to vim.notify. By default forwards your message in the
636
650
// echo area but can be overriden to trigger desktop notifications.
637
651
//
638
- // The msg arg is message to display to the user.
652
+ // msg is message to display to the user.
639
653
//
640
- // The logLevel arg is the LogLevel.
654
+ // logLevel is the LogLevel.
641
655
//
642
- // The opts arg is reserved for future use.
656
+ // opts is reserved for future use.
643
657
func (b * Batch ) Notify (msg string , logLevel LogLevel , opts map [string ]interface {}) {
644
658
if logLevel == LogErrorLevel {
645
659
b .WritelnErr (msg )
0 commit comments