From 2fbb1d60c7d3719199baf9b20630deb6b9eee961 Mon Sep 17 00:00:00 2001 From: Francisco Aguilera Date: Fri, 10 Apr 2015 17:26:29 -0600 Subject: [PATCH] Verbose Added verbose setting to disable unnecessary messages. --- clang_format.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang_format.py b/clang_format.py index c665250..a2d7ab9 100644 --- a/clang_format.py +++ b/clang_format.py @@ -130,11 +130,13 @@ def load_settings(): global binary global style global format_on_save + global verbose settings = sublime.load_settings(settings_file) # Load settings, with defaults. binary = settings.get('binary', default_binary) style = settings.get('style', styles[0] ) format_on_save = settings.get('format_on_save', False ) + verbose = settings.get('verbose', False ) def is_supported(lang): # TODO: Add Objective-C and Objective-C++ here. @@ -255,7 +257,8 @@ def on_pre_save(self, view): # Ensure that settings are up to date. load_settings() if format_on_save: - print("Auto-applying Clang Format on save.") + if verbose: + print("Auto-applying Clang Format on save.") view.run_command("clang_format", {"whole_buffer": True}) # Called from the UI to update the path in the settings.