Added e and ge missing movements, that described in the design markdown file (placed at design/vi.md).
Updated to correct behavior of the ^ key in vi mode (moves to first non-blank character as expected).
Simplified the complicated code of the b movement in vi mode.
More about the last clause
I found that no need to check current character if need to move to the last character of current or next (previous) word. Important to check next (or previous) character is the whitespace or not.
Let's see in an example. Let be the word "hello", and the cursor is pointing to last character (we need to move last character of word). As you see, checking the current character is very bad idea, because there is a way -- check next character and it's whitespace, so need to move to next word.
But, if the cursor pointing to begin or mid of the word above, then next character is non-whitespace and it's fine to move to last character of the word.
What changed?
e
andge
missing movements, that described in the design markdown file (placed at design/vi.md).^
key in vi mode (moves to first non-blank character as expected).b
movement in vi mode.More about the last clause
I found that no need to check current character if need to move to the last character of current or next (previous) word. Important to check next (or previous) character is the whitespace or not.
Let's see in an example. Let be the word "hello", and the cursor is pointing to last character (we need to move last character of word). As you see, checking the current character is very bad idea, because there is a way -- check next character and it's whitespace, so need to move to next word.
But, if the cursor pointing to begin or mid of the word above, then next character is non-whitespace and it's fine to move to last character of the word.