When using the end of line motion ($) while in temporary mode, the cursor would be placed in insert mode just before the last character instead of after, just like in NeoVim. This happens because `EndOfLine` kind of assumes that we're in `Normal` mode and simply places the cursor in the last character instead of the newline character. This commit moves the cursor one position to the right when exiting temporary mode and the motion used was `Motion::EndOfLine` - Update `vim::normal::Vim.exit_temporary_normal` to now accept a `Option<&Motion>` argument, in case callers want this new logic to potentially be applied Closes #42278 Release Notes: - Fixed temporary mode exit when using `$` to move to the end of the line
28 lines
685 B
JSON
28 lines
685 B
JSON
{"Put":{"state":"lorem ˇipsum"}}
|
|
{"Key":"i"}
|
|
{"Get":{"state":"lorem ˇipsum","mode":"Insert"}}
|
|
{"Key":"ctrl-o"}
|
|
{"Key":"$"}
|
|
{"Get":{"state":"lorem ipsumˇ","mode":"Insert"}}
|
|
{"Put":{"state":"loremˇ ipsum dolor"}}
|
|
{"Key":"a"}
|
|
{"Get":{"state":"lorem ˇipsum dolor","mode":"Insert"}}
|
|
{"Key":"a"}
|
|
{"Key":"n"}
|
|
{"Key":"d"}
|
|
{"Key":"space"}
|
|
{"Key":"ctrl-o"}
|
|
{"Key":"w"}
|
|
{"Get":{"state":"lorem and ipsum ˇdolor","mode":"Insert"}}
|
|
{"Put":{"state":"lorem ˇipsum dolor"}}
|
|
{"Key":"i"}
|
|
{"Get":{"state":"lorem ˇipsum dolor","mode":"Insert"}}
|
|
{"Key":"a"}
|
|
{"Key":"n"}
|
|
{"Key":"d"}
|
|
{"Key":"space"}
|
|
{"Key":"ctrl-o"}
|
|
{"Key":"y"}
|
|
{"Key":"$"}
|
|
{"Get":{"state":"lorem and ˇipsum dolor","mode":"Insert"}}
|