Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edge cases for H, L and M and introduce 'startofline' option #275

Merged
merged 8 commits into from
Mar 3, 2021

Conversation

citizenmatt
Copy link
Member

This PR fixes a number of edge cases for H, L and M motions:

  • Correctly place cursor at midpoint of visible lines, rather than midpoint of screen. Fixes issue when number of visible lines is less than a full screen, such as short files or scrolled up with virtual space. VIM-2238
  • Handle op pending mode. e.g. d100H will try to delete from current line to 99 lines from top of the screen. In normal mode, this will be capped at the visible screen length, but in op pending, it will use the full {count} value and then apply scrolloff if set.
  • Other minor fixes for scrolloff
  • Adds a load of tests

It also introduces the 'startofline' option. It positions the cursor at the first non-blank char when on (default) and tries to keep the same column when disabled. This applies to H, L and M, and also G, gg and i_CTRL-Home, the scrolling motions <C-D>, <C-U>, <C-F> and <C-B>, the shift operators << and >> and also {count}% and :{range}.

@AlexPl292 AlexPl292 merged commit e0e80d2 into JetBrains:master Mar 3, 2021
@AlexPl292
Copy link
Member

Okay, this great guy goes directly into master. Thank you for updates! (And now I should update my ~/.ideavimrc with this nice option :)

@citizenmatt citizenmatt deleted the VIM-2238 branch March 3, 2021 09:38
@citizenmatt
Copy link
Member Author

Ah, I've just realised that I didn't update the docs. Not entirely sure how I do that as part of a PR, sorry.

@AlexPl292
Copy link
Member

You can't. GitHub doesn't support PRs to wiki pages, this is a downside of the current approach :|
Should I update anything?

@citizenmatt citizenmatt mentioned this pull request Mar 10, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants