If I try to <C-→> when I am already at the end of my input, then go back with <C-←> or even <←>, the behaviour is not what expected. Mostly, there is a offset with the beginning of the targeted word, and I can even go before the beginning of the input.
What terminal emulator are you using?
Nevermind, I can reproduce.
I think we are using the same one (urxvt) :).
I’ve tried your patch. It works like a charm! Thanks a lot.
Thanks for the bug report!