##// END OF EJS Templates
Fix some formatting
Anton Älgmyr -
Show More
@@ -121,7 +121,9 b' def yapf_reformat_handler(text_before_cursor):'
121 from yapf.yapflib import yapf_api
121 from yapf.yapflib import yapf_api
122
122
123 style_config = file_resources.GetDefaultStyleForDir(os.getcwd())
123 style_config = file_resources.GetDefaultStyleForDir(os.getcwd())
124 formatted_text, was_formatted = yapf_api.FormatCode(text_before_cursor, style_config=style_config)
124 formatted_text, was_formatted = yapf_api.FormatCode(
125 text_before_cursor, style_config=style_config
126 )
125 if was_formatted:
127 if was_formatted:
126 if not text_before_cursor.endswith("\n") and formatted_text.endswith("\n"):
128 if not text_before_cursor.endswith("\n") and formatted_text.endswith("\n"):
127 formatted_text = formatted_text[:-1]
129 formatted_text = formatted_text[:-1]
General Comments 0
You need to be logged in to leave comments. Login now