Skip to content

Commit

Permalink
project:fix session restore issue
Browse files Browse the repository at this point in the history
Signed-off-by: tracyone <[email protected]>
  • Loading branch information
tracyone committed Sep 21, 2023
1 parent 5441ab0 commit ef9202c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions autoload/te/autocmds.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ function! te#autocmds#file_type() abort
if g:complete_plugin_type.cur_val == 'coc.nvim'
call CocCheckExtensions()
endif
if type(get(g:, 'vinux_project_name')) == g:t_string
call te#project#set_indent_options(g:vinux_coding_style.cur_val)
endif
endfunction
2 changes: 1 addition & 1 deletion autoload/te/feat.vim
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function! te#feat#gen_feature_vim(reset) abort
let l:temp2=te#feat#get_vim_version()
let l:vinux_version=te#compatiable#systemlist('git describe')
if type(l:vinux_version) == g:t_number || v:shell_error != 0
let g:vinux_version='vinux V1.8.8'.' @'.l:temp2[0].'.'.l:temp2[1]
let g:vinux_version='vinux V1.8.9'.' @'.l:temp2[0].'.'.l:temp2[1]
else
let l:temp = matchstr(l:vinux_version[-1],'.*\(-\d\+-\w\+\)\@=')
if l:temp !=# ''
Expand Down
14 changes: 7 additions & 7 deletions autoload/te/project.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function! te#project#set_indent_options(coding_style)
let g:vinux_coding_style.cur_val = a:coding_style
if a:coding_style ==# 'linux'
let g:vinux_tabwidth=8
:silent! bufdo set textwidth=80
:silent! bufdo set noexpandtab
:silent! bufdo set nosmarttab
:set textwidth=80
:set noexpandtab
:set nosmarttab
elseif a:coding_style ==# 'mozilla'
let g:vinux_tabwidth=4
elseif a:coding_style ==# 'google'
Expand All @@ -23,9 +23,9 @@ function! te#project#set_indent_options(coding_style)
else
let g:vinux_tabwidth=4
endif
execute 'silent! bufdo set tabstop='.g:vinux_tabwidth
execute 'silent! bufdo set shiftwidth='.g:vinux_tabwidth
execute 'silent! bufdo set softtabstop='.g:vinux_tabwidth
execute 'silent! set tabstop='.g:vinux_tabwidth
execute 'silent! set shiftwidth='.g:vinux_tabwidth
execute 'silent! set softtabstop='.g:vinux_tabwidth
endfunction
"create a project
"1. session
Expand All @@ -35,7 +35,7 @@ endfunction
function! te#project#create_project() abort
let l:project_exist = 0
let l:default_name=fnamemodify(getcwd(), ':t')
if exists('g:vinux_project_name') && !empty(g:vinux_project_name)
if type(get(g:, 'vinux_project_name')) == g:t_string
let l:default_name=g:vinux_project_name
let l:project_exist = 1
let l:name = input("Rename or save current project:", l:default_name)
Expand Down

0 comments on commit ef9202c

Please sign in to comment.