aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-11-23 23:52:39 -0500
committerTeddy Wing2015-11-23 23:52:39 -0500
commit29b34c5e0b48428b81240bf6b49c2845885ef32a (patch)
tree5bf423e53c5ba9f6e80318acb2910a7fb9007279
parent60dd7674aa2508160728896c80438149ca6b7139 (diff)
parentb4ce35770716bcf2c43fd27c53a2165c1741c850 (diff)
downloadauditory.vim-29b34c5e0b48428b81240bf6b49c2845885ef32a.tar.bz2
Merge branch 'fix-G-mapping'
-rw-r--r--TODO2
-rw-r--r--autoload/auditory.vim11
2 files changed, 8 insertions, 5 deletions
diff --git a/TODO b/TODO
index 4a0dbb8..4acf58a 100644
--- a/TODO
+++ b/TODO
@@ -2,7 +2,7 @@ TODO
====
2015.08.18:
-- Fix G mapping. By itself it doesn't go to the end of the buffer
+v Fix G mapping. By itself it doesn't go to the end of the buffer (2015.11.23)
2015.07.26:
diff --git a/autoload/auditory.vim b/autoload/auditory.vim
index d618451..bae93e5 100644
--- a/autoload/auditory.vim
+++ b/autoload/auditory.vim
@@ -374,7 +374,7 @@ let g:auditory_mappings['gg'] = {
\ }
let g:auditory_mappings['G'] = {
\ 'audio': '/Resources/Normal_Mode/Jump.wav',
- \ 'count': 1,
+ \ 'count': 0,
\ }
let g:auditory_mappings['x'] = {
@@ -447,9 +447,12 @@ function! auditory#AssignMappings()
endif
endif
- let l:map_to_with_count = has_key(value, 'count') ?
- \ "execute 'normal!' v:count1 . '" . l:map_to . "'<cr>" :
- \ l:map_to
+ if has_key(value, 'count')
+ let vcount = value.count ==# 1 ? 'v:count1' : 'v:count'
+ let l:map_to_with_count = "execute 'normal!' " . vcount . " . '" . l:map_to . "'<cr>"
+ else
+ let l:map_to_with_count = l:map_to
+ endif
" If this an `execute` mapping, add a pipe.
" Otherwise <cr> to exit command mode.