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

Telescope File Browser appears above dressing and dressing UI does not get focus #43

Closed
benfrain opened this issue May 31, 2022 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@benfrain
Copy link

Describe the bug
When using Telescope File Browser the Dressing UI appears behind the Telescope File Browser UI, and doesn't receive focus. Unsure if this problem is Dressing, Telescope File Browser, or my config related — usually it's me but I am just using defaults. :)

Sincere apologies in advance if it turns out to be the latter!

System information

  • OS: mac 12.4
  • Neovim version:
  • NVIM v0.7.0
    Build type: Release
    LuaJIT 2.1.0-beta3
    Compiled by brew@Monterey
  • Is this related to a specific vim.ui.select backend? If so, which one?
  • Dressing config:
use({ "stevearc/dressing.nvim" })

To Reproduce
Steps to reproduce the behavior:

  1. Use Telescope File Browser and duplicate/rename a file
  2. Observe that dressing UI is behind the File Browser and doesn't receive focus

Screenshots

rename.mov
@benfrain benfrain added the bug Something isn't working label May 31, 2022
@stevearc
Copy link
Owner

Not sure what's going on here. I installed telescope file browser to try it out, but it seems to be working fine for me. I could give you a config override that would adjust the z-index and probably fix the over/under rendering, but the bigger issue is the lack of focus and I'm not sure what could be causing that.

The method I've used to debug interactions like this (though I hate it) is to comment out a half of my config, retry, comment out another half, retry, and slowly bisect my way to figuring out what's causing the problem.

@benfrain
Copy link
Author

@stevearc thanks for taking a look. If it also works fine for you I'll try exactly as you describe and strip my config right back and build it up one at a time. I'll close this as you are not able to reproduce but add a comment when I figure out what it causing it. Thanks.

@benfrain
Copy link
Author

Well had a crack at this but none the wiser. Here is the packer config I now have:

local packer_group = vim.api.nvim_create_augroup("Packer", { clear = true })
vim.api.nvim_create_autocmd(
  "BufWritePost",
  { command = "source <afile> | PackerCompile", group = packer_group, pattern = "plugins.lua" }
)

local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
  packer_bootstrap = fn.system({
    "git",
    "clone",
    "--depth",
    "1",
    "https://github.com/wbthomason/packer.nvim",
    install_path,
  })
end
vim.api.nvim_command("packadd packer.nvim")
-- returns the require for use in `config` parameter of packer's use
-- expects the name of the config file
function get_setup(name)
  return string.format('require("setup/%s")', name)
end

return require("packer").startup({
  function(use)
    -- Packer can manage itself
    use({ "wbthomason/packer.nvim" })
    use({
      "nvim-telescope/telescope.nvim",
      module = "telescope",
      cmd = "Telescope",
      requires = {
        { "nvim-lua/plenary.nvim" },
        { "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
      },
      config = get_setup("telescope"),
    })
    use({ "nvim-telescope/telescope-file-browser.nvim" })
    use({ "stevearc/dressing.nvim" })
    if packer_bootstrap then
      require("packer").sync()
    end
  end,
  config = {
    display = {
      open_fn = require("packer.util").float,
    },
    profile = {
      enable = true,
      threshold = 1, -- the amount in ms that a plugins load time must be over for it to be included in the profile
    },
  },
})

And here is my cut down telescope config:

-- Telescope Global remapping
local action_state = require("telescope.actions.state")
local actions = require("telescope.actions")
local fb_actions = require("telescope._extensions.file_browser.actions")

require("telescope").setup({
  defaults = {
    winblend = 20,
    sorting_strategy = "descending",
    layout_strategy = "flex",
    layout_config = {
      flex = {
        flip_columns = 140,
      },
      vertical = {
        preview_cutoff = 40,
        prompt_position = "bottom",
      },
      horizontal = {
        width = 0.9,
        height = 0.8,
      },
    },
    mappings = {
      i = {
        ["<esc>"] = actions.close,
        ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
      },
    },
  },
  extensions = {
    file_browser = {
      theme = "ivy",
      mappings = {
        ["i"] = {
          ["<S-M>"] = fb_actions.move,
        },
      },
    },
  },
  pickers = {
    buffers = {
      sort_lastused = true,
      mappings = {
        i = {
          ["<C-w>"] = "delete_buffer",
        },
        n = {
          ["<C-w>"] = "delete_buffer",
        },
      },
    },
  },
})

require("telescope").load_extension("fzf")
require("telescope").load_extension("file_browser")

And I still see the problem. Wondering if this could be OS specific?? Don't really have much left to cut out.

@stevearc are you on macOS too or Linux/Win?

@stevearc
Copy link
Owner

stevearc commented Jun 1, 2022

When I tested this it was on linux, but I can take another look on my work mac tomorrow. You can try adding

require('dressing').setup({
  input = {
    override = function(conf)
      -- The default is 50. Try bumping it up until it's on top
      -- See :help nvim_open_win for details on zindex
      conf.zindex = 100
    end
  }
})

As mentioned that should fix the overlay rendering issue, but not sure what could be causing the focus problem. I'll try again tomorrow on the mac and see if that helps to replicate it.

@stevearc
Copy link
Owner

stevearc commented Jun 1, 2022

Just tried on the mac, with only the config that you listed here. Still seems to work fine ¯\(ツ)

@benfrain
Copy link
Author

benfrain commented Jun 1, 2022

Bah! Even tried on a different machine and still the same for me. I’m stumped then.

I’ll close this as it must be something particular to my setup i haven’t figured. Thanks again for taking a look.

@benfrain benfrain closed this as completed Jun 1, 2022
@appelgriebsch
Copy link

Stumbled across the same behaviour on my Neovim configuration, esp. when trying to copy or rename files in the file browser of telescope. Anyone made some progress on it already?

@benfrain
Copy link
Author

benfrain commented Jun 8, 2022

Wonder if the terminal used might be relevant? I’m using Kitty, you?

@appelgriebsch
Copy link

iTerm2

@benfrain
Copy link
Author

benfrain commented Jun 8, 2022

Hmm, seems unlikely to be that, then, although curious to know what @stevearc is using on mac?

@stevearc
Copy link
Owner

stevearc commented Jun 8, 2022

I was using Alacritty. I can give it another go with iTerm and see if that changes things

@benfrain
Copy link
Author

benfrain commented Jul 8, 2022

Just to add this is now no longer a problem. I believe there was a problem with the Victor Mono Nerd Font in that the glyphs were not uniform; this was the cause of a different problem I was seeing in Telescope File Browser: nvim-telescope/telescope-file-browser.nvim#157

Since changing font, that, and now this problem have resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants