Vencord icon indicating copy to clipboard operation
Vencord copied to clipboard

feat(Plugin): CopyFileContents

Open Obsidianninja11 opened this issue 6 months ago • 0 comments

Adds a button to copy the contents of a text file (even if the text isn't in the tiny preview). After clicking, the copy icon will turn into a checkmark (like in large codeblocks), and the text will be copied to your clipboard. For files over 50kb (50 thousand characters) that don't fully show in the "View whole file" preview, it shows "File too large to copy". I made a version that fetches files that are large, but I don't think that's necessary for 99% of users, and it could lead to problems if a user tries to copy a huge file. This pr also updates the copy icon in components\icons.tsx (because the icon is used in this plugin), as the icon that was in there is long outdated.

Images

image image

A file containing 51kb that is unable to be copied (the first 683 numbers in the fibonacci sequence in this example). image

Obsidianninja11 avatar Aug 18 '24 00:08 Obsidianninja11