Open zoumi opened 3 years ago
@zoumi
Do you have more details? I'd like to understand what specific steps you are doing, and the platform you are running.
I'm not sure which is happening:
GuiDropCustomHandler
.The steps: 1,Open file1.txt and file2.txt with two split windows. 2,Make file1.txt buffer as the active buffer. 3,Drag file_drop.txt to file2.txt buffer. You can see that file_drop.txt is opened in file1.txt buffer.
OS: Windows 10 64bit NVIM: NVIM v0.6.0-dev+218-g3f526feeb
Thanks for the detailed steps. I wouldn't have guessed this scenario from your original description.
I'm not sure of a good way to fix this?
Unfortunately, neovim-qt
doesn't have any information about window splits or the selected buffer. We're just a dumb rendering canvas that displays a grid of characters. To fix this properly, we would require information internal to nvim
.
One potential idea:
We could trigger a single mouse click event at the drag-drop location before we trigger the open command.
I think that would select the current split before triggering the open, fixing this specific issue.
However, the approach could have side-effects. We'd need to think carefully and test exhaustively. Seems hacky.
Patch: patch.txt
No quite working... The mouse event is processed after the drop is handled. Darn!
We could add a small delay but that is very hacky.
I think that would select the current split before triggering the open, fixing this specific issue. However, the approach could have side-effects. We'd need to think carefully and test exhaustively. Seems hacky.
I don't think this would work if the user has mouse support off. Correct? @jgehrig
@Furkanzmc
Yes. Although if you have disabled mouse support, I would also expect Drag-Drop to be disabled too. (Not currently the case, probably would fix when/if I make these changes).
I was trying to migrate to Neovim Qt from GVim, and I was surprised by the fact that a drag & dropped file didn't open in the buffer that I dropped it in. I don't know how they do it, but this works correctly in GVim.
OS: Windows 10
It's wired that neovim-qt always open file in active buffer window even though I drop the file to another buffer window.