YEP Extended Message Pack 1 - Strange Glitch

http://yanfly.moe/2016/01/30/yep-65-extended-message-pack-1/

Hello RPG Maker Forums!

Yanfly's Extended Message Pack 1 is an extremely useful tool (Especially so for my text-based game). It allows the option of hiding choices (Attached to switches, for instance I can check a character's Strength score to see if they have a certain option).

There is a bit of a strange bug with it, however.
V0mvnb6.png

Note in the above picture how the "Mind Bend" spell has a really long string of words, causing the entire highlight bar to extend outward by a lot. This isn't a problem on its own.

However...
a42Wk4R.png

Even when the choice is hidden, the highlight bar still extends as far as the longest string of words, even if that string happens to be hidden. In this version, the "Kill Spell" and "Mind Bend" spell are hidden as per the Yanfly plugin, however, the bar still stretches really far, as if the choice is still there.

Do you guys know of a way to fix this YEP plugin glitch?
Also, if there's a way to center text within choices, I'd like to know that too. I know it isn't a JS request but I'm just curious, while on the topic of choices.
Please help
Just to set things straight: it isn't a bug. It's the normal way choices work and has nothing to do with yanfly's plugins.
The rectangle is drawn the size of the largest choice in the choice list window by default in the engine.

That said, try this:
It should do both things: center the text choice and draw the text rectangle no longer than needed for the current choice.
Just paste it, save as a .js and name it whatever.

Here's a screenshot:
Spoiler
vkJIWL4.png
Thanks for the incredibly direct and helpful response! I will test it tomorrow morning 🙂

Original thread: https://forums.rpgmakerweb.com/threads/yep-extended-message-pack-1-strange-glitch.83807/