Skip to content

Commit

Permalink
refactor!: key for conformation sound option
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Sep 20, 2023
1 parent 894317b commit 9a33212
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- TODO uncomment shields when available in dotfyle.com -->
<!-- <a href="https://dotfyle.com/plugins/chrisgrieser/nvim-tinygit"><img src="https://dotfyle.com/plugins/chrisgrieser/nvim-tinygit/shield" /></a> -->

Lightweight git client for nvim for quick commits and other quality of life improvements.
Lightweight and nimble git client for nvim.

`nvim-tinygit` should be considered beta status. It-works-on-my-machine™, but it has not yet been tested by many other users.

Expand Down Expand Up @@ -101,8 +101,9 @@ local defaultConfig = {
closedPR = "🟥",
},

-- confirmation sounds on finished async operations like push
confirmationSoundsOnMacOs = true,
-- Confirmation sound on finished async operations like push.
-- Currently macOS only.
confirmationSound = true,
}
```

Expand Down
6 changes: 3 additions & 3 deletions lua/tinygit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local defaultConfig = {
mergedPR = "🟨",
closedPR = "🟥",
},
confirmationSoundsOnMacOs = true,
confirmationSound = true, -- for async commands like push
}

-- set values if setup call is not run
Expand Down Expand Up @@ -75,11 +75,11 @@ local function notInGitRepo()
return notInRepo
end

---if on mac, play a sound
---CAVEAT currently only on macOS
---@param soundFilepath string
local function playSoundMacOS(soundFilepath)
local onMacOs = fn.has("macunix") == 1
if not onMacOs or not config.confirmationSoundsOnMacOs then return end
if not onMacOs or not config.confirmationSound then return end
fn.system(("afplay %q &"):format(soundFilepath))
end

Expand Down

0 comments on commit 9a33212

Please sign in to comment.