Compare commits
No commits in common. "e221723c1e635037997f7cc45c8b59a8e06b5e6c" and "1f619323933cc5ab65d698a578a9b08d714ab2e8" have entirely different histories.
e221723c1e
...
1f61932393
|
|
@ -6,12 +6,9 @@
|
||||||
.editor-mountpoint {
|
.editor-mountpoint {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
min-height: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-bar {
|
.status-bar {
|
||||||
flex-shrink: 0;
|
|
||||||
height: 2em;
|
height: 2em;
|
||||||
background-color: rgb(245, 245, 245);
|
background-color: rgb(245, 245, 245);
|
||||||
border-top: solid thin rgb(200, 200, 200);
|
border-top: solid thin rgb(200, 200, 200);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
|
@ -281,41 +280,6 @@ var TextFilters = map[string]TextProcessor{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"sort-lines-asc": {
|
|
||||||
Label: "Lines: Sort A-Z",
|
|
||||||
Filter: func(ctx context.Context, input string) (resp TextFilterResponse, err error) {
|
|
||||||
lines := strings.Split(input, "\n")
|
|
||||||
sort.Strings(lines)
|
|
||||||
return TextFilterResponse{Output: strings.Join(lines, "\n")}, nil
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
"sort-lines-desc": {
|
|
||||||
Label: "Lines: Sort Z-A",
|
|
||||||
Filter: func(ctx context.Context, input string) (resp TextFilterResponse, err error) {
|
|
||||||
lines := strings.Split(input, "\n")
|
|
||||||
sort.Sort(sort.Reverse(sort.StringSlice(lines)))
|
|
||||||
return TextFilterResponse{Output: strings.Join(lines, "\n")}, nil
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
"unique-lines": {
|
|
||||||
Label: "Lines: Unique",
|
|
||||||
Filter: func(ctx context.Context, input string) (resp TextFilterResponse, err error) {
|
|
||||||
lines := strings.Split(input, "\n")
|
|
||||||
seen := make(map[string]struct{}, len(lines))
|
|
||||||
dst := make([]string, 0, len(lines))
|
|
||||||
for _, line := range lines {
|
|
||||||
if _, ok := seen[line]; ok {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
seen[line] = struct{}{}
|
|
||||||
dst = append(dst, line)
|
|
||||||
}
|
|
||||||
return TextFilterResponse{Output: strings.Join(dst, "\n")}, nil
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
"remove-blank-lines": {
|
"remove-blank-lines": {
|
||||||
Label: "Lines: Remove Blank Lines",
|
Label: "Lines: Remove Blank Lines",
|
||||||
Filter: func(ctx context.Context, input string) (resp TextFilterResponse, err error) {
|
Filter: func(ctx context.Context, input string) (resp TextFilterResponse, err error) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue