-
Notifications
You must be signed in to change notification settings - Fork 755
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
Fixes for scrolling #252
Fixes for scrolling #252
Conversation
Now very closely follows Vim's somewhat unintuitive handling. Doesn't work properly with soft wraps (like a lot of other parts of IdeaVim)
Behaviour matches Vim, apart from soft wraps
i_<C-Down> and i_<C-Up> are not standard Vim mappings, but can be set up in .ideavimrc if required
z<CR> and zt
<C-D> and <C-U>
E.g. navigation around Kotlin type annotations, replacing a character with a preceding parameter hint
Fixes VIM-1556, fixes VIM-1770, fixes VIM-2110
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this is a giant PR, just awesome! This is great that IdeaVim would have much less issues with inline hints :)
I'm actually ready to merge it.
Now that virtual space is working, shall we enable it for all Vim-enabled editors? This would match Vim behaviour, but might be a little intrusive, so we could also add an option to disable it (it would be on by default to match Vim)
Do you mean that now we can automatically enable IJ "virtual space" setting, right?
Yeah, apologies for the size of the PR, it just kept on growing 😄 Horizontal scrolling touches a lot of places and it took a lot of new tests to make sure it was done. As for virtual space, yes, I mean that we can now enable IJ's virtual space - both the "Show virtual space at the bottom of the file" option, and the "Allow caret placement after the end of line". This would give us behaviour in line with Vim. It would also allow us to implement the other My only concern is if it's too big a change for the user - we'd be overriding the settings, so there's no way to disable this. Perhaps we should add an Whatever the answer, it should go in a separate PR 😁 |
No, it's absolutely fine. And I like the test coverage, sometimes contributors skip it :) Okay, I get what you mean about virtual space. Yes, let's start with this PR and deal with virtual space later. |
This PR introduces a number of fixes for scrolling, primarily for support of inline inlays, such as a parameter hints.
scrolloff
instead ofsidescrolloff
is used for horizontal offsetscrolljump
not workingscrolljump
to match Vim's fairly unintuitive rulessidescrolloff
andsidescroll
(jump). Leading and trailing inlays are correctly positioned when scrolling offscreen.zL
/zH
)Added tests:
scrolloff
andscrolljump
<C-Y>
/<C-E>
)<C-B>
/<C-F>
)z+
/z^
)zt
/zb
/zz
+z<CR>
/z-
/z.
)<C-U>
/<C-D>
)zs
/ze
)zl
/zh
)X
/x
)Known issues:
<C-F>
at the end of file doesn't scroll up), but it at least behaves sensiblyQuestions: