Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Selection overlaps with preedit. Simply discard selection in that
// case and put cursor at preedit position.
hmm... could you elaborate why this is reasonable? should't we just trim the overlapping part?
if (selection_range.IsValid()) {
if (selection_range.end() <= preedit_range.start()) {
// Selection is unaffected because it is to the left of preedit.
} else if (selection_range.start() >= preedit_range.end()) {
// Selection is after preedit, so move selection back
data.cursor -= preedit_range.length();
data.anchor -= preedit_range.length();
} else {
// Selection overlaps with preedit. Simply discard selection in that
// case and put cursor at preedit position.
data.cursor = preedit_range.start();
data.anchor = preedit_range.start();
}
} else {
// Invalid selection range. Put cursor at preedit position.
data.cursor = preedit_range.start();
data.anchor = preedit_range.start();
}
could you not assume start <= end ?
constexpr gfx::Range kPreeditRange(11, 38);
constexpr gfx::Range kSelectionRange = {38, 38};
style: coudl you keep using consistent style?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Selection overlaps with preedit. Simply discard selection in that
// case and put cursor at preedit position.
hmm... could you elaborate why this is reasonable? should't we just trim the overlapping part?
We could do that as well if that is preferred. Was not sure if this was indeed something that could actually occur and so defaulted to this type of fallback.
data.cursor = preedit_range.start();
end
Can't be end because the preedit is not included in surrounding text that is sent. It's as if the entire preedit is collapsed at the cursor position.
constexpr gfx::Range kPreeditRange(11, 38);
constexpr gfx::Range kSelectionRange = {38, 38};
style: coudl you keep using consistent style?
yup, missed this after copying from another test and renaming from regular variable to constexpr for this test
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Selection overlaps with preedit. Simply discard selection in that
// case and put cursor at preedit position.
Orko Garaihmm... could you elaborate why this is reasonable? should't we just trim the overlapping part?
We could do that as well if that is preferred. Was not sure if this was indeed something that could actually occur and so defaulted to this type of fallback.
Done
data.cursor = preedit_range.start();
Orko Garaiend
Can't be end because the preedit is not included in surrounding text that is sent. It's as if the entire preedit is collapsed at the cursor position.
please see latest patch with additional comments.
if (selection_range.IsValid()) {
if (selection_range.end() <= preedit_range.start()) {
// Selection is unaffected because it is to the left of preedit.
} else if (selection_range.start() >= preedit_range.end()) {
// Selection is after preedit, so move selection back
data.cursor -= preedit_range.length();
data.anchor -= preedit_range.length();
} else {
// Selection overlaps with preedit. Simply discard selection in that
// case and put cursor at preedit position.
data.cursor = preedit_range.start();
data.anchor = preedit_range.start();
}
} else {
// Invalid selection range. Put cursor at preedit position.
data.cursor = preedit_range.start();
data.anchor = preedit_range.start();
}
Orko Garaicould you not assume start <= end ?
see latest patch. For selection start > end is possible.
constexpr gfx::Range kPreeditRange(11, 38);
constexpr gfx::Range kSelectionRange = {38, 38};
Orko Garaistyle: coudl you keep using consistent style?
yup, missed this after copying from another test and renaming from regular variable to constexpr for this test
Done
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |