-
Notifications
You must be signed in to change notification settings - Fork 251
Navigating the Preview Window #672
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
Comments
Personally, I would prefer to move the cursor into the preview window so I could use the full range of movement and search commands. From the neo-tree side it would be simple to add a command that would focus the preview window, which can be mapped to whatever the user wants. I'm not sure if the window might close on you the way it is written now, there may be a small amount of work there to prevent that. Once you are in the preview window, it would be nice to add just two extra mappings:
I'm not sure if there should be extra config options for the preview window mappings or if it would be better to just read the mappings on the Neo-tree window and reuse whatever is mapped to There's also nothing stopping us from also adding scroll commands that work without focusing the window. We can do either one or both. |
I think it'd be better to only provide controls for scroll and not go for full-fledged ones. Otherwise, we'd need to wrestle with variables to ensure the preview window remains read-only. One can always open the file to do search and other operations, and this also aligns with the previewer options that fzf-lua and vim-bqf give. |
@ajitid sounds reasonable, if I can grab a free moment later today, I'm starting with the implementation. Otherwise, I can schedule a few minutes every day in the coming week 👍 |
In the end, I decided to start with the approach also preferred by @cseickel. To name a few reasons for this:
We can extend navigation in the preview window incrementally. A command to scroll in the preview while the tree is focused can still be implemented. |
@ttytm @cseickel the current implementation is problematic in git status mode as for each file that you are reviewing you need to use I believe a better experience would be to either to allow binding |
I made a pull request with default bindings to |
@alexveden thanks! |
So after trying out the preview scroll with I'm using gitsigns to display inline diff within the preview window ( |
As a user, I would like to be able to scroll in a preview window when the contents of a buffer displayed in the preview exceed the height of the preview window.
This could be achieved by extending the command list with scroll-commands (those could behave similar to what Telescope does by default with
<C-d>
<C-u>
) or by adding the ability to move into the preview window (similar to what many "hover" actions do when double pressing the hover key).The text was updated successfully, but these errors were encountered: