Skip to content

Commit

Permalink
🐞fix: 念のためGitAddAllでchdir
Browse files Browse the repository at this point in the history
  • Loading branch information
utubo committed Sep 28, 2023
1 parent 9eac1e6 commit 6bd47a4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 deletions.
14 changes: 10 additions & 4 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -254,25 +254,31 @@ nn <buffer> p <Plug>(fern-action-leave)
}
nn <F1> <Cmd>Fern . -reveal=% -opener=split<CR>
def I()
const a = getcwd()
try
chdir(expand('%:p:h'))
echoh MoreMsg
ec 'git add -A -n'
const a = system('git add -A -n')
if !a
const b = system('git add -A -n')
if !b
ec 'none.'
elseif !!v:shell_error
echoh ErrorMsg
ec a
ec b
echoh Normal
return
else
echoh DiffAdd
ec a
ec b
echoh Question
if input("execute ? (y/n) > ", 'y') ==# 'y'
system("git add -A")
endif
endif
echoh Normal
finally
chdir(a)
endtry
enddef
def! g:ConventionalCommits(a: any, l: string, p: number): list<string>
return ['✨feat:', '🐞fix:', '📝docs:', '🔨refactor:', '🎨style:', '⏪revert:', '✅test:', '🔧chore', '🎉release:']
Expand Down
42 changes: 24 additions & 18 deletions src/.vimrc.src.vim
Original file line number Diff line number Diff line change
Expand Up @@ -333,25 +333,31 @@ nnoremap <F1> <Cmd>Fern . -reveal=% -opener=split<CR>

# Git {{{
def GitAddAll()
echoh MoreMsg
echo 'git add -A -n'
const list = system('git add -A -n')
if !list
echo 'none.'
elseif !!v:shell_error
echoh ErrorMsg
echo list
echoh Normal
return
else
echoh DiffAdd
echo list
echoh Question
if input("execute ? (y/n) > ", 'y') ==# 'y'
system("git add -A")
const current_dir = getcwd()
try
chdir(expand('%:p:h'))
echoh MoreMsg
echo 'git add -A -n'
const list = system('git add -A -n')
if !list
echo 'none.'
elseif !!v:shell_error
echoh ErrorMsg
echo list
echoh Normal
return
else
echoh DiffAdd
echo list
echoh Question
if input("execute ? (y/n) > ", 'y') ==# 'y'
system("git add -A")
endif
endif
endif
echoh Normal
echoh Normal
finally
chdir(current_dir)
endtry
enddef
def! g:ConventionalCommits(a: any, l: string, p: number): list<string>
return ['✨feat:', '🐞fix:', '📝docs:', '🔨refactor:', '🎨style:', '⏪revert:', '✅test:', '🔧chore', '🎉release:']
Expand Down

0 comments on commit 6bd47a4

Please sign in to comment.