From 142e4fcddebc8426f59dd88fc3688e42ea1bff38 Mon Sep 17 00:00:00 2001 From: Vladimir Eremeev Date: Thu, 3 Sep 2020 17:53:45 +0300 Subject: [PATCH] allow temporary disable automatic redefinition of makeprg --- plugin/ucmake.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin/ucmake.vim b/plugin/ucmake.vim index 9bc149d..76a65a7 100644 --- a/plugin/ucmake.vim +++ b/plugin/ucmake.vim @@ -46,6 +46,8 @@ if !exists("g:ucmake_cache_entries") let g:ucmake_cache_entries = {} endif +let g:ucmake_disabled = get(g:, 'ucmake_disabled', 0) + function! s:shellslash(path) abort if &shell =~? 'cmd' || exists('+shellslash') && !&shellslash return tr(a:path, '\', '/') @@ -71,6 +73,9 @@ function! s:apply_buffer_macro(string) abort endfunction function! s:setup(path) abort + if g:ucmake_disabled + return + endif let path = s:shellslash(a:path) if isdirectory(path) let path = fnamemodify(path, ':p:s?/$??') @@ -142,3 +147,5 @@ augroup ucmake " autocmd CmdWinEnter * call s:setup(expand('#:p')) augroup END +command! UCmakeToggleDisabled :let g:ucmake_disabled=!g:ucmake_disabled +