Skip to content
Snippets Groups Projects
Commit 1dbfeabd authored by Conrad Zelck's avatar Conrad Zelck
Browse files

feat: if unique lines checked remove empty lines


On top there will be all empty lines. If unique is checked I want to
delete this.

Known issue:
If there are lines with whitespaces they will stay and not removed.

Signed-off-by: default avatarConrad Zelck <git@simpel.cc>
parent 56fc4eeb
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,14 @@ function sort_and_copy(ev){
}
lines = lines.sort(natural_compare);
// if there was an empty line it will be first array item now - remove
if (check_unique.checked) {
if (lines[0] == "") {
lines = lines.slice(1);
}
}
textarea.value = lines.join("\n");
window.getSelection().removeAllRanges();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment