Skip to content

Commit 7b2e8ef

Browse files
committed
nvim: add UserCommand and OptionValueScope types
Signed-off-by: Koichi Shiraishi <[email protected]>
1 parent 04135a9 commit 7b2e8ef

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

nvim/types.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,33 @@ type Command struct {
405405
Definition string `msgpack:"definition"`
406406
}
407407

408+
// UserCommand is replacement command to execute when this user command is executed.
409+
type UserCommand struct {
410+
// Args passed to the command, if any.
411+
Args string `msgpack:"args"`
412+
413+
// Bang true if the command was executed with a ! modifier.
414+
Bang bool `msgpack:"bang"`
415+
416+
// StartLine is the starting line of the command range.
417+
StartLine int `msgpack:"line1"`
418+
419+
// FinalLine is the final line of the command range.
420+
FinalLine int `msgpack:"line2"`
421+
422+
// Range is the number of items in the command range: 0, 1, or 2.
423+
Range int `msgpack:"range"`
424+
425+
// Count is the any count supplied.
426+
Count int `msgpack:"count"`
427+
428+
// Reg is the optional register, if specified.
429+
Reg string `msgpack:"reg"`
430+
431+
// Mode is the command modifiers, if any.
432+
Mode string `msgpack:"mods"`
433+
}
434+
408435
// TextChunk represents a text chunk.
409436
type TextChunk struct {
410437
// Text is text.
@@ -628,6 +655,15 @@ type OptionInfo struct {
628655
FlagList bool `msgpack:"flaglist"`
629656
}
630657

658+
// OptionValueScope represents a OptionValue scope optional parameter value.
659+
type OptionValueScope string
660+
661+
// list of OptionValueScope.
662+
const (
663+
GlobalScope = OptionValueScope("global")
664+
LocalScope = OptionValueScope("global")
665+
)
666+
631667
// LogLevel represents a nvim log level.
632668
type LogLevel int
633669

0 commit comments

Comments
 (0)