The question of what "ending movement" means exactly is I think ambiguous in the rules. It could be:
1. You stop moving when you do anything other than move (ie, you attack, cast a spell, use an object, etc). But that misses the fact that you can move and do something at the same time.
2. You stop moving at the end of your turn. But that is weird because turns are an abstraction, really if you are running for a minute you don't stop every 6 seconds.
3. You stop moving when you say your character isn't moving any more. But that kind of breaks a few game things; occupying an ally's space is one, the fighter's evasive footwork maneuver is another).
I don't know if there is a good general solution.
By the rules, you are either moving or attacking - not both at the same time. The narrative may be that you attack as you move by, but the game mechanics handle it by you moving, stopping to swing your weapon several times, and then moving again.
The combat rules are simplified and abstract in order to handle multiple creatures (by having them to act in sequence instead of simultaneously) without being super complicated, they are not an attempt at a true simulation of combat. It's always been that way.
If you want to more realistically model multiple creatures acting simultaneously (or even just one creature doing multiple things at the same time, like moving and attacking) you can, but it leads to a much more complicated set of rules (and much slower combats).
It's one of the perks of being the DM that you can decide to allow things that make narrative sense, but aren't modeled by the rules, when you deem it appropriate.
Last edited: