mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
term: obtain the cursor position via termios.h (#11372)
This commit is contained in:
@@ -1008,3 +1008,15 @@ pub fn glob(patterns ...string) ?[]string {
|
||||
matches.sort()
|
||||
return matches
|
||||
}
|
||||
|
||||
pub fn last_error() IError {
|
||||
$if windows {
|
||||
code := int(C.GetLastError())
|
||||
msg := get_error_msg(code)
|
||||
return error_with_code(msg, code)
|
||||
} $else {
|
||||
code := C.errno
|
||||
msg := posix_get_error_msg(code)
|
||||
return error_with_code(msg, code)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user