User:Uri/Bidi editing: Difference between revisions

m
Line 100: Line 100:
Let's take our example of '''latinHEBREWmore''' again, displayed as '''latinWERBEHmore'''. Suppose the user visually moved the caret to between the '''n''' and the '''W''' (i.e. by using the arrow keys or the mouse). Now, suppose the user types an LTR character ('''x'''). The system has to switch to logical mode, that is, to map the visual position to a logical one. As we recall, this is ambiguous: the logical positions after the '''n''' and after the '''W''' both correspond to the current visual position. However, since at this stage the system knows that the user typed a LTR character, it will prefer the logical position following the '''n''', and the result would be logically '''latinxHEBREWmore''' and visually '''latinx|WERBEHmore'''.
Let's take our example of '''latinHEBREWmore''' again, displayed as '''latinWERBEHmore'''. Suppose the user visually moved the caret to between the '''n''' and the '''W''' (i.e. by using the arrow keys or the mouse). Now, suppose the user types an LTR character ('''x'''). The system has to switch to logical mode, that is, to map the visual position to a logical one. As we recall, this is ambiguous: the logical positions after the '''n''' and after the '''W''' both correspond to the current visual position. However, since at this stage the system knows that the user typed a LTR character, it will prefer the logical position following the '''n''', and the result would be logically '''latinxHEBREWmore''' and visually '''latinx|WERBEHmore'''.


Conversely, if, at the same visual location, the user types an RTL character ('''X'''), the system will prefer the other logical position mapped to this visual position, and the result will be logocally '''latinHEBREWXmore''', and visually '''latin|XWERBEHmore'''.
Conversely, if, at the same visual location, the user types an RTL character ('''X'''), the system will prefer the other logical position mapped to this visual position, and the result will be logically '''latinHEBREWXmore''', and visually '''latin|XWERBEHmore'''.


In both cases, the result will be likely what the user expected. Notice that we are able to do this because unlike the current system, which tries to "guess" what character the user will type next (based, e.g., on the keyboard layout), the proposed system only resolves the visual-to-logical ambiguity when it has all the information, i.e. when it knows what character was, in fact, typed in.
In both cases, the result will be likely what the user expected. Notice that we are able to do this because unlike the current system, which tries to "guess" what character the user will type next (based, e.g., on the keyboard layout), the proposed system only resolves the visual-to-logical ambiguity when it has all the information, i.e. when it knows what character was, in fact, typed in.
67

edits