Skip to content

Commit

Permalink
feat: configurable icon for notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Dec 2, 2024
1 parent 19831fc commit 87344c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ require("various-textobjs").setup {

-- display notification if a text object is not found
notifyNotFound = true,

-- only relevant when using notification plugins like `nvim-notify`
notificationIcon = "󰠱"
}
```

Expand Down
3 changes: 3 additions & 0 deletions lua/various-textobjs/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ local defaultConfig = {

-- display notification if a text object is not found
notifyNotFound = true,

-- only relevant when using notification plugins like `nvim-notify`
notificationIcon = "󰠱"
}
M.config = defaultConfig

Expand Down
3 changes: 2 additions & 1 deletion lua/various-textobjs/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ function M.notify(msg, level)
if not require("various-textobjs.config").config.notifyNotFound then return end
level = "warn"
end
vim.notify(msg, vim.log.levels[level:upper()], { title = "nvim-various-textobjs" })
local icon = require("various-textobjs.config").config.notificationIcon
vim.notify(msg, vim.log.levels[level:upper()], { title = "nvim-various-textobjs", icon = icon })
end

---notification when no textobj could be found
Expand Down

0 comments on commit 87344c1

Please sign in to comment.