Please disable your adblock and script blockers to view this page

Text Editing Hates You Too


API
API.Text
TextEdit
Vim’s
Windows
~7000


Alexis Beingessner’s
’d
Jonathan Blow
Ken Thompson’s


Chinese
Japanese

No matching tags

No matching tags


Android

No matching tags

Positivity     43.00%   
   Negativity   57.00%
The New York Times
SOURCE: https://lord.io/blog/2019/text-editing-hates-you-too/
Write a review: Hacker News
Summary

Let’s look at the interface list for that newer version:That’s right, the Windows text input APIs contain 128 interfaces. They ended up staying on the legacy API.Text input is difficult.Alexis already touches on selection in a couple places, but as she mentions in her article, her experience is with working on text rendering. This is the same behavior that prevents carets from migrating left when vertically moving past short lines.Ok, so we now know that a text selection has two chunks of state, the byte offsets of its position inside the string and the x-position in pixels mentioned above. There aren’t.Alexis mentions disconnected selections in mixed bi-directional text, like this example from TextEdit:This actually makes sense, since Arabic in strings is encoded from right to left, so this selection appears disconnected, but byte-wise represents a contiguous range of the string.This makes it a little surprising, then, that we can get this selection:Yes, that is a visually contiguous, byte-wise disconnected selection. For instance, with some Chinese input methods, the user types the pronounciation of what they’re trying to say, and get a list of characters that match phonetically:This is sometimes called a composing region, and it often appears as underlined text. Terminals conflate these two, causing problems.You also may have noticed that the input method is a separate process from the application receiving text input, and since both the input method and application can make modifications to the state of the text field, we get concurrent editing problems.

As said here by