fix when edit buffer spanning multiline

Signed-off-by: Takeshi Banse <takebi@laafc.net>