diff options
author | Sam McCall <sam.mccall@gmail.com> | 2019-05-17 07:22:55 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2019-05-17 07:22:55 +0000 |
commit | aee9448939cdee5064e65225d1039e7e7f0facc7 (patch) | |
tree | 0076f3c19758243f6ad47aef3f951c691bae80fc /clang/tools/clang-format/clang-format-sublime.py | |
parent | ee0ce302c5eb4f26738f334f2fd8b165fa65dfca (diff) | |
download | bcm5719-llvm-aee9448939cdee5064e65225d1039e7e7f0facc7.tar.gz bcm5719-llvm-aee9448939cdee5064e65225d1039e7e7f0facc7.zip |
[ClangFormat] Editor integrations inherit default style from clang-format binary
Summary:
This allows downstream customizations to the default style to work without
needing to also modify the editor integrations.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49719
llvm-svn: 360996
Diffstat (limited to 'clang/tools/clang-format/clang-format-sublime.py')
-rw-r--r-- | clang/tools/clang-format/clang-format-sublime.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/tools/clang-format/clang-format-sublime.py b/clang/tools/clang-format/clang-format-sublime.py index 5ea9a27825c..20c867092ef 100644 --- a/clang/tools/clang-format/clang-format-sublime.py +++ b/clang/tools/clang-format/clang-format-sublime.py @@ -24,7 +24,7 @@ binary = 'clang-format' # 'clang-format --help' for a list of supported styles. The default looks for # a '.clang-format' or '_clang-format' file to indicate the style that should be # used. -style = 'file' +style = None class ClangFormatCommand(sublime_plugin.TextCommand): def run(self, edit): @@ -32,7 +32,9 @@ class ClangFormatCommand(sublime_plugin.TextCommand): if encoding == 'Undefined': encoding = 'utf-8' regions = [] - command = [binary, '-style', style] + command = [binary] + if style: + command.extend(['-style', style]) for region in self.view.sel(): regions.append(region) region_offset = min(region.a, region.b) |