From 85bbb8b34203d13bb3091887ce4481891bbdbfc3 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 22 Aug 2012 18:40:46 +0200 Subject: [PATCH] Add support for new `insert_final_newline` property --- EditorConfig.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/EditorConfig.py b/EditorConfig.py index 9e18fa0..ddcae29 100644 --- a/EditorConfig.py +++ b/EditorConfig.py @@ -28,6 +28,7 @@ def apply_config(self, view, config): indent_size = config.get('indent_size') end_of_line = config.get('end_of_line') trim_trailing_whitespace = config.get('trim_trailing_whitespace') + insert_final_newline = config.get('insert_final_newline') if indent_style == 'space': settings.set('translate_tabs_to_spaces', True) elif indent_style == 'tab': @@ -41,3 +42,5 @@ def apply_config(self, view, config): view.set_line_endings(LINE_ENDINGS[end_of_line]) if trim_trailing_whitespace == 'true': settings.set('trim_trailing_white_space_on_save', True) + if insert_final_newline == 'true': + settings.set('ensure_newline_at_eof_on_save', True)