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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: implement drag and drop of text into kitty #1921

merged 1 commit into from Aug 24, 2019


Copy link

@Luflosi Luflosi commented Aug 23, 2019

Closes #1368.
Since two people asked for this feature and I agree that this would be nice to have, I implemented it.

Is calling _glfwInputDrop() for dropped text the right thing to do?
I also thought about adding a flags parameter to _glfwInputDrop() to signal if a string was a file URL or normal text. But since it's possible that the array of strings contains both types, I didn't do that. I would have to add this information to every string individually.
Is calling _glfwInputError() in the else case the right thing to do or can you think of a better solution? This code should never be called but I just want to make sure nothing bad can happen.
I'm not sure which convention to follow regarding the curly braces. GLFW seems to have them in new lines but your code seems to not do that. Just tell me if you would like me to change something regarding the curly braces.

This took me waaay too many hours to implement 馃槄.

Copy link

Using glfwinputerror is fine. As for calling glfwinputdrop ideally we
should change the signature of the function to add information about the
kind of strings url/text, but at the moment, since kitty makes no use
of that information, it is OK to leave it as is.

Copy link

And note this does not really close #1368 since that is requesting the ability to drag text from within kitty as well, which is the painful part to implement.

@kovidgoyal kovidgoyal merged commit 06c2263 into kovidgoyal:master Aug 24, 2019
@Luflosi Luflosi deleted the drag_and_drop_text branch August 24, 2019 06:41
Copy link
Contributor Author

Luflosi commented Aug 24, 2019

You're right, I only implemented half of the feature request. I won't try implementing the other half because it's not easy as you mentioned and I don't think it's not worth the effort.

@Luflosi Luflosi mentioned this pull request Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

Support drag and drop for text
2 participants