Skip to content

Commit

Permalink
do not set comment buffer as not modified
Browse files Browse the repository at this point in the history
  • Loading branch information
pwntester committed Mar 1, 2021
1 parent 597e2f8 commit 647bb62
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lua/octo/reviews.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,8 @@ function M.add_review_comment(isSuggestion)

local bufname = format("%s:%d.%d", string.gsub(props.bufname, "/file/", "/comment/"), line1, line2)
api.nvim_buf_set_name(comment_bufnr, bufname)
api.nvim_buf_set_option(comment_bufnr, "filetype", "octo_reviewcomment")
api.nvim_buf_set_option(comment_bufnr, "syntax", "markdown")
api.nvim_buf_set_option(comment_bufnr, "buftype", "acwrite")
api.nvim_buf_set_option(comment_bufnr, "modified", false)
api.nvim_buf_set_var(comment_bufnr, "OctoDiffProps", props)
api.nvim_win_set_var(props.qf_winid, "comment_winid", comment_winid)

Expand All @@ -249,6 +247,7 @@ function M.add_review_comment(isSuggestion)
vim.list_extend(suggestion, lines)
table.insert(suggestion, "```")
api.nvim_buf_set_lines(comment_bufnr, 0, -1, false, suggestion)
api.nvim_buf_set_option(comment_bufnr, "modified", false)
end

-- change to insert mode
Expand Down Expand Up @@ -709,11 +708,9 @@ function M.submit_review(event)
elseif output then
print("Submitted!")
end
--api.nvim_win_close(0, true)
end
}
)

M.close_review_tab()
end

Expand Down

0 comments on commit 647bb62

Please sign in to comment.