Skip to content

Commit 49d7dca

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c28625b commit 49d7dca

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

cpp-terminal/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void Term::Event::parse()
5454
std::size_t found = m_str.find(';', 2);
5555
if(found != std::string::npos)
5656
{
57-
m_Type = Type::Cursor;
57+
m_Type = Type::Cursor;
5858

5959
m_Cursor = Cursor(std::stoi(m_str.substr(2, found - 2)), std::stoi(m_str.substr(found + 1, m_str.size() - (found + 2))));
6060
}

cpp-terminal/platforms/cursor.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@
55
#else
66
#include "cpp-terminal/event.hpp"
77
#include "cpp-terminal/input.hpp"
8+
89
#include <iostream>
910
#endif
1011

1112
Term::Cursor Term::cursor_position()
1213
{
1314
#if defined(_WIN32)
14-
Term::Cursor ret;
15-
HANDLE hConOut{CreateFile("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)};
15+
Term::Cursor ret;
16+
HANDLE hConOut{CreateFile("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)};
1617
CONSOLE_SCREEN_BUFFER_INFO inf;
17-
if(GetConsoleScreenBufferInfo(hConOut, &inf)) { ret = {static_cast<std::size_t>(inf.dwCursorPosition.Y+1), static_cast<std::size_t>(inf.dwCursorPosition.X+1)}; }
18+
if(GetConsoleScreenBufferInfo(hConOut, &inf)) { ret = {static_cast<std::size_t>(inf.dwCursorPosition.Y + 1), static_cast<std::size_t>(inf.dwCursorPosition.X + 1)}; }
1819
CloseHandle(hConOut);
1920
return ret;
2021
#else
2122
std::cout << Term::cursor_position_report() << std::flush;
2223
Term::Event c;
23-
while((c = Platform::read_raw()).empty());
24+
while((c = Platform::read_raw()).empty())
25+
;
2426
return c;
2527
#endif
26-
}
28+
}

0 commit comments

Comments
 (0)