test/clangd_tests.vim | 34 ++++++++++++++++++++++++++++++++++ diff --git a/test/clangd_tests.vim b/test/clangd_tests.vim index 5800158bbc72fb75bf44cb42b61bf410883c5c48..1ce4cd612f26f8a79ef15b89f2cc57f5e0d54d11 100644 --- a/test/clangd_tests.vim +++ b/test/clangd_tests.vim @@ -272,6 +272,40 @@ popup_clear() :%bw! enddef +# Test that the client have been able to configure the server to speak utf-32 +def g:Test_UnicodeColumnCalc() + :silent! edit Xtest.c + sleep 200m + var lines: list =<< trim END + int count; + int fn(int a) + { + int 😊😊😊😊; + 😊😊😊😊 = a; + + int b; + b = a; + return count + 1; + } + END + setline(1, lines) + :redraw! + + cursor(5, 1) # 😊😊😊😊 = a; + search('a') + assert_equal([], + execute('LspGotoDefinition')->split("\n")) + assert_equal([2, 12], [line('.'), col('.')]) + + cursor(8, 1) # b = a; + search('a') + assert_equal([], + execute('LspGotoDefinition')->split("\n")) + assert_equal([2, 12], [line('.'), col('.')]) + + bw! +enddef + # Test for multiple LSP diagnostics on the same line def g:Test_LspDiag_Multi() :silent! edit Xtest.c