Skip to content

Commit b3eb512

Browse files
committed
nvim: fix documentations
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent efba91c commit b3eb512

File tree

2 files changed

+48
-34
lines changed

2 files changed

+48
-34
lines changed

nvim/api_deprecated.go

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

nvim/nvim.go

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,13 @@ func (b *Batch) Request(procedure string, result interface{}, args ...interface{
517517

518518
// Call calls a VimL function with the given arguments.
519519
//
520-
// On execution error: fails with VimL error, does not update v:errmsg.
520+
// Fails with VimL error, does not update "v:errmsg".
521521
//
522-
// The fn arg is Function to call.
522+
// fn is Function to call.
523523
//
524-
// The args arg is Function arguments packed in an Array.
524+
// args is Function arguments packed in an Array.
525525
//
526-
// The result is result of the function call.
526+
// result is the result of the function call.
527527
func (v *Nvim) Call(fname string, result interface{}, args ...interface{}) error {
528528
if args == nil {
529529
args = []interface{}{}
@@ -533,45 +533,49 @@ func (v *Nvim) Call(fname string, result interface{}, args ...interface{}) error
533533

534534
// Call calls a VimL function with the given arguments.
535535
//
536-
// On execution error: fails with VimL error, does not update v:errmsg.
536+
// Fails with VimL error, does not update "v:errmsg".
537537
//
538-
// The fn arg is Function to call.
538+
// fn is Function to call.
539539
//
540-
// The args arg is Function arguments packed in an Array.
540+
// args is function arguments packed in an array.
541541
//
542-
// The result is result of the function call.
542+
// result is the result of the function call.
543543
func (b *Batch) Call(fname string, result interface{}, args ...interface{}) {
544544
if args == nil {
545545
args = []interface{}{}
546546
}
547547
b.call("nvim_call_function", result, fname, args)
548548
}
549549

550-
// CallDict calls a VimL Dictionary function with the given arguments.
550+
// CallDict calls a VimL dictionary function with the given arguments.
551551
//
552-
// The dict arg is Dictionary, or String evaluating to a VimL "self" dict.
552+
// Fails with VimL error, does not update "v:errmsg".
553553
//
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.
555555
//
556-
// The args arg is Function arguments packed in an Array.
556+
// fn is name of the function defined on the VimL dict.
557557
//
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.
559561
func (v *Nvim) CallDict(dict []interface{}, fname string, result interface{}, args ...interface{}) error {
560562
if args == nil {
561563
args = []interface{}{}
562564
}
563565
return v.call("nvim_call_dict_function", result, fname, dict, args)
564566
}
565567

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".
567571
//
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.
569573
//
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.
571575
//
572-
// The args arg is Function arguments packed in an Array.
576+
// args is Function arguments packed in an Array.
573577
//
574-
// The result is result of the function call.
578+
// result is the result of the function call.
575579
func (b *Batch) CallDict(dict []interface{}, fname string, result interface{}, args ...interface{}) {
576580
if args == nil {
577581
args = []interface{}{}
@@ -581,11 +585,16 @@ func (b *Batch) CallDict(dict []interface{}, fname string, result interface{}, a
581585

582586
// ExecLua execute Lua code.
583587
//
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(...)".
585592
//
586-
// The args arg is arguments to the code.
593+
// code is Lua code to execute.
587594
//
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.
589598
func (v *Nvim) ExecLua(code string, result interface{}, args ...interface{}) error {
590599
if args == nil {
591600
args = []interface{}{}
@@ -595,11 +604,16 @@ func (v *Nvim) ExecLua(code string, result interface{}, args ...interface{}) err
595604

596605
// ExecLua execute Lua code.
597606
//
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.
599613
//
600-
// The args arg is arguments to the code.
614+
// args is arguments to the code.
601615
//
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.
603617
func (b *Batch) ExecLua(code string, result interface{}, args ...interface{}) {
604618
if args == nil {
605619
args = []interface{}{}
@@ -612,11 +626,11 @@ func (b *Batch) ExecLua(code string, result interface{}, args ...interface{}) {
612626
// Relays the call to vim.notify. By default forwards your message in the
613627
// echo area but can be overriden to trigger desktop notifications.
614628
//
615-
// The msg arg is message to display to the user.
629+
// msg is message to display to the user.
616630
//
617-
// The logLevel arg is the LogLevel.
631+
// logLevel is the LogLevel.
618632
//
619-
// The opts arg is reserved for future use.
633+
// opts is reserved for future use.
620634
func (v *Nvim) Notify(msg string, logLevel LogLevel, opts map[string]interface{}) error {
621635
if logLevel == LogErrorLevel {
622636
return v.WritelnErr(msg)
@@ -635,11 +649,11 @@ func (v *Nvim) Notify(msg string, logLevel LogLevel, opts map[string]interface{}
635649
// Relays the call to vim.notify. By default forwards your message in the
636650
// echo area but can be overriden to trigger desktop notifications.
637651
//
638-
// The msg arg is message to display to the user.
652+
// msg is message to display to the user.
639653
//
640-
// The logLevel arg is the LogLevel.
654+
// logLevel is the LogLevel.
641655
//
642-
// The opts arg is reserved for future use.
656+
// opts is reserved for future use.
643657
func (b *Batch) Notify(msg string, logLevel LogLevel, opts map[string]interface{}) {
644658
if logLevel == LogErrorLevel {
645659
b.WritelnErr(msg)

0 commit comments

Comments
 (0)