What this PR does / why we need it:
Fixes H and L behavior to be faithful to how vanilla Vim behaves. Prior to this, H and L would jump to the top and bottom visible lines in the editor, not respecting the editor.cursorSurroundingLines (scrolloff in vanilla Vim) setting. It would also move the cursor to the first non whitespace character on the line (either backwards or forwards) which was not faithful to vanilla Vim.
It also fixes tests that were written with the assumption of this incorrect behavior.
Which issue(s) this PR fixes
Fixes #4912 and #8837.
Special notes for your reviewer:
Let me know if you'd like more tests written.
Edit: Oops. After checking :h M looks like what I said about allowing the cursor to land on a white space character was incorrect. Have reverted the test changes and added functionality to allow this behavior.
What this PR does / why we need it: Fixes H and L behavior to be faithful to how vanilla Vim behaves. Prior to this, H and L would jump to the top and bottom visible lines in the editor, not respecting the
editor.cursorSurroundingLines
(scrolloff
in vanilla Vim) setting. It would also move the cursor to the first non whitespace character on the line (either backwards or forwards) which was not faithful to vanilla Vim.It also fixes tests that were written with the assumption of this incorrect behavior.
Which issue(s) this PR fixes Fixes #4912 and #8837.
Special notes for your reviewer: Let me know if you'd like more tests written.
Edit: Oops. After checking
:h M
looks like what I said about allowing the cursor to land on a white space character was incorrect. Have reverted the test changes and added functionality to allow this behavior.