Skip to content

Commit 1ddf6d8

Browse files
committed
nvim: add more documentation and add named return
1 parent 78c45b8 commit 1ddf6d8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

nvim/api_def.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ func BufferChangedTick(buffer Buffer) (changedtick int) {
8787
}
8888

8989
// BufferKeymap gets a list of buffer-local mappings.
90+
//
91+
// The mode short-name ("n", "i", "v", ...).
9092
func BufferKeyMap(buffer Buffer, mode string) []*Mapping {
9193
name(nvim_buf_get_keymap)
9294
}
@@ -612,7 +614,7 @@ func SetVVar(name string, value interface{}) {
612614
// AllOptionsInfo gets the option information for all options.
613615
//
614616
// The dictionary has the full option names as keys and option metadata
615-
// dictionaries as detailed at `nvim_get_option_info`.
617+
// dictionaries as detailed at OptionInfo.
616618
//
617619
// Resulting map has keys:
618620
//
@@ -621,7 +623,7 @@ func SetVVar(name string, value interface{}) {
621623
// shortname
622624
// Shortened name of the option (like 'ft').
623625
// type
624-
// type of option ("string", "integer" or "boolean").
626+
// type of option ("string", "number" or "boolean").
625627
// default
626628
// The default value for the option.
627629
// was_set
@@ -640,7 +642,7 @@ func SetVVar(name string, value interface{}) {
640642
// List of comma separated values.
641643
// flaglist
642644
// List of single char flags.
643-
func AllOptionsInfo() OptionInfo {
645+
func AllOptionsInfo() (opinfo OptionInfo) {
644646
name(nvim_get_all_options_info)
645647
returnPtr()
646648
}
@@ -654,7 +656,7 @@ func AllOptionsInfo() OptionInfo {
654656
// shortname
655657
// Shortened name of the option (like 'ft').
656658
// type
657-
// type of option ("string", "integer" or "boolean").
659+
// type of option ("string", "number" or "boolean").
658660
// default
659661
// The default value for the option.
660662
// was_set
@@ -673,7 +675,7 @@ func AllOptionsInfo() OptionInfo {
673675
// List of comma separated values.
674676
// flaglist
675677
// List of single char flags.
676-
func OptionInfo(name string) OptionInfo {
678+
func OptionInfo(name string) (opinfo OptionInfo) {
677679
name(nvim_get_option_info)
678680
returnPtr()
679681
}
@@ -911,15 +913,15 @@ func LoadContext(dict map[string]interface{}) (contextMap interface{}) {
911913
}
912914

913915
// Mode gets Nvim's current mode.
914-
func Mode() Mode {
916+
func Mode() (mode Mode) {
915917
name(nvim_get_mode)
916918
returnPtr()
917919
}
918920

919921
// KeyMap gets a list of global (non-buffer-local) mapping definitions.
920922
//
921923
// The mode arg is the mode short-name, like `n`, `i`, `v` or etc.
922-
func KeyMap(mode string) []*Mapping {
924+
func KeyMap(mode string) (maps []*Mapping) {
923925
name(nvim_get_keymap)
924926
}
925927

@@ -965,7 +967,7 @@ func Commands(opts map[string]interface{}) (commands map[string]*Command) {
965967
name(nvim_get_commands)
966968
}
967969

968-
func APIInfo() []interface{} {
970+
func APIInfo() (apiInfo []interface{}) {
969971
name(nvim_get_api_info)
970972
}
971973

0 commit comments

Comments
 (0)