[ Fixes #62889174 ] Cleaned up the logic a bit to avoid a double
separator between before and after pads if no words are requested. Also,
simplified the conditions for detecting an inside pad when zero or one
words are requested.