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

BUG: ignored_filetypes not work for alpha-nvim #13

Open
adoyle-h opened this issue Aug 23, 2024 · 0 comments
Open

BUG: ignored_filetypes not work for alpha-nvim #13

adoyle-h opened this issue Aug 23, 2024 · 0 comments

Comments

@adoyle-h
Copy link

Description

Even with ignored_filetypes = { 'alpha' }, the whitespace.nvim still highlight the whitespaces in alpha buffer.

With whitespace.nvim latest version and commit 21dfe34, it shows that

2024-08-23_17 34 25@2x

With commit 406cd69, it works well.

2024-08-23_17 37 13@2x

So I think this bug was introduced in 21dfe34

Reproduce

  1. Create a file 'repro.lua'
-- **DO NOT change the paths and don't remove the colorscheme**
local root = vim.fn.fnamemodify('./.repro', ':p')

-- set stdpaths to use .repro
for _, name in ipairs({ 'config', 'data', 'state', 'cache' }) do
	vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end

-- bootstrap lazy
local lazypath = root .. '/plugins/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({ 'git', 'clone', '--filter=blob:none', 'https://github.com/folke/lazy.nvim.git', lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

vim.cmd.color 'elflord'
--------------------------------------------------------------------------------
local plugins = {

	{
    'goolord/alpha-nvim',
    config = function ()
			local logo = {
				[[                               __                ]],
				[[  ___     ___    ___   __  __ /\_\    ___ ___    ]],
				[[ / _ `\  / __`\ / __`\/\ \/\ \\/\ \  / __` __`\  ]],
				[[/\ \/\ \/\  __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
				[[\ \_\ \_\ \____\ \____/\ \___/  \ \_\ \_\ \_\ \_\]],
				[[ \/_/\/_/\/____/\/___/  \/__/    \/_/\/_/\/_/\/_/]],
			}

			require'alpha'.setup {
				layout =  { { type = 'text', val = logo , opts = { position = 'center'} } },
				opts = { noautocmd = true },
			}
    end
	},
	{
    'johnfrankmorgan/whitespace.nvim',
	# commit = '21dfe3478dced70327d2b08d0b84daec5ebf3610',  -- this commit has problem
    # commit = '406cd69216dd7847b0cb38486603a8ed5c4f8c77',  -- this commit has no problem
    config = function ()
        require('whitespace-nvim').setup({
            -- configuration options and their defaults

            -- `highlight` configures which highlight is used to display
            -- trailing whitespace
            highlight = 'DiffDelete',

            -- `ignored_filetypes` configures which filetypes to ignore when
            -- displaying trailing whitespace
            ignored_filetypes = { 'alpha' },

            -- `ignore_terminal` configures whether to ignore terminal buffers
            ignore_terminal = true,

            -- `return_cursor` configures if cursor should return to previous
            -- position after trimming whitespace
            return_cursor = true,
        })
    end
	},

}

require('lazy').setup(plugins, {
	root = root .. '/plugins',
})
  1. nvim -u ./repro.lua it will auto download plugins on current directory.
  2. set ft shows the filetype of current buffer is alpha
adoyle-h added a commit to adoyle-h/one.nvim that referenced this issue Aug 23, 2024
adoyle-h added a commit to adoyle-h/one.nvim that referenced this issue Aug 23, 2024
adoyle-h added a commit to adoyle-h/one.nvim that referenced this issue Aug 23, 2024
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

1 participant