Skip to content

Commit

Permalink
Add 1 to console lines and columns setting
Browse files Browse the repository at this point in the history
  • Loading branch information
murarth committed Apr 19, 2020
1 parent 57c8301 commit 68456c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/windows/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use winapi::um::consoleapi::{
SetConsoleMode,
};
use winapi::um::handleapi::{
CloseHandle,
CloseHandle, INVALID_HANDLE_VALUE,
};
use winapi::um::processenv::{
GetStdHandle,
Expand Down Expand Up @@ -1117,8 +1117,8 @@ fn cursor_to_coord(pos: Cursor) -> COORD {

fn size_to_coord(size: Size) -> COORD {
COORD{
Y: to_short(size.lines),
X: to_short(size.columns),
Y: to_short(size.lines + 1),
X: to_short(size.columns + 1),
}
}

Expand Down Expand Up @@ -1256,7 +1256,7 @@ fn result_bool(b: BOOL) -> io::Result<()> {
}

fn result_handle(ptr: HANDLE) -> io::Result<HANDLE> {
if ptr.is_null() {
if ptr == INVALID_HANDLE_VALUE {
Err(io::Error::last_os_error())
} else {
Ok(ptr)
Expand Down

0 comments on commit 68456c5

Please sign in to comment.