Description
I've noticed that within IDEA IDEs (I've noticed this on both IntelliJ and PyCharm so far), underscores seem to be disappearing in what appears to be an issue related to how IDEA handles redraw regions for the caret's current line.
Note in the following screenshot how the caret's current line is highlighted, and the underscores are visible:
Hack is designed such that underscores appear on the top-most pixels of the next line down. When the caret is moved down to the next line, the line highlighting follows it, and the underscores disappear:
What I suspect is happening is that IDEA is redrawing the current line after the caret moves down, (firstly the background to remove the line highlighting, then the text), but is NOT redrawing the line above. The result is that due to the underscores of the above line being within the redraw region of the current (highlighted) line, they get removed when the current line's background is redrawn to remove its highlighting.