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

mouse highlighting #13

Closed
tommyshem opened this issue Nov 22, 2017 · 2 comments
Closed

mouse highlighting #13

tommyshem opened this issue Nov 22, 2017 · 2 comments
Labels

Comments

@tommyshem
Copy link

tommyshem commented Nov 22, 2017

When picking a directory with the mouse it highlights files and directorys when it should not.
This is on Linux gnome terminal.
Micro editor v1.3.3

@tommyshem tommyshem added the bug label Nov 23, 2017
@sum01
Copy link
Collaborator

sum01 commented Nov 24, 2017

Instead of highlighting the line, like in https://github.com/NicolaiSoeborg/filemanager-plugin/blob/master/filemanager.lua#L79-L80

list could be made "global" by puting it at the top of the plugin. Then you get treeView.Buf.Cursor.Loc.Y and put that into list[y_loc + 1] (+1 because it returns a zero-based index from Go, while Lua uses one-based indicies) to get the selection without visually selecting anything.

I already tested this and it works, but there's a small visual bug where after the click, it hightlings where your mouse was. The only solution I can think of to fix that is to change the refreshTree to only run after MouseUp, if that's possible.

@sum01
Copy link
Collaborator

sum01 commented Nov 24, 2017

Oh, found a possible solution for that. After a refresh we can do https://github.com/zyedidia/micro/blob/master/cmd/micro/cursor.go#L48-L49 to remove any highlighting caused by a percieved mouse drag.

@sum01 sum01 mentioned this issue Dec 28, 2017
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants