Skip to content

Commit 9367824

Browse files
committed
feat: now when file tab dropped in any input or editor then it inserts path
1 parent c8ae720 commit 9367824

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/handlers/editorFileTab.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,21 @@ function releaseDrag(e) {
198198
}
199199
updateFileList($parent);
200200
}
201+
} else if (
202+
$target.tagName === "INPUT" ||
203+
$target.tagName === "TEXTAREA" ||
204+
$target.classList.contains("ace_text-input") ||
205+
$target.closest(".ace_editor")
206+
) {
207+
// If released on an input area or ace editor
208+
const filePath = editorManager.activeFile.uri;
209+
if (filePath) {
210+
if ($target.closest(".ace_editor")) {
211+
editorManager.editor.insert(filePath);
212+
} else {
213+
$target.value += filePath;
214+
}
215+
}
201216
}
202217

203218
cancelAnimationFrame(animationFrame);

0 commit comments

Comments
 (0)