Skip to content

Commit ef8a8cf

Browse files
akiyosizchee
authored andcommitted
nvim: add ExitCode function
1 parent c5013d8 commit ef8a8cf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

nvim/nvim.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ func (v *Nvim) Close() error {
9494
return err
9595
}
9696

97+
// ExitCode returns the exit code of the exited nvim process.
98+
func (v *Nvim) ExitCode() int {
99+
if v.cmd.ProcessState == nil {
100+
return -1
101+
}
102+
103+
return v.cmd.ProcessState.ExitCode()
104+
}
105+
97106
// New creates an Nvim client. When connecting to Nvim over stdio, use stdin as
98107
// r and stdout as w and c, When connecting to Nvim over a network connection,
99108
// use the connection for r, w and c.

0 commit comments

Comments
 (0)