fix repl crash when pasting trailing whitespace