Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
szktkfm committed Apr 2, 2024
1 parent 011b38b commit 1c3fd0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

## Usage

| Key binding | Description |
|------------------|--------------------|
| `Arrows`, `hjkl` | Move cursor |
| `Enter` :100: | Enter directory |
| `Backspace` | Exit directory |
| `Space` | Toggle preview |
| **Esc**, _q_ | Exit with cd |
| `y` | yank current dir |
| Key binding | Description |
| ---------------- | ---------------- |
| `Arrows`, `hjkl` | Move cursor |
| `Enter` :100: | Enter directory |
| `Backspace` | Exit directory |
| `Space` | Toggle preview |
| **Esc**, _q_ | Exit with cd |
| `y` | yank current dir |

first line

Expand Down
13 changes: 2 additions & 11 deletions printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,8 @@ func trimLeadingSpace(s string) string {
return prefixIgnoreSpace.ReplaceAllString(s, "")
}

func trimPipe(l string) string {
if len(l) == 0 {
return l
}
if l[0] == '|' {
l = l[1:]
}
if l[len(l)-1] == '|' {
l = l[:len(l)-1]
}
return l
func trimPipe(s string) string {
return strings.Trim(s, "|")
}

func trimSpace(s string) string {
Expand Down

0 comments on commit 1c3fd0f

Please sign in to comment.