If you've got brake levers for flat bars, and the cables don't go under the bar tape (you have grips but not tape?) then you should have plenty of leeway on cable length. You might even be able to swap the brake levers and gear shifter without disconnecting the cables.