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

completion-menu overlap with cmdline view #134

Closed
ranjithshegde opened this issue Oct 26, 2022 · 8 comments · Fixed by #639
Closed

completion-menu overlap with cmdline view #134

ranjithshegde opened this issue Oct 26, 2022 · 8 comments · Fixed by #639
Labels
bug Something isn't working

Comments

@ranjithshegde
Copy link
Contributor

Describe the bug
Using cmdline view places the popup (not nvim-cmp) completion menu on top of cmdline, Cant see what is being typed
Also, the highlight for the currently selected item from popupmenu is no longer visible

Screenshots
overlap

config

    require('noice').setup {
        cmdline = {
            view = 'cmdline',
            view_search = 'cmdline',
            format = {
                inc_rename = { pattern = '^:%s*IncRename%s+', icon = '', ft = 'text' },
            },
        },
        lsp = { hover = { enabled = true } },
        views = { hover = { border = { style = 'single' } } },
    }
@ranjithshegde ranjithshegde added the bug Something isn't working label Oct 26, 2022
@folke folke closed this as completed in 9102aef Oct 26, 2022
@folke
Copy link
Owner

folke commented Oct 26, 2022

Fixed!

@ranjithshegde
Copy link
Contributor Author

ranjithshegde commented Oct 26, 2022

Thank you for the quick fix!
The highlight for current selection inside the completion popup is still missing. The highlight used to be present.

Is that something I am required to configure manually now?

@folke
Copy link
Owner

folke commented Oct 26, 2022

Highlight works for me. Not sure what the problem is. Can you check with a minimal.lua?
https://github.com/folke/noice.nvim/wiki/Minimal-%60init.lua%60-to-Reproduce-an-Issue

@folke
Copy link
Owner

folke commented Oct 26, 2022

Feel free to open a new issue :)

@ranjithshegde
Copy link
Contributor Author

@folke Is it not a highlight but a cursorline?
I have an autocmd that disables cursorline, when i comment out that autocmd the "highlight" works

@folke
Copy link
Owner

folke commented Oct 27, 2022

Yes! That's it indeed. NuiMenu uses the cursorline for that

@folke
Copy link
Owner

folke commented Oct 27, 2022

If you want to enable/disable the cursorline in active windows, use this:

-- show cursor line only in active window
vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, {
  callback = function()
    local ok, cl = pcall(vim.api.nvim_win_get_var, 0, "auto-cursorline")
    if ok and cl then
      vim.wo.cursorline = true
      vim.api.nvim_win_del_var(0, "auto-cursorline")
    end
  end,
})
vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
  callback = function()
    local cl = vim.wo.cursorline
    if cl then
      vim.api.nvim_win_set_var(0, "auto-cursorline", cl)
      vim.wo.cursorline = false
    end
  end,
})

@ranjithshegde
Copy link
Contributor Author

Thanks! Your method is very straight forward.
Mine was too aggressive with FocusGained FocusLost autocmds added into the mix, + file-match &filetype to selectively disable.

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

Successfully merging a pull request may close this issue.

2 participants