mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-13 12:08:45 +02:00
Drag source delete on drop should only be done for remote drops
This commit is contained in:
@@ -230,11 +230,12 @@ func (dnd *dnd) on_drag_event(x, y, operation, Y int) (err error) {
|
||||
case 4:
|
||||
was_dropped := dnd.drag_status.dropped
|
||||
was_move := dnd.drag_status.accepted_operation == 2
|
||||
was_remote := dnd.drag_status.remote_data_was_sent
|
||||
dnd.reset_drag()
|
||||
if was_dropped && dnd.has_exit_on("drag-finish") {
|
||||
dnd.lp.Quit(0)
|
||||
}
|
||||
if was_dropped && was_move {
|
||||
if was_dropped && was_move && was_remote {
|
||||
if ds := dnd.drag_sources["text/uri-list"]; ds != nil {
|
||||
for _, item := range ds.uri_list {
|
||||
if item.metadata.IsDir() {
|
||||
|
||||
@@ -69,7 +69,8 @@ They will be dragged as the text/uri-list MIME type which can then be dropped in
|
||||
file manager or similar program to copy the files.
|
||||
|
||||
If the text/uri-list MIME type is dropped onto this window, the files and directories in it are
|
||||
copied into the current working directory.
|
||||
copied into the current working directory. When dragging from this window, if a move operation is
|
||||
performed when dropping and the drop is to a remote machine, the files and directories to drag and deleted.
|
||||
|
||||
If data is present on STDIN it is set as text/plain when dragging, unless text/plain is specified via --drag.
|
||||
Any text/plain data that is dropped onto this window is output to STDOUT, if STDOUT is connected to a file, otherwise it
|
||||
|
||||
Reference in New Issue
Block a user