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

[bug]: about the mouse drag #207

Open
FlameTornado10 opened this issue Jun 8, 2024 · 2 comments
Open

[bug]: about the mouse drag #207

FlameTornado10 opened this issue Jun 8, 2024 · 2 comments

Comments

@FlameTornado10
Copy link

When first drag a random buffer, the reordering works fine. But after one successful reordering, if I choose to drag another buffer, the one that get reordered is not the one I choose latest, but the one that get reordered before. See as this file.
Screen Recording - Made with FlexClip.webm

@FlameTornado10
Copy link
Author

This one is clearer.
second_video.webm

@FlameTornado10
Copy link
Author

Also, I check the code about mouse drag and figure out one way to handle this.
in the function on_drag in nvim-cokeline/lua/cokerline/hover.lua,
change

    if M.dragging() == current.bufnr or not M.dragging() then
      M.set_dragging(current.bufnr)
      return
    end

    -- dragged buffer
    local dragged_buf = buffers.get_buffer(M.dragging())

to

    if M.dragging() == current.bufnr or not M.dragging() then
      M.set_dragging(vim.api.nvim_get_current_buf())
      return
    end

    -- dragged buffer
    local dragged_buf = buffers.get_buffer(vim.api.nvim_get_current_buf())

seems to eliminate this bug.

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

1 participant