From 1acd3e84c7bea013204ef8c1a6905bde507fce37 Mon Sep 17 00:00:00 2001 From: Zeh Rizzatti Date: Sat, 2 Mar 2013 22:02:29 -0400 Subject: [PATCH] Support for multile filetypes in clang_completer clang_completer would check if the raw value of '&ft' was one of supported filetypes for the completer. Vim allows for multiple filetypes with a '.' separator. A file with ft=qt.cpp, for example, would not be supported by clang_completer even though it was a cpp file. This patch changes that behaviour. --- python/completers/cpp/clang_completer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/completers/cpp/clang_completer.py b/python/completers/cpp/clang_completer.py index 456f80e3..4fc93a1c 100644 --- a/python/completers/cpp/clang_completer.py +++ b/python/completers/cpp/clang_completer.py @@ -246,5 +246,9 @@ def DiagnosticsToDiagStructure( diagnostics ): def ClangAvailableForBuffer( buffer_object ): - filetype = vim.eval( 'getbufvar({0}, "&ft")'.format( buffer_object.number ) ) - return filetype in CLANG_FILETYPES + filetypes = vim.eval( 'getbufvar({0}, "&ft")'.format( buffer_object.number ) ) + supported_fts = [ft for ft in filetypes.split('.') if ft in CLANG_FILETYPES] + if supported_fts: + return True + else: + return False