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

Feature request: Mousewheeel support #49

Closed
Zeioth opened this issue Apr 24, 2024 · 7 comments · Fixed by #51
Closed

Feature request: Mousewheeel support #49

Zeioth opened this issue Apr 24, 2024 · 7 comments · Fixed by #51

Comments

@Zeioth
Copy link
Contributor

Zeioth commented Apr 24, 2024

Back in the day I implemented this in rnvimr and implementing the same feature here would be trivial.

  • The only thing necessary for this to work is disabling mouse support while on the yazi.nvim window.
  • And re-enabing it when leaving the window.

You can check my PR as reference:
kevinhwang91/rnvimr#58 (comment)

@mikavilpas
Copy link
Owner

Thanks for the idea!

How is yazi mouse support for you without neovim? My experience has been less than optimal, but I have some trackpad and it may complicate things.

I notice your implementation had some extra logic for tmux. Does this complicate things?

@Zeioth
Copy link
Contributor Author

Zeioth commented Apr 25, 2024

@mikavilpas The main mouse feature is covered in the snippet above.

Yazi still lack a few important mouse features I had back in ranger.

  • Scroll preview with mousewheeel.
  • Ability to click an item.

Personally I use a programmable keyboard with a trackball and this is x300 user experience for me.

@mikavilpas
Copy link
Owner

@mikavilpas The main mouse feature is covered here: "Beign able to scroll the list with the mousewheeel".

was this supposed to include a link? I'm curious to read more but don't know where to go 🙂


Anyway, I think this is a cool idea so I'll try to implement it, perhaps as optional at first so we can try it out.

@Zeioth
Copy link
Contributor Author

Zeioth commented Apr 25, 2024

Ok it's a pretty straighforward copy paste. To be honest I would PR it myself, but I'm full for a few days. So whoever go it faster :3

@mikavilpas
Copy link
Owner

Ok there's now a "soft launch" in the main branch. You need to opt in to this feature like this mikavilpas/dotfiles@f7aff2b

Let me know how it works for you.

@Zeioth
Copy link
Contributor Author

Zeioth commented Apr 25, 2024

I can confirm it works. Thank you so much for adding it so fast!! 🎉🎉

mikavilpas added a commit that referenced this issue Apr 26, 2024
...from a yazi session. It seemed to close the window twice, which
caused some issues (not sure why).

Looks like this was accidentally broken when I added experimental
support for scrolling in
#49

Should be fixed now.
mikavilpas added a commit that referenced this issue Apr 26, 2024
...from a yazi session. It seemed to close the window twice, which
caused some issues (not sure why).

Looks like this was accidentally broken when I added experimental
support for scrolling in
#49

Should be fixed now.
@mikavilpas
Copy link
Owner

@Zeioth much better mouse support was merged into yazi an hour or so ago sxyazi/yazi#1038

If you're able to build from source (I use cargo install --path yazi-fm to do this), you might get much better mouse support. Also remember to turn off our "hacky" setting if you try it out:

diff --git a/.config/nvim/lua/plugins/my-file-manager.lua b/.config/nvim/lua/plugins/my-file-manager.lua
index bb70be8..8d278c6 100644
--- a/.config/nvim/lua/plugins/my-file-manager.lua
+++ b/.config/nvim/lua/plugins/my-file-manager.lua

@@ -27,7 +27,6 @@ return {
     ---@type YaziConfig
     opts = {
       open_for_directories = true,
-      enable_mouse_support = true,
       -- log_level = vim.log.levels.DEBUG,
       integrations = {
         grep_in_directory = function(directory)

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

Successfully merging a pull request may close this issue.

2 participants