Add an option for removing empty lines when trimming whitespace. Fixes #158 (again)
This commit is contained in:
parent
8de17a0c94
commit
4e25c90dff
2 changed files with 9 additions and 4 deletions
|
@ -47,11 +47,12 @@
|
|||
"indentation": 2, //indentation size
|
||||
"useTabs": false, //will turn off Ace's setUseSoftTabs() option and use tab characters instead
|
||||
"wordWrap": true,
|
||||
"wrapLimit":false, //Set to the number of characters you want or false for full window
|
||||
"wrapLimit": false, //Set to the number of characters you want or false for full window
|
||||
"showMargin": false,
|
||||
"lineEndings": "auto", //newline format - "windows", "unix", or "auto"
|
||||
"scrollPastEnd": true, //allow the editor to scroll past the end of the document
|
||||
"trimTrailingWhitespace": true, //remove whitespace from the end of lines on save
|
||||
"trimTrailingWhitespace": true, //run "Trim Trailing Whitespace" on save
|
||||
"trimEmptyLines": false, //should the trim whitespace command also truncate empty lines?
|
||||
|
||||
//only fixed-width fonts supported, for now
|
||||
"fontFamily": "",
|
||||
|
@ -63,7 +64,7 @@
|
|||
//autocomplete triggers on Ctrl-Space
|
||||
"autocomplete": true,
|
||||
|
||||
//By default, the palette searches the current file only unless you widen the scope.
|
||||
//By default, the palette searches the current file's text only unless you widen the scope.
|
||||
//If you'd like it to search all open files by default, set this option to true.
|
||||
"searchAllFiles": false,
|
||||
//set a regex to ignore in project view/search
|
||||
|
|
|
@ -133,7 +133,11 @@ define([
|
|||
var range = selection.getLineRange(i);
|
||||
range.end.row = range.start.row;
|
||||
range.end.column = line.length;
|
||||
line = line.replace(/(\S)\s+$/, "$1");
|
||||
if (userConfig.trimEmptyLines) {
|
||||
line = line.replace(/\s+$/, "");
|
||||
} else {
|
||||
line = line.replace(/(\S)\s+$/, "$1");
|
||||
}
|
||||
doc.replace(range, line);
|
||||
});
|
||||
if (c) c();
|
||||
|
|
Loading…
Reference in a new issue