aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2020-03-22 02:02:54 +0100
committerTeddy Wing2020-03-22 02:02:54 +0100
commitc69625bb9d6b2a1e487975f007fff415247eeee6 (patch)
tree2fa843253a9fba3bc24b655655bf8725617a8f36
parent1086ee24c4a7e6ff8ca10d920d6384a30b233af3 (diff)
downloadvim-twodo-c69625bb9d6b2a1e487975f007fff415247eeee6.tar.bz2
ftplugin/todo.vim: Fix default mapping guards
These conditions were wrong, and should have been AND-ed. Otherwise, if you, say, didn't have a mapping to `<Plug>TwodoNewTodoBelow` and did have a mapping to `<Leader>n` (or vice versa), the plugin would still remap `<Leader>n`.
-rw-r--r--ftplugin/todo.vim16
1 files changed, 8 insertions, 8 deletions
diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim
index c212289..d79ae8d 100644
--- a/ftplugin/todo.vim
+++ b/ftplugin/todo.vim
@@ -36,35 +36,35 @@ nnoremap <silent> <buffer> <Plug>TwodoPreviousIncomplete :<c-u>call todo#motion#
onoremap <silent> <buffer> <Plug>TwodoNextIncomplete :<c-u>call todo#motion#NextIncomplete()<cr>
onoremap <silent> <buffer> <Plug>TwodoPreviousIncomplete :<c-u>call todo#motion#PreviousIncomplete()<cr>
-if !hasmapto('<Plug>TwodoNewTodoBelow') || !maparg('<leader>n', 'n')
+if !hasmapto('<Plug>TwodoNewTodoBelow') && !maparg('<leader>n', 'n')
nmap <silent> <buffer> <leader>n <Plug>TwodoNewTodoBelow
endif
-if !hasmapto('<Plug>TwodoNewTodoAbove') || !maparg('<leader>N', 'n')
+if !hasmapto('<Plug>TwodoNewTodoAbove') && !maparg('<leader>N', 'n')
nmap <silent> <buffer> <leader>N <Plug>TwodoNewTodoAbove
endif
-if !hasmapto('<Plug>TwodoMarkComplete') || !maparg('<leader>c', 'n')
+if !hasmapto('<Plug>TwodoMarkComplete') && !maparg('<leader>c', 'n')
nmap <silent> <buffer> <leader>c <Plug>TwodoMarkComplete
endif
-if !hasmapto('<Plug>TwodoMarkDeleted') || !maparg('<leader>d', 'n')
+if !hasmapto('<Plug>TwodoMarkDeleted') && !maparg('<leader>d', 'n')
nmap <silent> <buffer> <leader>d <Plug>TwodoMarkDeleted
endif
-if !hasmapto('<Plug>TwodoMarkPartiallyCompleted') || !maparg('<leader>s', 'n')
+if !hasmapto('<Plug>TwodoMarkPartiallyCompleted') && !maparg('<leader>s', 'n')
nmap <silent> <buffer> <leader>s <Plug>TwodoMarkPartiallyCompleted
endif
-if !hasmapto('<Plug>TwodoRemoveOldTodos') || !maparg('<leader>R', 'n')
+if !hasmapto('<Plug>TwodoRemoveOldTodos') && !maparg('<leader>R', 'n')
nmap <silent> <buffer> <leader>R <Plug>TwodoRemoveOldTodos
endif
-if !hasmapto('<Plug>TwodoEscalate') || !maparg('<leader>=', 'n')
+if !hasmapto('<Plug>TwodoEscalate') && !maparg('<leader>=', 'n')
nmap <silent> <buffer> <leader>= <Plug>TwodoEscalate
endif
-if !hasmapto('<Plug>TwodoDescalate') || !maparg('<leader>-', 'n')
+if !hasmapto('<Plug>TwodoDescalate') && !maparg('<leader>-', 'n')
nmap <silent> <buffer> <leader>- <Plug>TwodoDescalate
endif