Add support for dropping plain text on Haiku
* haiku-win.el (haiku-dnd-handle-drag-n-drop-event): Handle `text/plain'.
This commit is contained in:
parent
3de3f12b94
commit
79f3d9c8f3
1 changed files with 10 additions and 1 deletions
|
@ -137,7 +137,16 @@ If TYPE is nil, return \"text/plain\"."
|
|||
(dolist (filename (cddr (assoc "refs" string)))
|
||||
(dnd-handle-one-url window 'private
|
||||
(concat "file:" filename)))))
|
||||
(t (message "Don't know how to drop: %s" event)))))
|
||||
((assoc "text/plain" string)
|
||||
(with-selected-window window
|
||||
(raise-frame)
|
||||
(dolist (text (cddr (assoc "text/plain" string)))
|
||||
(goto-char (posn-point (event-start event)))
|
||||
(dnd-insert-text window 'private
|
||||
(if (multibyte-string-p text)
|
||||
text
|
||||
(decode-coding-string text 'undecided))))))
|
||||
(t (message "Don't know how to drop any of: %s" (mapcar #'car string))))))
|
||||
|
||||
(define-key special-event-map [drag-n-drop]
|
||||
'haiku-dnd-handle-drag-n-drop-event)
|
||||
|
|
Loading…
Add table
Reference in a new issue