mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
Fix support for the Tencent QQPinyin IME (#19046)
This commit is contained in:
parent
f28bb42979
commit
b47fdfc7e6
5
.github/actions/spelling/allow/allow.txt
vendored
5
.github/actions/spelling/allow/allow.txt
vendored
@ -24,8 +24,8 @@ dze
|
||||
dzhe
|
||||
Emacspeak
|
||||
Fitt
|
||||
FTCS
|
||||
flac
|
||||
FTCS
|
||||
gantt
|
||||
gfm
|
||||
ghe
|
||||
@ -61,8 +61,8 @@ Powerline
|
||||
ptys
|
||||
pwn
|
||||
pwshw
|
||||
QOL
|
||||
qof
|
||||
QOL
|
||||
qps
|
||||
quickfix
|
||||
rclt
|
||||
@ -82,6 +82,7 @@ stakeholders
|
||||
subpage
|
||||
sustainability
|
||||
sxn
|
||||
Tencent
|
||||
TLDR
|
||||
tonos
|
||||
toolset
|
||||
|
||||
@ -711,6 +711,16 @@ TextAttribute Implementation::_textAttributeFromAtom(TfGuidAtom atom) const
|
||||
TF_DISPLAYATTRIBUTE da;
|
||||
THROW_IF_FAILED(dai->GetAttributeInfo(&da));
|
||||
|
||||
// The Tencent QQPinyin IME creates TF_CT_COLORREF attributes with a color of 0x000000 (black).
|
||||
// We respect their wish, which results in the preview text being invisible.
|
||||
// (Note that sending this COLORREF is incorrect, and not a bug in our handling.)
|
||||
//
|
||||
// After some discussion, we realized that an IME which sets only one color but not
|
||||
// the others is likely not properly tested anyway, so we reject those cases.
|
||||
// After all, what behavior do we expect, if the IME sends e.g. foreground=blue,
|
||||
// without knowing whether our terminal theme already uses a blue background?
|
||||
if (da.crText.type == da.crBk.type && da.crText.type == da.crLine.type)
|
||||
{
|
||||
if (da.crText.type != TF_CT_NONE)
|
||||
{
|
||||
attr.SetForeground(_colorFromDisplayAttribute(da.crText));
|
||||
@ -719,6 +729,11 @@ TextAttribute Implementation::_textAttributeFromAtom(TfGuidAtom atom) const
|
||||
{
|
||||
attr.SetBackground(_colorFromDisplayAttribute(da.crBk));
|
||||
}
|
||||
if (da.crLine.type != TF_CT_NONE)
|
||||
{
|
||||
attr.SetUnderlineColor(_colorFromDisplayAttribute(da.crLine));
|
||||
}
|
||||
}
|
||||
if (da.lsStyle >= TF_LS_NONE && da.lsStyle <= TF_LS_SQUIGGLE)
|
||||
{
|
||||
static constexpr UnderlineStyle lut[] = {
|
||||
@ -737,10 +752,6 @@ TextAttribute Implementation::_textAttributeFromAtom(TfGuidAtom atom) const
|
||||
{
|
||||
attr.SetUnderlineStyle(UnderlineStyle::DoublyUnderlined);
|
||||
}
|
||||
if (da.crLine.type != TF_CT_NONE)
|
||||
{
|
||||
attr.SetUnderlineColor(_colorFromDisplayAttribute(da.crLine));
|
||||
}
|
||||
|
||||
return attr;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user