File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -128,12 +128,12 @@ remove_note() {
128
128
129
129
open_something () {
130
130
if [[ -p /dev/stdin ]]; then
131
- read -d' \n ' note_names
131
+ read -d $" \n " note_names
132
132
local buffer=()
133
133
while read note_name; do
134
- buffer+=$ note_name
134
+ buffer+=" ${ note_name} , "
135
135
done <<< " $note_names"
136
- open_note $note_names
136
+ open_note ${buffer[@]}
137
137
elif [ $# -gt 0 ]; then
138
138
open_note " $* "
139
139
else
@@ -144,11 +144,13 @@ open_something() {
144
144
open_note () {
145
145
local note_path
146
146
local ext_check
147
- local buffer=()
147
+ local buffer=$@
148
+ local files=()
148
149
149
- for arg in $@ ; do
150
+ IFS=' ,'
151
+ for arg in $buffer ; do
150
152
ext_check=true
151
- note_path=$arg
153
+ note_path=" $arg "
152
154
if echo $note_path | grep -q ' \.[a-z]' ; then
153
155
ext_check=false
154
156
fi
@@ -162,10 +164,10 @@ open_note() {
162
164
printf " Please set \$ EDITOR to edit notes\n"
163
165
exit 1
164
166
fi
165
- buffer+= " $ note_path "
167
+ files+=( ${ note_path} )
166
168
done
167
169
168
- $EDITOR $buffer < /dev/tty
170
+ $EDITOR ${files[@]} < /dev/tty
169
171
}
170
172
171
173
usage () {
You can’t perform that action at this time.
0 commit comments