From 4a40fa30c44baa18c0aa71ada6cf3c1447dde78a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:07:09 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-clang-format: v18.1.8 → v19.1.0](https://github.com/pre-commit/mirrors-clang-format/compare/v18.1.8...v19.1.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ded1479..504e7b46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,7 +45,7 @@ repos: name: check .editorconfig rules - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v18.1.8 + rev: v19.1.0 hooks: - id: clang-format From 2adbbe388801b8084db493217aa2b66afde9f341 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:07:17 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cpp-terminal/private/screen.cpp | 7 ++----- tests/unicode.test.cpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cpp-terminal/private/screen.cpp b/cpp-terminal/private/screen.cpp index f684dec4..29813188 100644 --- a/cpp-terminal/private/screen.cpp +++ b/cpp-terminal/private/screen.cpp @@ -24,11 +24,8 @@ Term::Screen Term::screen_size() if(GetConsoleScreenBufferInfo(Private::out.handle(), &inf)) return Term::Screen(static_cast(inf.srWindow.Bottom - inf.srWindow.Top + 1), static_cast(inf.srWindow.Right - inf.srWindow.Left + 1)); return Term::Screen(); #else - Term::Screen ret; - struct winsize window - { - 0, 0, 0, 0 - }; + Term::Screen ret; + struct winsize window{0, 0, 0, 0}; if(ioctl(Private::out.fd(), TIOCGWINSZ, &window) != -1) ret = {window.ws_row, window.ws_col}; return ret; #endif diff --git a/tests/unicode.test.cpp b/tests/unicode.test.cpp index d503dc3a..9e47c3b4 100644 --- a/tests/unicode.test.cpp +++ b/tests/unicode.test.cpp @@ -26,7 +26,7 @@ TEST_CASE("to_narrow") #if defined(_WIN32) TEST_CASE("to_wide") { - std::string in((const char*)(u8"∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i)γνωρίζω ἀπὸ τὴν ὄψηდარგებში⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙როგორიცააᚻ∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂᛖᛒᚢᛞᛖразличных\tопеฮั่นเสื่อมโทรมแማደሪያ የለው፥ ግንድ ይዞ ይዞራል።\n")); // Some multi-language charabia + std::string in((const char*)(u8"∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i)γνωρίζω ἀπὸ τὴν ὄψηდარგებში⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙როგორიცააᚻ∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂᛖᛒᚢᛞᛖразличных\tопеฮั่นเสื่อมโทรมแማደሪያ የለው፥ ግንድ ይዞ ይዞራል።\n")); // Some multi-language charabia std::wstring out{Term::Private::to_wide(in)}; CHECK(out == L"∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i)γνωρίζω ἀπὸ τὴν ὄψηდარგებში⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙როგორიცააᚻ∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂᛖᛒᚢᛞᛖразличных\tопеฮั่นเสื่อมโทรมแማደሪያ የለው፥ ግንድ ይዞ ይዞራል።\n"); }