diff --git a/python/ycm/tests/vimsupport_test.py b/python/ycm/tests/vimsupport_test.py index ac72d326..785a948a 100644 --- a/python/ycm/tests/vimsupport_test.py +++ b/python/ycm/tests/vimsupport_test.py @@ -1407,7 +1407,7 @@ def GetUnsavedAndCurrentBufferData_EncodedUnicodeCharsInBuffers_test( *args ): mock_buffer = MagicMock() mock_buffer.name = os.path.realpath( 'filename' ) mock_buffer.number = 1 - mock_buffer.__iter__.return_value = [ u'abc', ToBytes( u'fДa' ) ] + mock_buffer.__iter__.return_value = [ ToBytes ( u'abc' ), ToBytes( u'fДa' ) ] with patch( 'vim.buffers', [ mock_buffer ] ): assert_that( vimsupport.GetUnsavedAndCurrentBufferData(), diff --git a/python/ycm/vimsupport.py b/python/ycm/vimsupport.py index 6ebf1315..068922d4 100644 --- a/python/ycm/vimsupport.py +++ b/python/ycm/vimsupport.py @@ -30,7 +30,7 @@ import tempfile import json import re from collections import defaultdict -from ycmd.utils import ToUnicode, ToBytes +from ycmd.utils import ToUnicode, ToBytes, JoinLinesAsUnicode from ycmd import user_options_store BUFFER_COMMAND_MAP = { 'same-buffer' : 'edit', @@ -125,7 +125,7 @@ def GetUnsavedAndCurrentBufferData(): buffers_data[ GetBufferFilepath( buffer_object ) ] = { # Add a newline to match what gets saved to disk. See #1455 for details. - 'contents': '\n'.join( ToUnicode( x ) for x in buffer_object ) + '\n', + 'contents': JoinLinesAsUnicode( buffer_object ) + '\n', 'filetypes': FiletypesForBuffer( buffer_object ) } diff --git a/third_party/ycmd b/third_party/ycmd index 36350644..f3232ce5 160000 --- a/third_party/ycmd +++ b/third_party/ycmd @@ -1 +1 @@ -Subproject commit 363506449fe18337b6aabbf29d8a14720483ccf6 +Subproject commit f3232ce5180753822d839c80e9b9ea4e33e89d4c