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

Treesitter context is not distinguishable with moonflyNormalFloat enabled #62

Closed
tjkuson opened this issue Jun 24, 2024 · 2 comments
Closed

Comments

@tjkuson
Copy link

tjkuson commented Jun 24, 2024

Hello!

When moonflyNormalFloat is enabled, the Treesitter context is not visually separate from normal text. One solution would be to use a repeated character to separate the context from the rest of the buffer. However, this displaces the text vertically and looks ugly when switching to a different theme (e.g., a light one).

Thanks again for maintaining this project!

Reproduction

Below is a reproduction in case you find it helpful.

local plugins = {
	ts = "https://github.com/nvim-treesitter/nvim-treesitter",
	ts_context = "https://github.com/nvim-treesitter/nvim-treesitter-context",
	moonfly = "https://github.com/bluz71/vim-moonfly-colors",
	catppuccin = "https://github.com/catppuccin/nvim",
}

for name, url in pairs(plugins) do
	local install_path = "/tmp/nvim/site/" .. name
	if vim.fn.isdirectory(install_path) == 0 then
		vim.fn.system({ "git", "clone", "--depth=1", url, install_path })
	end
	vim.o.runtimepath = install_path .. "," .. vim.o.runtimepath
end

vim.g.moonflyNormalFloat = true
vim.cmd([[colorscheme moonfly]])

and then nvim --clean -u minimal.lua into a file with appropriately large structures.

For example, in

Screenshot 2024-06-24 at 10 01 26

the function body looks incorrect upon first inspection. This problem is worse when there are multiple contexts (e.g., a loop in a function in a class).

Adding require("treesitter-context").setup({ separator = "━" }) to minimal.lua adds a helpful separator. However, here is what it looks like with vim.cmd([[colorscheme catppuccin-latte]]).

Screenshot 2024-06-24 at 10 06 54

As you can see, it duplicates catppuccin's line and looks quite distracting.

@bluz71
Copy link
Owner

bluz71 commented Jun 25, 2024

Thanks for bringing this to my attention.

Please update, I believe this is now much improved.

I have copied the catppuccin approach with a subtle underline, and I have also slightly changed the background of the context area to make it more obvious.

Let me know if you have any issues.

@bluz71 bluz71 closed this as completed Jun 25, 2024
@tjkuson
Copy link
Author

tjkuson commented Jun 25, 2024

I just updated and it looks great. Thank you!

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

2 participants