From 8d64d9aac8a3ab7cdafbd69ebfff1f1d4763d576 Mon Sep 17 00:00:00 2001 From: Tae Sandoval Date: Tue, 6 Jul 2021 10:17:42 +0200 Subject: [PATCH] Avoid rising an error when default mapping exists If o is already mapped, an error is echoed. By checking if it is being used before creating a new mapping, we avoid annoying the user --- plugin/difforig.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/difforig.vim b/plugin/difforig.vim index 3f37cfd..4568e1b 100644 --- a/plugin/difforig.vim +++ b/plugin/difforig.vim @@ -31,7 +31,7 @@ if !(exists(':DiffOrig') == 2) command -bar -nargs=0 DiffOrig call difforig#main() endif -if !hasmapto('(DiffOrig)') +if !hasmapto('(DiffOrig)') && mapcheck('o', 'n') is# '' nmap o (DiffOrig) endif nnoremap (DiffOrig) :call difforig#main()