alpha-nvim
alpha-nvim copied to clipboard
Incompatibility with `telescope-ui-select.nvim`
I've set up alpha-nvim to work along with Shatur/neovim-session-manager which, in turn, makes use of telescope-ui-select.nvim to handle vim.ui.select with telescope. Whenever I try to select a session in a bare neovim command, alpha-nvim wrongly alert me that the current session have change.
How to reproduce
- save this file as
minimal_init.luarequire("packer").startup{function () use 'wbthomason/packer.nvim' use 'nvim-lua/plenary.nvim' use 'nvim-telescope/telescope.nvim' use {'nvim-telescope/telescope-ui-select.nvim', requires = 'nvim-telescope/telescope.nvim'} use 'Shatur/neovim-session-manager' use { 'goolord/alpha-nvim', config = function () require'alpha'.setup(require'alpha.themes.dashboard'.config) end } end } -- section manager config local Path = require('plenary.path') require('session_manager').setup({ sessions_dir = Path:new(vim.fn.stdpath('data'), 'sessions'), -- The directory where the session files will be saved. path_replacer = '__', -- The character to which the path separator will be replaced for session files. colon_replacer = '++', -- The character to which the colon symbol will be replaced for session files. autoload_mode = require('session_manager.config').AutoloadMode.Disabled, -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession autosave_last_session = true, -- Automatically save last session on exit and on session switch. autosave_ignore_not_normal = true, -- Plugin will not save a session when no buffers are opened, or all of them aren't writable or listed. autosave_ignore_filetypes = { -- All buffers of these file types will be closed before the session is saved. 'gitcommit', }, autosave_only_in_session = false, -- Always autosaves session. If true, only autosaves after a session is active. max_path_length = 80, -- Shorten the display path if length exceeds this threshold. Use 0 if don't want to shorten the path at all. }) require("telescope").setup { extensions = { ["ui-select"] = { require("telescope.themes").get_dropdown {} } } } -- load_extension require("telescope").load_extension("ui-select") - run
nvim -u minimal_init.lua :SessionManager load_session(you should have a session saved, of course. If you don't, just run:SessionManager save_current session)- Select any session.
You will see this behavior:

Expected behavior
alpha-nvim should go to session directly.
... I don't really know what's going on here but alpha doesn't touch sessions at all. i use neovim-session-manager without telescope-ui-select.nvim and it works fine. I can try to dig around and see what's up with this though
but alpha doesn't touch sessions at all.
This statement might be true but that's not where the problem probably lies. It seems that alpha-nvim are seeing a modified unsaved buffer, when actually there isn't anything...
i use neovim-session-manager without telescope-ui-select.nvim and it works fine
Yeah, this is right, I can reproduce the same here. It works fine without telescope-ui-select.nvim
I can try to dig around and see what's up with this though
I can do it as soon as I have a free time, which is quite hard nowadays :cold_sweat:
yea you can't display text without creating a buffer. since the buffer type is nofile i would surmise it wouldn't effect the session
A bit of a shot in the dark, but try calling the telescope-ui-select callback using vim.schedule
... I don't really know what's going on here but alpha doesn't touch sessions at all. i use neovim-session-manager without telescope-ui-select.nvim and it works fine. I can try to dig around and see what's up with this though
I'm trying to get this setup to work for me, i.e., alpha-nvim + neovim-sessions-manager. When I enter the command SessionManager load_session from the start screen it works great. However, I've also added the following button which does not work:
dashboard.button("l", "Load session", ":SessionManager load_session <CR>"),
Instead, when I hit l for 'Load session' I get: "No such subcommand: load_sessions". I must be missing something small as it seems that it is close to working. Any help would be greatly appreciated.
the error message says "No such subcommand: load_sessions"? or is that a typo only present in your comment
Yes my typo. It is in fact singular.
@benbrastmckie i finally figured out what your bug is. there is a space here load_session <CR> that's getting parsed as the session name " " by that plugin. just remove the space and your button should work 👍
@tapyu is this still a problem for you? i'm using these plugins in this way with no problems
Hey sorry for the slow reply. I got it working just great. Thanks for the help!