Skip to content

Commit

Permalink
Fix bad math expression error when IFS doesn't contain space
Browse files Browse the repository at this point in the history
When the previous prompt contains highlight and IFS doesn't contain space,
calling filter-select results in the following error:

filter-select:136: bad math expression: operator expected at `14 fg=blue...'

This is fixed by specifying the delimiter for the read command.
  • Loading branch information
NigoroJr committed Dec 14, 2016
1 parent a38b278 commit 5fac828
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/filter-select
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function filter-select() {
if [[ "${hi}" == P* ]]; then
init_region_highlight+="${hi}"
else
print -r -- "${hi}" | read start end spec
print -r -- "${hi}" | read -d ' ' start end spec
init_region_highlight+="P$(( start + ${#orig_predisplay} )) $(( end + ${#orig_predisplay} )) $spec"
fi
done
Expand Down

0 comments on commit 5fac828

Please sign in to comment.