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

[Feature]: expose and allow wrapping telescope_ui_select() #8

Open
rebelot opened this issue Apr 23, 2022 · 4 comments
Open

[Feature]: expose and allow wrapping telescope_ui_select() #8

rebelot opened this issue Apr 23, 2022 · 4 comments

Comments

@rebelot
Copy link

rebelot commented Apr 23, 2022

It would be great to have the opportunity to wrap https://github.com/nvim-telescope/telescope-ui-select.nvim/blob/master/lua/telescope/_extensions/ui-select.lua#L13 into a user-defined function, so that users can run arbitrary checks to infer who is the caller of vim.ui.select and set picker layout / theme / options accordingly.

eg:

vim.ui.select = function(items, opts, on_choice)
    if opts.kind and opts.kind == "codeaction" then
        tops = require'telescope.themes'.get_cursor()
    end
    require'telescope'.extensions.telescope_ui_select.telescope_ui_select(items, opts, on_choice, tops or {})
end
@Conni2461
Copy link
Member

I finish up #7 after that we can do that

@yetone
Copy link

yetone commented Apr 28, 2022

@Conni2461 Sorry, I've looked at the PR #7 code and still can't figure out how to set a separate theme for codeaction

@Conni2461
Copy link
Member

I said that i'll implement this feature request after #7 is done. I most likely will find some time for it tomorrow. Currently you can still set a global theme for all vim.ui.select calls:

https://github.com/nvim-telescope/telescope-ui-select.nvim#telescope-setup-and-configuration

just put this in your config

require("telescope").setup {
  -- ...
  extensions = {
    -- ...
    ["ui-select"] = {
      require("telescope.themes").get_dropdown {
        -- even more opts
      }
    }  
  }
}

@devansh08
Copy link

@Conni2461 anything new on this feature ? Or if there is any other way to achieve this now ?

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

No branches or pull requests

4 participants