File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ main() {
226
226
NEXT_BUTTON=$( get_tmux_option " @dracula-mac-player-remote-next" " N" )
227
227
228
228
# Scroll
229
- SCROLL=$( get_tmux_option " @dracula-mac-player-scroll" false)
229
+ SCROLL=$( get_tmux_option " @dracula-mac-player-scroll" " false" )
230
230
SCROLL_SPEED=$( get_tmux_option " @dracula-mac-player-scroll-speed" 0.08)
231
231
232
232
# os checker
@@ -252,23 +252,21 @@ main() {
252
252
tmux unbind-key " $NEXT_BUTTON " 2> /dev/null
253
253
fi
254
254
255
+ # handle cache separately from the scrolling feature
255
256
if [ ! -f " $cache_file " ] || [ $(( $(date +% s) - $(stat - f% c "$cache_file ")) ) -ge " $RATE " ]; then
256
257
local full_track
257
258
full_track=$( trackStatus " $PAUSE_ICON " " $PLAY_ICON " )
258
259
259
- if [ " $SCROLL " = " true" ] && [ " ${# str} " -ge $MAX_LENGTH ]; then
260
- echo " $full_track " > " $cache_file "
261
- else
262
- sliceTrack " $full_track " " $MAX_LENGTH " > " $cache_file "
263
- fi
260
+ echo " $full_track " > " $cache_file "
264
261
fi
265
262
266
- # Allow scrolling
267
- local str=$( cat " $cache_file " )
268
- if [ " $SCROLL " = " true" ]; then
269
- scroll " $str " " $MAX_LENGTH " " $SCROLL_SPEED "
263
+ # Allow scrolling and if not default to the string stripping concatenation thingy from length
264
+ local final_str
265
+ final_str=$( cat " $cache_file " )
266
+ if [ " $SCROLL " = " true" ] && [ " ${# final_str} " -ge " $MAX_LENGTH " ]; then
267
+ scroll " $final_str " " $MAX_LENGTH " " $SCROLL_SPEED "
270
268
else
271
- echo " $str "
269
+ sliceTrack " $final_str " " $MAX_LENGTH "
272
270
fi
273
271
}
274
272
You can’t perform that action at this time.
0 commit comments