I don't think that there is a medical or layman term for that kind of situation. However, I must say that that example is under the category of specific phobia- an irrational fear of an object or a situation.
But according from the example you gave, there is a French word that best describes the eerie feeling to jump.
L'appel du vide well known as "the call of the void" specifically refers to that feeling you get when you're at the top of a tall cliff and consider jumping off. It can be
considered a form of self destructive ideation. It's actually fairly
anxiety provoking for most people to be in that kind of a situation,
one in which you are quite literally a step away from death.
Medically speaking, it is not a phobia because it does not fall in numerous types of phobia. However, according to a book entitled Videbeck Psychiatric Mental health Nursing 2nd edition it states that,
"A phobia is an illogical, intense, persistent fear of a specific object or a social situation that causes extreme distress and interferes with
normal functioning. People with phobias understand that their fear is
unusual and irrational..."
Therefore, it may fall as another example of specific phobia. Furthermore, l'appel du vide is actually an untranslatable word so it has no equal English translation.
I might as well add that the given examples above resembles of a phobia and not of a symptom of Obsessive-Compulsive Disorder.
"Obsessions are recurrent, persistent, intrusive, and unwanted
impulses that cause marked anxiety. Compulsions are ritualistic or
repetitive behaviors or mental acts that a person carries out
continuously in an attempt to neutralize anxiety." Videbeck (2nd
The definition itself tells that a person will be diagnosed with OCD if there are persistent and unwanted thoughts. And to neutralize the anxiety there must be a repetitive action or behavior like washing of hands every minute to prevent any microbial contamination. The situation given by the user who posted this question has no repetitive behavior. It just only shows that there is an irrational fear or unexplained urge to jump in high places.
Book source: Videbeck, S. (2003). Psychiatric mental health nursing (2nd ed.). Lippincott Williams and Wilkins: PA.