Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #103 from yoshio15/feature/#102-fix-new-issue
Browse files Browse the repository at this point in the history
fix: #102 cannot create new issue when your repository doesn't have...
  • Loading branch information
skanehira authored Feb 12, 2021
2 parents f579260 + 05eee8f commit 0b695e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/gh/issues.vim
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ function! s:set_issue_template_buffer(resp) abort

" store buffer variable because create new buffer to edit issue body
let gh_issue_new = b:gh_issue_new
" store buffer-id to delete the buffer just after creating new buffer below,
" only when the repo has no issue template
let gh_issue_new_bufid = b:gh_issues_new_bufid

call execute(printf('e gh://%s/%s/issues/%s', b:gh_issue_new.owner, b:gh_issue_new.name, gh_issue_title))
call gh#map#apply('gh-buffer-issue-new', bufnr())
Expand All @@ -272,6 +275,8 @@ function! s:set_issue_template_buffer(resp) abort

if !empty(a:resp.body)
call setline(1, split(a:resp.body, '\r'))
else
execute(printf('%dbw!', gh_issue_new_bufid))
endif

setlocal nomodified
Expand All @@ -292,7 +297,6 @@ endfunction

function! s:open_template_list(files) abort
if empty(a:files)
bw!
call s:set_issue_template_buffer({'body': ''})
return
endif
Expand Down

0 comments on commit 0b695e6

Please sign in to comment.