Servers in 105 countries
We now maintain an index variable. Previously, the cursor was always at the right-end of the input, since you couldn't use arrow keys to move it left, and new input was always appended at the right-end. Now, we need to keep a separate index which is not necessarily at the end of the input, and when a user enters a character we splice it into the input in the correct location.
,更多细节参见51吃瓜
Что думаешь? Оцени!
Что думаешь? Оцени!