Add option to remove deleted text when copying#363
Add option to remove deleted text when copying#363WinslowJosiah wants to merge 1 commit intoexpressive-code:mainfrom
Conversation
✅ Deploy Preview for expressive-code ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| /* Disallow selection of deleted text */ | ||
| user-select: none; | ||
| -webkit-user-select: none; | ||
| }` |
There was a problem hiding this comment.
Personally I think selecting deleted lines is sometimes pretty useful and would be very frustrating if it then doesn't work only on those lines. However, if I select all lines or at least multiple ones over different types of diffs, then I agree that such a feature would be useful, but way harder than just with CSS...
There was a problem hiding this comment.
Sure, so perhaps this can be configurable as well?
There was a problem hiding this comment.
Yeah, maybe we create some dedicated option for that, eg preventSelectingDeletedText or we might leave this out completely. I'm not sure how desired such a feature is, personally I would be more than happy enough with just the change when clicking the copy button.
|
In general, I really like the changes and this feature. Just a little nitpick regarding the naming of the option: maybe something like |
Agreed, naming things is hard. But this doesn't only apply if the language of the block is |
Oh, thanks for clarifying, I totally missed this (I wonder how I could have missed that now 😅), then the names are really well suited 🙌 |
Fixes #314.
Adds a new
removeDeletedTextWhenCopyingoption to remove text marked as "deleted" when copying. This option is false by default for backwards-compatibility.If
removeDeletedTextWhenCopyingis true, any lines or segments of code that are marked as deleted using theplugin-text-markersplugin are not included when copied to the clipboard. This will also disallow the selection of said deleted lines or segments.