Dual Carets
As noted in Highlighting, a single character offset can correspond to two caret positions. In this case, TextEdit draws dual carets, a high caret and a low caret, each measuring half the line's height. The high caret is displayed at
the primary caret position for the character offset. The low caret is displayed
at the secondary caret position. When the caret position is unambiguous (for
example, not on a direction boundary), the primary (high) and secondary
(low) carets are at the same position, so the user sees one caret. (The
appearance of dual carets may change in the future.)
The following figure shows the dual caret bordering the Arabic text where the
overall line direction is left to right but the Arabic script run is right to left.
In this case, the primary caret is associated with the English text and the
secondary caret is associated with the Arabic text.
Dual carets in mixed- directional text.
When TextEdit pastes multiple styles and script runs into a record, the caret is positioned after the newly pasted text, and the keyboard script reflects
the font of the last character of the newly pasted text. In the next figure, the
keyboard script (that is, the script for keyboard input) is Roman to reflect the
font of the last character of the newly pasted text.
Pasting styled text
In the following figure, drawing A illustrates that when a mouse click occurs
to the left of primary caret position 12, TextEdit places a primary caret at primary caret position 12 and a secondary caret at secondary caret position 4.
However, when a mouse click occurs to the right of primary caret position 12,
TextEdit places a primary caret in primary caret position 4 and a secondary caret in secondary caret position 12, as shown in drawing B in the following
figure.
Note: There is a relationship between the keyboard icon and the dual
caret. The setting of the keyboard script is reflected by the keyboard icon.
In this case, the primary line direction is right to left, so if the Roman
keyboard icon is displayed, text is entered at the secondary caret position. If
an Arabic keyboard icon is displayed, text is entered at the primary caret
position.
Dual carets at a direction boundary