Adding placeholder on active line if active line is empty

Hello, I looked at the placeholder extension for CM6. But it only works if the whole editor is empty. I am trying to design an experience where the placeholder is shown on the active line if that active line is empty. I think I can do this using line widgets but it’s a lot of hacking to constantly add and remove that widget based on cursor activity. Could there be a simpler way to do this? Any ideas will be appreciated, thank you!

Doing sometime similar to the placeholder extension, but with different logic to check per line whether it is empty, seems like the way to go.

1 Like

Nice, copied the placeholder code and updated it for my use case - it worked, Thanks for the pointer.