Repository navigation
add stable keyboard scrolling to vim floating preview popups - #5114
coriocactus wants to merge 1 commit into
Conversation
80f3c87 to
dd89b90
Compare
dd89b90 to
3d67758
Compare
There was a problem hiding this comment.
Pull request overview
Adds keyboard (and mouse wheel) scrolling support for Vim popupwin-based floating preview windows in ALE, plus sizing stabilization to prevent resize jitter while scrolling. NeoVim floating previews are unchanged.
Changes:
- Introduces a Vim popup
filter(normal-mode filtermode) to handle<C-n>/<C-p>,<C-d>/<C-u>, mouse wheel, and<Esc>for floating preview popups. - Adds “managed” width/height locking for Vim popups when users haven’t provided explicit size limits.
- Adds a new Vader test suite covering scrolling behavior, boundary clamping, closing on escape, passthrough keys, and size locking; updates docs accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
autoload/ale/floating_preview.vim |
Implements popup filter, scroll/clamp logic, and managed size locking/reset for Vim popup previews. |
doc/ale.txt |
Documents the new scrolling keys and sizing behavior for Vim popup previews and how to override the filter. |
test/test_floating_preview_popupwin.vader |
Adds coverage for popup filter behavior, scroll boundaries, escape close, and size stability during scrolling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I'll paste this in every open PR: We finally managed to migrate CI checks for Windows from AppVeyor to GitHub Actions, and we've updated the minimum supported Vim version to 8.2. (Thought Vim 8.0 might happen to work for some.) In order to get checks to run again for a PR you'll need to rebase or merge. |
e514c40 to
3ad02af
Compare
39ff78d to
df9465f
Compare
|
How to try out this pull-request:
mkdir pr5114
cd pr5114/
cargo init
fn main() {
let x = 42;
let y: String = x;
}
|
Adding to this, I've also had a read-through of the actual diff and find it looking reasonable enough. My recommendation to @hsanson is to merge this. |
df9465f to
df8cd90
Compare
Yesterday's force-push was a clean rebase without new changes. Thus my recommendation for @hsanson remains to merge this. |
Vim floating previews (
ALEHover,ALEDetail) have no keyboard scrolling, andmoved: 'any'closes the popup on any cursor motion.This adds a Normal-mode popup filter for Vim floating previews:
CTRL-E/CTRL-Y(line),CTRL-D/CTRL-U(half-page), andCTRL-F/CTRL-B(page) scroll the popup when its text overflows, and pass through when everything fits.<Esc>closes the popup.filtering:ale_floating_preview_popup_optsstill overrides the default filter.Notes:
CTRL-D/CTRL-Uviawin_execute(), which stops cleanly at buffer bounds (including wrapped lines) without shrinking the popup, followed byredrawto prevent wrapped-line overscroll on Vim 8.2 when keys arrive faster than redraws.minwidthis pinned to the widest line unlessminwidthormaxwidthis set ing:ale_floating_preview_popup_opts.