Patch which fixes this attached. It simply adds an additional loop around forward-line which runs until we leave the completion at point. BTW, I think we should have some helper functions for "get start of completion candidate or point-min" and "get end of completion candidate or point-max", or possibly "move to start of candidate" and "move to end of candidate"; it's pretty hard to get right.