aboutsummaryrefslogtreecommitdiffstats
path: root/autoload
diff options
context:
space:
mode:
authorTeddy Wing2015-08-16 02:48:18 -0400
committerTeddy Wing2015-08-16 02:48:18 -0400
commit87452e0058fb8984b678947d33715b155dd3dbf0 (patch)
tree3ff77c9d719991cd876114001eaa312ff6e84ee6 /autoload
parent8a0fd42b1df21aa9bd1c9d6f8b169d060ea8db6e (diff)
downloadauditory.vim-87452e0058fb8984b678947d33715b155dd3dbf0.tar.bz2
autoload/auditory.vim: Fix `AuditoryToggle` + `Auditory[On|Off]`
When using `:AuditoryToggle` in conjunction with `:AuditoryOn` or `:AuditoryOff`, things would get messed up. This is because `:AuditoryToggle` relies on `g:auditory_on` in order to know whether to turn sounds on or off, but the variable was only getting set in `auditory#ToggleMappings`, not in the functions that `:AuditoryOn` or `:AuditoryOff` call. Move the setting of the variable into `auditory#AssignMappings` and `auditory#Unmap` so that the right thing will happen regardless of which on/off/toggle commands you run.
Diffstat (limited to 'autoload')
-rw-r--r--autoload/auditory.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/autoload/auditory.vim b/autoload/auditory.vim
index e914a03..e214974 100644
--- a/autoload/auditory.vim
+++ b/autoload/auditory.vim
@@ -502,6 +502,8 @@ function! auditory#AssignMappings()
endfor
call auditory#AssignInsertMappings()
+
+ let g:auditory_on = 1
endfunction
@@ -537,15 +539,15 @@ function! auditory#Unmap()
endfor
call auditory#UnmapInsert()
+
+ let g:auditory_on = 0
endfunction
function! auditory#ToggleMappings()
if g:auditory_on
call auditory#Unmap()
- let g:auditory_on = 0
else
call auditory#AssignMappings()
- let g:auditory_on = 1
endif
endfunction