Ledges themselves aren’t marked (as in, the tile next to open air) but trying to step out into the nothingness should be prompting you. As far as I know, this occurs with any t_open_air tile.
I don’t know where you’re falling, but it might be someplace that didn’t use t_open_air. I don’t know enough about it to know why it would be different.
You’d have to look in the mapgen for that particular location and check what they’ve used, and adjust them location by location.