nvim-telescope / telescope.nvim

Find, Filter, Preview, Pick. All lua, all the time.
MIT License
15.8k stars 834 forks source link

`winbar` breaks `get_cursor` theme position #2060

Closed adrigzr closed 2 years ago

adrigzr commented 2 years ago

Description

When winbar is set, in the get_cursor theme the cursor position is over the current line.

With winbar:

Screenshot 2022-07-11 at 09 38 20

Without winbar:

Screenshot 2022-07-11 at 09 38 34

Neovim version

NVIM v0.8.0-dev+2052-g95c65a6b2
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

macOS 12.4

checkhealth telescope

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0
  - OK: fd: found fd 8.4.0

## ===== Installed extensions =====

## Telescope Extension: `dap`
  - INFO: No healthcheck provided

## Telescope Extension: `fzf`
  - INFO: No healthcheck provided

## Telescope Extension: `refactoring`
  - INFO: No healthcheck provided

Steps to reproduce

  1. set winbar=%f
  2. lua require"telescope.builtin".lsp_references(require"telescope.themes".get_cursor())

Expected behavior

The telescope window is open below the current line.

Actual behavior

The telescope window is open over the current line.

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
Conni2461 commented 2 years ago

https://github.com/nvim-telescope/telescope.nvim/pull/2066 should fix your issue