1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: check incorrect names

This commit is contained in:
Enzo Baldisserri
2020-05-16 16:12:23 +02:00
committed by GitHub
parent 3bd88a3cc2
commit f44a40eee0
61 changed files with 636 additions and 597 deletions

View File

@@ -8,18 +8,18 @@ struct Coord {
}
struct SmallRect {
Left i16
Top i16
Right i16
Bottom i16
left i16
top i16
right i16
bottom i16
}
struct ConsoleScreenBufferInfo {
dwSize Coord
dwCursorPosition Coord
wAttributes u16
srWindow SmallRect
dwMaximumWindowSize Coord
dw_size Coord
dw_cursor_position Coord
w_attributes u16
sr_window SmallRect
dw_maximum_window_size Coord
}
fn C.GetConsoleScreenBufferInfo(handle os.HANDLE, info &ConsoleScreenBufferInfo) bool
@@ -28,13 +28,11 @@ fn C.GetConsoleScreenBufferInfo(handle os.HANDLE, info &ConsoleScreenBufferInfo)
pub fn get_terminal_size() (int, int) {
if is_atty(1) > 0 && os.getenv('TERM') != 'dumb' {
info := ConsoleScreenBufferInfo{}
if C.GetConsoleScreenBufferInfo(C.GetStdHandle(C.STD_OUTPUT_HANDLE), &info) {
columns := int(info.srWindow.Right - info.srWindow.Left + 1)
rows := int(info.srWindow.Bottom - info.srWindow.Top + 1)
columns := int(info.sr_window.right - info.sr_window.left + 1)
rows := int(info.sr_window.bottom - info.sr_window.top + 1)
return columns, rows
}
}
return default_columns_size, default_rows_size
}