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

feat: Rearrange buffers with mouse drag #113

Merged
merged 5 commits into from
Jun 29, 2023
Merged

feat: Rearrange buffers with mouse drag #113

merged 5 commits into from
Jun 29, 2023

Conversation

willothy
Copy link
Owner

@willothy willothy commented Jun 10, 2023

No description provided.

@willothy willothy linked an issue Jun 10, 2023 that may be closed by this pull request
@willothy willothy changed the title feat: Rearrange tabs with mouse drag feat: Rearrange buffers with mouse drag Jun 10, 2023
@willothy willothy marked this pull request as draft June 10, 2023 02:55
Depends on neovim/neovim##23947
Problem: dragging was glitchy because buffers were sized differently.
Solution: ensure mouse will still be in the dragged buffer before actually moving it.
@willothy willothy marked this pull request as ready for review June 29, 2023 08:58
@willothy willothy merged commit 198dd0a into main Jun 29, 2023
6 checks passed
@willothy willothy deleted the mouse-move branch June 29, 2023 09:01
willothy added a commit that referenced this pull request Jun 29, 2023
@willothy willothy added this to the Release: 0.4.0 milestone Jun 29, 2023
@lucassperez
Copy link
Contributor

Hey, I think this commit causes issues when you're not using neovim nightly 😅 vim.keycode is not available on lastest stable neovim, 0.9.1 )=

Maybe it should be wrapped with a check on vim.keycode?

  local drag = {}
  local mouse_move
  if vim.keycode then
    mouse_move = vim.keycode("<MouseMove>")
    drag = {
      [vim.keycode("<LeftDrag>")] = "l",
      [vim.keycode("<RightDrag>")] = "r",
      [vim.keycode("<MiddleDrag>")] = "m",
    }
  end

Or maybe other solution, but right now it is throwing some errors when opening neovim not nightly

@willothy
Copy link
Owner Author

Hey, I think this commit causes issues when you're not using neovim nightly 😅 vim.keycode is not available on lastest stable neovim, 0.9.1 )=

Or maybe other solution, but right now it is throwing some errors when opening neovim not nightly

Thanks! I checked for on_key but forgot to add a check for keycode. Will push a fix now.

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 this pull request may close these issues.

dragging tabs with mouse?
2 participants