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

fix: #102 cannot create new issue when your repository doesn't have... #103

Merged
merged 1 commit into from
Feb 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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