Skip to content

Commit 389b182

Browse files
author
Bruno Sutic
committed
Bugfix: improve regex for fetching current directory sidebar width
1 parent 509b614 commit 389b182

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- do not suggest using `more` program in the readme
77
- invoke `less` pager command in a subshell so that unsetting environment
88
variable via `LESS=` works in any shell
9+
- bugfix: improve regex for fetching current directory sidebar width
910

1011
### v0.7.0, Sep 05, 2014
1112
- bugfix: invalid params for 'save_sidebar_width' script

scripts/helpers.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ sidebar_file() {
7676
}
7777

7878
directory_in_sidebar_file() {
79-
grep -q "^$1" $(sidebar_file) 2>/dev/null
79+
local pane_current_path="$1"
80+
grep -q "^${pane_current_path}\t" $(sidebar_file) 2>/dev/null
8081
}
8182

8283
width_from_sidebar_file() {
83-
grep "^$1" $(sidebar_file) |
84+
local pane_current_path="$1"
85+
grep "^${pane_current_path}\t" $(sidebar_file) |
8486
cut -f2
8587
}

0 commit comments

Comments
 (0)