mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
readline: capitalize structs
This commit is contained in:
parent
841d824216
commit
243626c7c1
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
// Linux version
|
// Linux version
|
||||||
// Will serve as more advanced input method
|
// Will serve as more advanced input method
|
||||||
// Based on the work of https://github.com/AmokHuginnsson/replxx
|
// Based on the work of https://github.com/AmokHuginnsson/replxx
|
||||||
|
|
||||||
module readline
|
module readline
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ import term
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
// Used to change the terminal options
|
// Used to change the terminal options
|
||||||
struct termios {
|
struct Termios {
|
||||||
mut:
|
mut:
|
||||||
c_iflag int
|
c_iflag int
|
||||||
c_oflag int
|
c_oflag int
|
||||||
@ -24,7 +24,7 @@ mut:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Used to collect the screen information
|
// Used to collect the screen information
|
||||||
struct winsize {
|
struct Winsize {
|
||||||
ws_row u16
|
ws_row u16
|
||||||
ws_col u16
|
ws_col u16
|
||||||
ws_xpixel u16
|
ws_xpixel u16
|
||||||
@ -34,7 +34,7 @@ struct winsize {
|
|||||||
struct Readline {
|
struct Readline {
|
||||||
mut:
|
mut:
|
||||||
is_raw bool
|
is_raw bool
|
||||||
orig_termios termios
|
orig_termios Termios
|
||||||
current ustring // Line being edited
|
current ustring // Line being edited
|
||||||
cursor int // Cursor position
|
cursor int // Cursor position
|
||||||
overwrite bool
|
overwrite bool
|
||||||
@ -232,7 +232,7 @@ fn (r mut Readline) execute(a Action, c int) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_screen_columns() int {
|
fn get_screen_columns() int {
|
||||||
ws := winsize{}
|
ws := Winsize{}
|
||||||
cols := if C.ioctl(1, C.TIOCGWINSZ, &ws) == -1 { 80 } else { int(ws.ws_col) }
|
cols := if C.ioctl(1, C.TIOCGWINSZ, &ws) == -1 { 80 } else { int(ws.ws_col) }
|
||||||
return cols
|
return cols
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user