diff --git a/plugin/packages/wakatime/__about__.py b/plugin/packages/wakatime/__about__.py index e8ddfd3..1e1804f 100644 --- a/plugin/packages/wakatime/__about__.py +++ b/plugin/packages/wakatime/__about__.py @@ -1,7 +1,7 @@ __title__ = 'wakatime' __description__ = 'Common interface to the WakaTime api.' __url__ = 'https://github.com/wakatime/wakatime' -__version_info__ = ('10', '1', '2') +__version_info__ = ('10', '1', '3') __version__ = '.'.join(__version_info__) __author__ = 'Alan Hamlett' __author_email__ = 'alan@wakatime.com' diff --git a/plugin/packages/wakatime/stats.py b/plugin/packages/wakatime/stats.py index 0f34229..ec67900 100644 --- a/plugin/packages/wakatime/stats.py +++ b/plugin/packages/wakatime/stats.py @@ -177,18 +177,18 @@ def get_language_from_extension(file_name): if os.path.exists(u('{0}{1}').format(u(filepart), u('.c'))) or os.path.exists(u('{0}{1}').format(u(filepart), u('.C'))): return 'C' - available_extensions = extensions_in_same_folder(file_name) - if '.cpp' in available_extensions: - return 'C++' - if '.c' in available_extensions: - return 'C' - if os.path.exists(u('{0}{1}').format(u(filepart), u('.m'))) or os.path.exists(u('{0}{1}').format(u(filepart), u('.M'))): return 'Objective-C' if os.path.exists(u('{0}{1}').format(u(filepart), u('.mm'))) or os.path.exists(u('{0}{1}').format(u(filepart), u('.MM'))): return 'Objective-C++' + available_extensions = extensions_in_same_folder(file_name) + if '.cpp' in available_extensions: + return 'C++' + if '.c' in available_extensions: + return 'C' + if re.match(r'\.m$', extension, re.IGNORECASE) and (os.path.exists(u('{0}{1}').format(u(filepart), u('.h'))) or os.path.exists(u('{0}{1}').format(u(filepart), u('.H')))): return 'Objective-C'