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: terminal buffer previews not initially scrolled #2899

Conversation

rjooske
Copy link
Contributor

@rjooske rjooske commented Jan 27, 2024

Description

When you preview a terminal buffer for the first time after :Telescope buffers, the preview is not scrolled to and centered to the line the cursor is on, unlike normal buffers that have a file associated with them.
This PR fixes the issue so that the preview for a terminal buffer is correctly scrolled.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Steps to reproduce the issue

  1. Start neovim
  2. Create a terminal buffer (:terminal) and inside it, run seq 1000 (or something else that produces lots of lines)
  3. Open a random file
  4. Run :Telescope buffers
  • The first time you preview the terminal buffer, the preview is not scrolled to the line the cursor is on.
  • Preview the other entry (the file you opened) and preview the terminal buffer again. Now the preview is correctly scrolled.
  • After this PR is applied, the preview is correctly scrolled from the first time on.

Configuration:

  • Neovim version (nvim --version):
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1692716794
  • Operating system and version: Ubuntu 22.04 (inside docker container)

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

Copy link
Contributor

@jamestrew jamestrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The steps to reproduce was very helpful too :)

@jamestrew jamestrew merged commit e54fbf4 into nvim-telescope:master Jan 29, 2024
6 checks passed
Conni2461 pushed a commit that referenced this pull request Mar 11, 2024
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