diff options
| author | Teddy Wing | 2015-08-16 14:50:35 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-08-16 14:50:35 -0400 |
| commit | 1c9fe852b40d4e7a883bcdc71c91abdd023514bb (patch) | |
| tree | df54fee21f1542d0af97bdfc49cb765b85581cef | |
| parent | 71ec214cdb8814ecb71c837bf947583fda54d37e (diff) | |
| download | auditory.vim-1c9fe852b40d4e7a883bcdc71c91abdd023514bb.tar.bz2 | |
Don't turn on Galaxy Far Far away when not `g:auditory_on`
My change from 71ec214cdb8814ecb71c837bf947583fda54d37e caused Galaxy
Far Far Away sounds to be turned on any time you had
`g:auditory_galaxy_far_far_away` turned on, regardless of whether
`g:auditory_on` was also turned on.
Fix this because we never want sounds to play when `g:auditory_on` is
off.
We now rely on `auditory#AssignInsertMappings()` to know whether to use
Galaxy Far Far Away or default insert mode sounds.
Need to toggle `g:auditory_galaxy_far_far_away` in that function because
we're calling the toggle function so we need to set it to the opposite
of what we want.
In the future if we add more insert mode sounds we'll have to change
this structure around but it should work for now.
| -rw-r--r-- | autoload/auditory.vim | 6 | ||||
| -rw-r--r-- | plugin/auditory.vim | 5 |
2 files changed, 2 insertions, 9 deletions
diff --git a/autoload/auditory.vim b/autoload/auditory.vim index 994b64e..1e3d134 100644 --- a/autoload/auditory.vim +++ b/autoload/auditory.vim @@ -77,10 +77,8 @@ endfunction function! auditory#AssignInsertMappings() - augroup auditory#insert_mode - autocmd! - autocmd CursorMovedI * call auditory#PlayScale() - augroup END + let g:auditory_galaxy_far_far_away = !g:auditory_galaxy_far_far_away + call auditory#ToggleGalaxyFarFarAway() endfunction diff --git a/plugin/auditory.vim b/plugin/auditory.vim index d740561..411a812 100644 --- a/plugin/auditory.vim +++ b/plugin/auditory.vim @@ -29,8 +29,3 @@ command! AuditoryToggleGalaxyFarFarAway call auditory#ToggleGalaxyFarFarAway() if g:auditory_on call auditory#AssignMappings() endif - -if g:auditory_galaxy_far_far_away - let g:auditory_galaxy_far_far_away = 0 - call auditory#ToggleGalaxyFarFarAway() -endif |
