Added text disappears when you scroll


I want to add something like “shadow comment” to a text editor. The idea is the same as Marker but it should be text. The problem is when I scroll the editor, the added text disappears:

How can I implement this functionality? In which side should I look?


Take a look at the pigments package. It does something similar in one of its modes by placing one or more colored dots at the end of a line.


Thanks! Will be trying to understand how it works. This package is quite big, it’s not so easy. I was trying to find smaller package with the same functionality but didn’t find anything.