From bd358a8b9acf274509bf99658a814370af7e74f8 Mon Sep 17 00:00:00 2001 From: kuuote Date: Sat, 14 Oct 2023 16:00:42 +0900 Subject: [PATCH] fix: `dpp#source#_source` is broken rename function and bring missing element from `dpp#ext#lazy#_source()` --- autoload/dpp/source.vim | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/autoload/dpp/source.vim b/autoload/dpp/source.vim index 65db994..cf9dbdf 100644 --- a/autoload/dpp/source.vim +++ b/autoload/dpp/source.vim @@ -1,4 +1,4 @@ -function dpp#autoload#_source(plugins) abort +function dpp#source#_source(plugins) abort let plugins = dpp#util#_convert2list(a:plugins) if plugins->empty() return [] @@ -10,7 +10,7 @@ function dpp#autoload#_source(plugins) abort endif let rtps = dpp#util#_split_rtp(&runtimepath) - const index = rtps->index(g:dpp#_runtime_path) + const index = rtps->index(dpp#util#_get_runtime_path()) if index < 0 return [] endif @@ -200,3 +200,19 @@ function s:is_reset_ftplugin(plugins) abort return 0 endfunction + +function s:reset_ftplugin() abort + const filetype_state = 'filetype'->execute() + + if 'b:did_indent'->exists() || 'b:did_ftplugin'->exists() + filetype plugin indent off + endif + + if filetype_state =~# 'plugin:ON' + silent! filetype plugin on + endif + + if filetype_state =~# 'indent:ON' + silent! filetype indent on + endif +endfunction