Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/elfmz/far2l.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelfmz <fenix1905@tut.by>2022-11-05 20:31:53 +0300
committerGitHub <noreply@github.com>2022-11-05 20:31:53 +0300
commit253a6b140797e035eb9301a1632fed2408a837e2 (patch)
treeed6be316904b5d5ff11b7bfa46e7037fc2ec51d5 /far2l/src/locale
parent89eaed71c674aadda536408638e3416bc7f4c053 (diff)
support full-width/composite characters and true color palette in terminal (#1386)
Added normal support for full-width (CJK etc) and composite (using diacritics) characters. IMPORTANT: WINPORT API changed in binary incompatible way in order to implement this.
Diffstat (limited to 'far2l/src/locale')
-rw-r--r--far2l/src/locale/codepage.cpp2
-rw-r--r--far2l/src/locale/locale.hpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/far2l/src/locale/codepage.cpp b/far2l/src/locale/codepage.cpp
index 5a367b90..f8c5d314 100644
--- a/far2l/src/locale/codepage.cpp
+++ b/far2l/src/locale/codepage.cpp
@@ -188,7 +188,7 @@ static void FormatCodePageString(UINT CodePage, const wchar_t *CodePageName, For
{
if (CodePage!=CP_AUTODETECT)
{
- CodePageNameString<<fmt::Width(5)<<CodePage<<BoxSymbols[BS_V1]<<(!IsCodePageNameCustom||CallbackCallSource==CodePagesFill?L' ':L'*');
+ CodePageNameString<<fmt::Expand(5)<<CodePage<<BoxSymbols[BS_V1]<<(!IsCodePageNameCustom||CallbackCallSource==CodePagesFill?L' ':L'*');
}
CodePageNameString<<CodePageName;
}
diff --git a/far2l/src/locale/locale.hpp b/far2l/src/locale/locale.hpp
index 417e720f..866b5d26 100644
--- a/far2l/src/locale/locale.hpp
+++ b/far2l/src/locale/locale.hpp
@@ -40,11 +40,11 @@ extern const wchar_t WIN_EOL_fmt[];
inline int __cdecl StrLength(const wchar_t *str) { return (int) wcslen(str); }
-inline int IsSpace(wchar_t x) { return x==L' ' || x==L'\t'; }
+inline bool IsSpace(wchar_t x) { return x==L' ' || x==L'\t' || x==0x3000; }
-inline int IsEol(wchar_t x) { return x==L'\r' || x==L'\n'; }
+inline bool IsEol(wchar_t x) { return x==L'\r' || x==L'\n'; }
-inline int IsSpaceOrEos(wchar_t x) { return !x || x==L' ' || x==L'\t'; }
+inline bool IsSpaceOrEos(wchar_t x) { return !x || IsSpace(x); }
inline wchar_t __cdecl Upper(wchar_t Ch)
{