Skip to content

Commit

Permalink
Restrict max/min volume bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
alyosha committed Sep 26, 2020
1 parent e98880b commit c3d9ac2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions plugin/vimedia.vim
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,19 @@ fu! s:ToggleVolume() abort
let l:selected_opt = expand("<cword>")

if l:selected_opt == s:toggle_volume_opt_up
let l:next_volume = s:previous_volume + 0.1
let l:next = s:previous_volume + 0.1
if l:next > 0.9
let l:next_volume = 1.0
else
let l:next_volume = l:next
endif
elseif l:selected_opt == s:toggle_volume_opt_down
let l:next_volume = s:previous_volume - 0.1
let l:next = s:previous_volume - 0.1
if l:next < 0.1
let l:next_volume = 0.0
else
let l:next_volume = l:next
endif
elseif l:selected_opt == s:toggle_volume_opt_done
close
endif
Expand Down

0 comments on commit c3d9ac2

Please sign in to comment.