diff --git a/autoload/SpaceVim/autocmds.vim b/autoload/SpaceVim/autocmds.vim index c5a72f0c5..43af0c17a 100644 --- a/autoload/SpaceVim/autocmds.vim +++ b/autoload/SpaceVim/autocmds.vim @@ -163,6 +163,8 @@ function! SpaceVim#autocmds#VimEnter() abort call call(g:_spacevim_bootstrap_after, []) catch call SpaceVim#logger#error('failed to call bootstrap_after function: ' . g:_spacevim_bootstrap_after) + call SpaceVim#logger#error(' exception: ' . v:exception) + call SpaceVim#logger#error(' throwpoint: ' . v:throwpoint) endtry endif endfunction diff --git a/autoload/SpaceVim/custom.vim b/autoload/SpaceVim/custom.vim index 3d7968c68..7122d8733 100644 --- a/autoload/SpaceVim/custom.vim +++ b/autoload/SpaceVim/custom.vim @@ -8,6 +8,7 @@ let s:TOML = SpaceVim#api#import('data#toml') let s:JSON = SpaceVim#api#import('data#json') +let s:FILE = SpaceVim#api#import('file') function! SpaceVim#custom#profile(dict) abort for key in keys(a:dict) @@ -41,15 +42,17 @@ function! SpaceVim#custom#autoconfig(...) abort call menu.menu(ques) endfunction + + function! s:awesome_mode() abort - let sep = SpaceVim#api#import('file').separator + let sep = s:FILE.separator let f = fnamemodify(g:_spacevim_root_dir, ':h') . join(['', 'mode', 'dark_powered.toml'], sep) let config = readfile(f, '') call s:write_to_config(config) endfunction function! s:basic_mode() abort - let sep = SpaceVim#api#import('file').separator + let sep = s:FILE.separator let f = fnamemodify(g:_spacevim_root_dir, ':h') . join(['', 'mode', 'basic.toml'], sep) let config = readfile(f, '') call s:write_to_config(config) @@ -61,10 +64,12 @@ function! s:write_to_config(config) abort let g:_spacevim_global_config_path = global_dir . 'init.toml' let cf = global_dir . 'init.toml' if filereadable(cf) + call SpaceVim#logger#warn("Failed to generate config file, It is not readable: " . cf) return endif - if !isdirectory(fnamemodify(cf, ':p:h')) - call mkdir(expand(fnamemodify(cf, ':p:h')), 'p') + let dir = expand(fnamemodify(cf, ':p:h')) + if !isdirectory(dir) + call mkdir(dir), 'p') endif call writefile(a:config, cf, '') endfunction diff --git a/wiki/cn/Following-HEAD.md b/wiki/cn/Following-HEAD.md index e7621a412..31e928408 100644 --- a/wiki/cn/Following-HEAD.md +++ b/wiki/cn/Following-HEAD.md @@ -41,6 +41,11 @@ - Fix dein-ui error, add syntax ([#2352](https://github.com/SpaceVim/SpaceVim/pull/2352), [`c9e1d4c`](https://github.com/SpaceVim/SpaceVim/commit/c9e1d4c9635c483bb3334c00ed36026d18950070)) - Fix fullscreen key binding ([#2351](https://github.com/SpaceVim/SpaceVim/pull/2351)) - Added missed syntax for detached FlyGrep ([#2353](https://github.com/SpaceVim/SpaceVim/pull/2353), [`08d0713`](https://github.com/SpaceVim/SpaceVim/commit/08d0713c4494ca401942a6ca10a48a1ac8484ce1)) +- Add log for generate configuration file ([#2369](https://github.com/SpaceVim/SpaceVim/pull/2369)) +- Fix FlyGrep syntax to support different outputs ([#2363](https://github.com/SpaceVim/SpaceVim/pull/2363), [`0b26f40`](https://github.com/SpaceVim/SpaceVim/commit/0b26f407d879427505418f5c3b4c1d753f3f4317)) +- Fix `project_rooter_automatically = 0` option to not change directory to project root ([#2363](https://github.com/SpaceVim/SpaceVim/pull/2365)) +- Add log for generate configuration file ([#2369](https://github.com/SpaceVim/SpaceVim/pull/2369)) + ### 移除的功能 diff --git a/wiki/en/Following-HEAD.md b/wiki/en/Following-HEAD.md index c546fbb96..5c9ec58af 100644 --- a/wiki/en/Following-HEAD.md +++ b/wiki/en/Following-HEAD.md @@ -43,6 +43,7 @@ The next release is v1.0.0. - Added missed syntax for detached FlyGrep ([#2353](https://github.com/SpaceVim/SpaceVim/pull/2353), [`08d0713`](https://github.com/SpaceVim/SpaceVim/commit/08d0713c4494ca401942a6ca10a48a1ac8484ce1)) - Fix FlyGrep syntax to support different outputs ([#2363](https://github.com/SpaceVim/SpaceVim/pull/2363), [`0b26f40`](https://github.com/SpaceVim/SpaceVim/commit/0b26f407d879427505418f5c3b4c1d753f3f4317)) - Fix `project_rooter_automatically = 0` option to not change directory to project root ([#2363](https://github.com/SpaceVim/SpaceVim/pull/2365)) +- Add log for generate configuration file ([#2369](https://github.com/SpaceVim/SpaceVim/pull/2369)) ### Removed