minimap.vim icon indicating copy to clipboard operation
minimap.vim copied to clipboard

minimap.nvim breaks the dashboard plugin when g.minimap_auto_start = 1 and g.minimap_close_filetypes = {'dashboard'}

Open AndreAugustoDev opened this issue 4 years ago • 7 comments

Check list

  • [x] I have read through the README (especially F.A.Q section)
  • [x] I have searched through the existing issues

Environment info

  • OS
    • [ ] Linux
    • [ ] Mac OS X
    • [x] Windows
    • [ ] Others:

Version info

NVIM v0.6.0-dev+43-g02bf251bb Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe /DWIN32 /D_WINDOWS /W3 -DNVIM_TS_HAS_SET_MATCH_LIMIT /MD /Zi /O2 /Ob1 /DNDEBUG /W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -D_WIN32_WINNT=0x0600 -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -ID:/a/neovim/neovim/build/config -ID:/a/neovim/neovim/src -ID:/a/neovim/neovim/nvim-deps/usr/include -ID:/a/neovim/neovim/build/src/nvim/auto -ID:/a/neovim/neovim/build/include Compilado por runneradmin@fv-az152-786

Features: -acl +iconv +tui See ":help feature-compile"

arquivo vimrc de sistema: "$VIM\sysinit.vim"
        padrão para $VIM: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info

Question / Problem and steps to reproduce

First of all thanks for this great minimap plugin! I have the minimap.nvim plugin installed and working correctly. I also have the Dashboard plugin set only to use the telescope My configuration is in Lua If I set g.minimap_auto_start = 1 and g.minimap_close_filetypes = {'dashboard'}, when I start nvim and try to use any dashboard menu option, an error occurs and a broken dashboard buffer appears, and if I give an enter to use an option, will open, but always showing errors Error displayed:

Error detected while processing function <SNR>71_call_line_function[4]..dashboard#handler#find_file[1]..dashboard#telescope#find_file:
line 1:
E5108: Error executing lua ...ack\packer\start\plenary.nvim\lua\plenary\popup\init.lua:205: Vim(buffer):E16: Invalid interval: 4buffer
Press ENTER or type a command to continue

With g.minimap_auto_start = 0 or disabled, the dashboard works as expected with g.minimap_close_filetypes = {'dashboard'}, thus having to manually enable the minimap to use

AndreAugustoDev avatar Aug 17 '21 04:08 AndreAugustoDev

Hey there! Thanks for filing a bug, it helps us make Minimap.vim better for everyone.

I think this might have to do with some window weirdness with the two plugins clashing. With g.minimap_auto_start = 1 and g.minimap_close_filetypes = {'dashboard'}, can you start neovim and report back with what each of the commands :echo bufwinnr('-MINIMAP-') and :echo winnr('$') yield? Thanks!

ZNielsen avatar Aug 17 '21 05:08 ZNielsen

Also, just to confirm the filetype, can you check :set filetype? when in Dashboard?

ZNielsen avatar Aug 17 '21 05:08 ZNielsen

Also, just to confirm the filetype, can you check :set filetype? when in Dashboard?

Yes, filetype is dashboard

https://user-images.githubusercontent.com/25272842/129754903-9a201612-06a4-4f4e-bfa4-822f062e6805.mp4

I've added a video here of how the error happens:

https://user-images.githubusercontent.com/25272842/129755316-244395d1-84f9-45a5-92db-c740b28b2334.mp4

And this is a minimal setting I used:

local execute = vim.api.nvim_command
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
  fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path})
  execute 'packadd packer.nvim'
end

require('packer').startup(function()
	use {
		{'wbthomason/packer.nvim', opt = true},    				-- Packer can manage itself
        'nvim-lua/plenary.nvim',                   				-- Plenary
        'nvim-telescope/telescope.nvim',           				-- Telescope
		'wfxr/minimap.vim',										-- Minimap
		'glepnir/dashboard-nvim',								-- Dashboard
    }
end)

vim.g.dashboard_default_executive = 'telescope'

vim.g.minimap_auto_start = 1

vim.g.minimap_close_filetypes = {'dashboard'}

Changing just vim.g.minimap_auto_start to 0 works as expected

https://user-images.githubusercontent.com/25272842/129756466-18864389-1195-45bf-a8ad-068e4658576a.mp4

AndreAugustoDev avatar Aug 17 '21 15:08 AndreAugustoDev

Does the "find file" window have the same filetype (dashboard)? Can you report back with what :echo bufwinnr('-MINIMAP-') and :echo winnr('$') yield on both the main screen and the find files screen?

ZNielsen avatar Aug 17 '21 15:08 ZNielsen

filetype

https://user-images.githubusercontent.com/25272842/129764408-4a37be16-7c7b-4827-8f0d-6eb2fca04dc7.mp4

echo

https://user-images.githubusercontent.com/25272842/129764394-459eece5-72c1-4acd-8b82-2d0fb06e9dbc.mp4

AndreAugustoDev avatar Aug 17 '21 16:08 AndreAugustoDev

Thanks for doing that! Looks like you might need to add TelescopePrompt to your list of g.minimap_close_filetypes.

If that doesn't work, there might be some more info buried in the message log. After the error occurs, can you do a :message so see if there is any more information on the error?

ZNielsen avatar Aug 17 '21 16:08 ZNielsen

Continue in the same way by adding TelescopePrompt to both g.minimap_close_filetypes and g.minimap_block_filetypes

The error message that appears is this:

Error detected while processing function <SNR>29_call_line_function[4]..dashboard#handler#find_file[1]..dashboard#telescope#find_file:
line 1:
E5108: Error executing lua ...ack\packer\start\plenary.nvim\lua\plenary\popup\init.lua:205: Vim(buffer):E16: Invalid interval: 3buffer

Press ENTER or type a command to continue

It seems to be something related to plenary.nvim and Telescope Testing with vim-clap, the ui was not messed up and there were no errors

https://user-images.githubusercontent.com/25272842/129808003-8581659e-cafc-416e-a3aa-3669b1f8600e.mp4

Maybe plenary.nvim has a filetype too... I still need to check this

AndreAugustoDev avatar Aug 17 '21 22:08 AndreAugustoDev