Skip to content

Commit

Permalink
Merge pull request #68 from nickspoons/patch-1
Browse files Browse the repository at this point in the history
Do not remap <up>/<down> when already mapped
  • Loading branch information
simnalamburt authored May 4, 2018
2 parents f48d2b0 + c2f4751 commit 2540b4f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autoload/mundo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ function! s:MundoMapGraph()"{{{
exec 'nnoremap <script> <silent> <buffer> ' . g:mundo_map_move_newer . " :<C-u>call <sid>MundoPython('MundoMove(-1,'. v:count .')')<CR>"
nnoremap <script> <silent> <buffer> <CR> :call <sid>MundoPython('MundoRevert()')<CR>
nnoremap <script> <silent> <buffer> o :call <sid>MundoPython('MundoRevert()')<CR>
nnoremap <script> <silent> <buffer> <down> :<C-u>call <sid>MundoPython('MundoMove(1,'. v:count .')')<CR>
nnoremap <script> <silent> <buffer> <up> :<C-u>call <sid>MundoPython('MundoMove(-1,'. v:count .')')<CR>
if g:mundo_map_up_down
nnoremap <script> <silent> <buffer> <down> :<C-u>call <sid>MundoPython('MundoMove(1,'. v:count .')')<CR>
nnoremap <script> <silent> <buffer> <up> :<C-u>call <sid>MundoPython('MundoMove(-1,'. v:count .')')<CR>
endif
nnoremap <script> <silent> <buffer> J :<C-u>call <sid>MundoPython('MundoMove(1,'. v:count .',True,True)')<CR>
nnoremap <script> <silent> <buffer> K :<C-u>call <sid>MundoPython('MundoMove(-1,'. v:count .',True,True)')<CR>
nnoremap <script> <silent> <buffer> gg gg:<C-u>call <sid>MundoPython('MundoMove(1,'. v:count .')')<CR>
Expand Down
4 changes: 4 additions & 0 deletions autoload/mundo/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ call mundo#util#set_default(
\ 'g:mundo_map_move_newer', 'k',
\ 'g:gundo_map_move_newer')

call mundo#util#set_default(
\ 'g:mundo_map_up_down', 1,
\ 'g:gundo_map_up_down')

call mundo#util#set_default(
\ 'g:mundo_close_on_revert', 0,
\ 'g:gundo_close_on_revert')
Expand Down
9 changes: 9 additions & 0 deletions doc/mundo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CONTENTS *Mundo-contents*
3.13 mundo_mirror_graph ........ |mundo_mirror_graph|
3.14 mundo_inline_undo ......... |mundo_inline_undo|
3.15 mundo_return_on_revert .... |mundo_return_on_revert|
3.16 mundo_map_up_down ......... |mundo_map_up_down|
4. License ......................... |MundoLicense|
5. Bugs ............................ |MundoBugs|
6. Contributing .................... |MundoContributing|
Expand Down Expand Up @@ -263,6 +264,14 @@ Set this to 0 to keep focus in the Mundo window after a revert.

Default: 1

------------------------------------------------------------------------------
3.16 g:mundo_map_up_down *mundo_map_up_down*

By default, <Up> and <Down> are mapped to navigate up and down the undo graph.
Set this to 0 to prevent these mappings.

Default: 1

==============================================================================
4. License *MundoLicense*

Expand Down

0 comments on commit 2540b4f

Please sign in to comment.