From 7219196dbae4242f8c9c3bb139cce72fe330ef03 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 1 Jan 2021 17:00:28 +0100 Subject: Improve disabling ftdetect --- ftdetect/polyglot.vim | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 45087f65..113453af 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -14,11 +14,6 @@ let did_load_polyglot = 1 let s:cpo_save = &cpo set cpo&vim -" It can happen vim filetype.vim loads first, then we need a reset -if exists("did_load_filetypes") - au! filetypedetect -endif - let g:polyglot_is_disabled = {} let s:new_polyglot_disabled = [] @@ -48,9 +43,6 @@ endfun au VimEnter * call PolyglotVerify() -" Prevent filetype.vim of vim from loading again -let did_load_filetypes = 1 - " Be consistent across different systems set nofileignorecase @@ -142,6 +134,15 @@ set cpo&vim if !has_key(g:polyglot_is_disabled, 'ftdetect') +" It can happen vim filetype.vim loads first, then we need a reset +if exists("did_load_filetypes") + au! filetypedetect +endif + +" Prevent filetype.vim of vim from loading again +let did_load_filetypes = 1 + + " DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE if !has_key(g:polyglot_is_disabled, 'jsonc') @@ -2657,8 +2658,6 @@ endif " DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE -endif - func! s:Observe(fn) let b:PolyglotObserve = function("polyglot#" . a:fn) augroup polyglot-observer @@ -2677,6 +2676,7 @@ au BufWritePost * au! polyglot-observer augroup END +endif if !has_key(g:polyglot_is_disabled, 'sensible') " Use 2-spaces tab indentation by default -- cgit v1.2.3