Skip to content

Commit

Permalink
improv(smartCommit): notification display
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Sep 27, 2023
1 parent 31526e4 commit 5202e52
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lua/tinygit/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ function M.setup(userConf) config = vim.tbl_extend("force", defaultConfig, userC
--------------------------------------------------------------------------------
-- HELPERS

local notifySeperator = (""):rep(15)

-- open with the OS-specific shell command
---@param url string
local function openUrl(url)
Expand Down Expand Up @@ -177,11 +175,9 @@ local function setGitCommitAppearance()
vim.api.nvim_set_hl(winNs, "issueNumber", { link = "Number" })

-- colorcolumn as extra indicators of overLength
---@diagnostic disable-next-line: inject-field
vim.opt_local.colorcolumn = { conf.mediumLen, conf.maxLen }

-- treesitter highlighting
---@diagnostic disable-next-line: inject-field
vim.bo.filetype = "gitcommit"
vim.api.nvim_set_hl(winNs, "Title", { link = "Normal" })

Expand Down Expand Up @@ -212,7 +208,7 @@ function M.amendNoEdit(opts)
local lastCommitMsg = vim.trim(fn.system("git log -1 --pretty=%B"))
local body = { stageInfo, ('"%s"'):format(lastCommitMsg) }
if opts.forcePush then table.insert(body, "Force Pushing…") end
local notifyText = table.concat(body, "\n" .. notifySeperator .. "\n")
local notifyText = table.concat(body, "\n \n") -- need space since empty lines are removed by nvim-notify
notify(notifyText, "info", "Amend-No-edit")

if opts.forcePush then M.push { force = true } end
Expand Down Expand Up @@ -280,7 +276,7 @@ function M.smartCommit(opts, prefillMsg)

local body = { stageInfo, ('"%s"'):format(processedMsg) }
if opts.push then table.insert(body, "Pushing…") end
local notifyText = table.concat(body, "\n" .. notifySeperator .. "\n")
local notifyText = table.concat(body, "\n \n") -- need space since empty lines are removed by nvim-notify
notify(notifyText, "info", "Smart-Commit")

local issueReferenced = processedMsg:match("#(%d+)")
Expand Down

0 comments on commit 5202e52

Please sign in to comment.