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

[WIP] Add minimap #220

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

[WIP] Add minimap #220

wants to merge 11 commits into from

Conversation

smolck
Copy link
Owner

@smolck smolck commented May 10, 2021

Just an MVP for now, still need to make it show where the cursor is, scroll with the buffer (if necessary), also need to tweak colors/figure that out, etc.

Note that ATM it requires a tree-sitter parser/nvim-treesitter in order to be used at all; plan is to make it such that it'll work w/out a tree-sitter parser/nvim-treesitter, but have no syntax highlighting.

In any case, if you want to test open up a file (for which you have a tree-sitter parser installed that supports syntax highlighting), and then run :lua require'uivonim/minimap'.show(). Here's how it looks in its current (and very very subject to change) form:

Should close #194.

@smolck smolck added enhancement New feature or request gui Bugs or enhancement related to GUI elements labels May 10, 2021
@smolck
Copy link
Owner Author

smolck commented May 10, 2021

TODO: Separate minimaps for each (non-floating) window.

@smolck
Copy link
Owner Author

smolck commented May 28, 2021

So quick update: the performance of this isn't good enough to where I'd call it usable, due to the initial tree-sitter parsing of a file taking too much time. With this minimap enabled, unless you're opening a file with 100-400 (ish?) lines, it's not the best experience.

The only way I can think to get around this is to do the file parsing in a separate [luv, vim.loop] thread, but that's not currently possible since the vim.treesitter things aren't exposed to threads. It shouldn't be terribly difficult to expose those though based on some testing I did, but it would/will take some work (in an upstream PR to neovim), so this'll probably sit for a while.

The alternative to this is to just do what Goneovim does, run a separate nvim instance solely for the minimap, but I'm not a huge fan of that method personally, so I'd like to go this route (or a similar one?) if at all possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gui Bugs or enhancement related to GUI elements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minimap
1 participant