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(set_preview_message): check line height of previewer before setting message #3003

Merged

Conversation

TanglingTreats
Copy link
Contributor

@TanglingTreats TanglingTreats commented Mar 22, 2024

Description

Handles edge case where buffer preview window is of line height 2 or less. Current preview message is at 3 lines long.
The fix adds in a check to handle a line height of 2 or less and shows only the preview message on the first line.

Fixes #3001

Type of change

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

How Has This Been Tested?

Configuration can be referred to in issue #3001.

Testing steps:

  • Navigate to a directory with non-text files
  • Open file browser
  • Navigate selection to non-text file
  • Preview message should be shown on the first line without throwing any errors
Screenshot 2024-03-23 at 10 58 12

Configuration:

  • Neovim version (nvim --version):
    NVIM v0.9.5
    Build type: Release
    LuaJIT 2.1.1710088188
  • Operating system and version:
    macOS 14.4

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)

@jamestrew
Copy link
Contributor

lgtm thanks!

@jamestrew jamestrew merged commit c2b8311 into nvim-telescope:master Mar 24, 2024
6 checks passed
@jamestrew jamestrew added the backport-0.1.x PR to be backported to 0.1.x (Neovim 0.7 compat) label Mar 24, 2024
Conni2461 pushed a commit that referenced this pull request May 20, 2024
* fix(set_preview_message): check line height of previewer before setting message.

* style: run changed file through stylua and remove unused variable.

* refactor: change lines table instead. check max between line_pos and 0

* style: run changed file through stylua.

(cherry picked from commit c2b8311)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-0.1.x PR to be backported to 0.1.x (Neovim 0.7 compat)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'line' is out of range for buffer previewer when previewer height is 2 or less
2 participants