From 9974069af6cac2fecf89cf79dd1f419ef58a3641 Mon Sep 17 00:00:00 2001 From: Slackadays Date: Sun, 20 Oct 2024 13:05:10 -0400 Subject: [PATCH] Unsupported on Windows --- src/cb/src/actions/script.cpp | 6 ++++++ src/cb/src/clipboard.hpp | 2 +- src/cb/src/utils/cowcopy.cpp | 1 - src/cb/src/utils/distance.cpp | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cb/src/actions/script.cpp b/src/cb/src/actions/script.cpp index 4f0ef0f20..7fc1a6449 100644 --- a/src/cb/src/actions/script.cpp +++ b/src/cb/src/actions/script.cpp @@ -74,6 +74,11 @@ void script() { void runClipboardScript() { if (!fs::is_regular_file(path.metadata.script)) return; +#if defined(_WIN32) || defined(_WIN64) + fprintf(stderr, "%s", formatColors("[error][inverse] ✘ [noinverse] Sorry, but clipboard scripts aren't supported on Windows yet.[blank]\n").data()); +#endif + +#if defined(UNIX_OR_UNIX_LIKE) static bool secondRun = false; fs::path currentPath = fs::current_path(); @@ -104,4 +109,5 @@ void runClipboardScript() { fs::current_path(currentPath); secondRun = true; +#endif } \ No newline at end of file diff --git a/src/cb/src/clipboard.hpp b/src/cb/src/clipboard.hpp index 43f1f3f9c..0e28c3623 100644 --- a/src/cb/src/clipboard.hpp +++ b/src/cb/src/clipboard.hpp @@ -364,7 +364,7 @@ std::string generatedEndbar(); std::string repeatString(const std::string_view& character, const size_t& length); std::string makeControlCharactersVisible(const std::string_view& oldStr, size_t len = 0); std::string removeExcessWhitespace(const std::string_view& str, size_t len = 0); -unsigned long levenshteinDistance(const std::string_view& one, const std::string_view& two); +size_t levenshteinDistance(const std::string_view& one, const std::string_view& two); void setLanguagePT(); void setLanguageTR(); void setLanguageES_CO(); diff --git a/src/cb/src/utils/cowcopy.cpp b/src/cb/src/utils/cowcopy.cpp index cb1d103b7..c439a12f8 100644 --- a/src/cb/src/utils/cowcopy.cpp +++ b/src/cb/src/utils/cowcopy.cpp @@ -18,4 +18,3 @@ #include #include #endif - diff --git a/src/cb/src/utils/distance.cpp b/src/cb/src/utils/distance.cpp index 4cf65528f..7db94e738 100644 --- a/src/cb/src/utils/distance.cpp +++ b/src/cb/src/utils/distance.cpp @@ -15,7 +15,7 @@ along with this program. If not, see .*/ #include "../clipboard.hpp" -unsigned long levenshteinDistance(const std::string_view& one, const std::string_view& two) { +size_t levenshteinDistance(const std::string_view& one, const std::string_view& two) { if (one == two) return 0; if (one.empty()) return two.size();