chlorophyll icon indicating copy to clipboard operation
chlorophyll copied to clipboard

Docstrings sometimes doesn't highlight

Open rdbende opened this issue 2 years ago • 5 comments

@Moosems:

If I have docstrings and I type them in line by line they don't highlight as such but if I paste it in then it is highlighted properly

rdbende avatar Apr 07 '23 15:04 rdbende

This is due to it not rendering all at once because doing that every time an edit is made would be incredibly time expensive. The viewport-only tags may help alleviate the slowness of tagging all but overall could be slower. Tests into this idea will have to be some time. We could also just look for """ but that could lead to a myriad of other bugs.

Moosems avatar Apr 07 '23 17:04 Moosems

Fixed in #20

Moosems avatar Apr 10 '23 21:04 Moosems

Maybe we want to set up something to use highlight_area() when it detects things like this @rdbende. What do you think? This might not be worth the time but its always a bug I can tackle.

Moosems avatar Apr 10 '23 21:04 Moosems

Yes, maybe if it detects a Comment.Multiline or Literal.String.Doc token, it should cleverly look around.

rdbende avatar Apr 10 '23 21:04 rdbende

My worry is if there're multiple docstrings near each other.

Moosems avatar Apr 10 '23 21:04 Moosems