-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolved Issue #5 #35
Conversation
The linter failed at wrong use of quotation marks. Changed in new commit. |
src/sort-lines.ts
Outdated
@@ -14,13 +14,17 @@ function sortActiveSelection(algorithm: SortingAlgorithm, removeDuplicateValues: | |||
function sortLines(textEditor: vscode.TextEditor, startLine: number, endLine: number, algorithm: SortingAlgorithm, removeDuplicateValues: boolean): Thenable<boolean> { | |||
const lines: string[] = []; | |||
for (let i = startLine; i <= endLine; i++) { | |||
lines.push(textEditor.document.lineAt(i).text); | |||
} | |||
lines.push(textEditor.document.lineAt(i).text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is off
src/sort-lines.ts
Outdated
lines.push(textEditor.document.lineAt(i).text); | ||
} | ||
lines.push(textEditor.document.lineAt(i).text); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is off
src/sort-lines.ts
Outdated
lines.sort(algorithm); | ||
|
||
if (removeDuplicateValues) { | ||
removeDuplicates(lines, algorithm); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is off
Sorry about the delay, maybe this should be an option instead of the always on as it could break some people? How about |
I made the setting configurable as requested. I couldn't figure out how to switch the setting properly on and off without messing with user settings for the unit tests, so I now reverted the test cases to the old state. If you have an idea how to add test cases for this feature I think that might be good. |
BTW I named it sortLines.filterBlankLines, because it doesn't filter only empty lines, but also pure white space lines (tabs/spaces/mixed). |
Looks great, thanks 😃 |
Published v1.7.0 |
I looked at this issue #5 which was also bothering me a little bit sometimes. I changed one of the test files to also contain empty lines to remove (spaces, mixed tabs and spaces and empty).