git-touch / highlight.dart

Syntax highlighting for Dart and Flutter
https://git-touch.github.io/highlight/
MIT License
232 stars 83 forks source link

feat: selectable text #25

Open shreyas1599 opened 3 years ago

shreyas1599 commented 3 years ago

will close #24 and git-touch/git-touch#204 @pd4d10 is this okay or should it be made a flag for the user to enable?

CubeDr commented 3 years ago

Can this change be merged? I would love to have the highlighted code selectable.

ShiroYacha commented 2 years ago

It would be nice to merge this !

Nirajn2311 commented 1 year ago

Hi, any update on this?

krejko commented 1 year ago

@pd4d10 It seems there are many people who would benefit from this, myself included... would you be able to provide some insight into what's holding up the merge? Thanks!

amake commented 1 year ago

This is not the right way to do this. There are use cases where selectability is not desired.

The consumer of this package should be able to choose whether the text is selectable or not. The way to do that is by replacing RichText with Text.rich (the latter sets up the appropriate selection machinery) or supply appropriate values for selectionRegistrar and selectionColor to RichText. Either of these will let consumers determine selectivity by e.g. wrapping with SelectionArea.