From 62554bd2b097791e3a6aaaf6d4469cbd28dc2d7d Mon Sep 17 00:00:00 2001 From: Chris Coe Date: Thu, 8 Oct 2015 17:06:58 -0400 Subject: [PATCH] fix endline in python3 --- plugin/autoformat.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/autoformat.vim b/plugin/autoformat.vim index 9e1c47e..2bd7da0 100644 --- a/plugin/autoformat.vim +++ b/plugin/autoformat.vim @@ -188,8 +188,9 @@ else: # It is not entirely clear when and why that happens. # However, extra newlines are almost never required, while there are linters that complain # about superfluous newlines, so we remove one empty newline at the end of the file. - if stdoutdata[-1] == os.linesep: - stdoutdata = stdoutdata[:-1] + stdoutdata_decoded = stdoutdata.decode('utf-8') + if stdoutdata_decoded[-1] == os.linesep: + stdoutdata = stdoutdata_decoded[:-1] vim.current.buffer[:] = stdoutdata.split(os.linesep) EOF