Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for new
insert_final_newline
property
- Loading branch information
1 parent
95affba
commit 85bbb8b
Showing
1 changed file
with
3 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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': | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sindresorhus
Author
Owner
|
||
settings.set('ensure_newline_at_eof_on_save', True) |
I suggest adding an
elif insert_final_newline == 'false'
which should disable automatic newline insertion.I also think the same needs to be done for the
trim_trailing_whitespace
property which the user might have enabled by default (as you encourage in your README).