Skip to content

Commit

Permalink
Merge pull request #17 from Hashino/next
Browse files Browse the repository at this point in the history
v0.3
  • Loading branch information
Hashino authored Jan 12, 2025
2 parents 7e7dfab + 6237ed5 commit c1c8911
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ It works by storing the tasks in a plain text file
this plugin was originally a fork of [nocksock/do.nvim](https://github.com/nocksock/do.nvim)

![doing](https://raw.githubusercontent.com/Hashino/doing.nvim/main/demo.gif)
*the gif was recorded using a [custom heirline component](https://github.com/Hashino/hash.nvim/blob/be72be47cb150019ce585a7c0f9e0060db0de76d/lua/hash/plugins/interface/status-bar.lua#L176-L222)*

## Commands

Expand Down Expand Up @@ -81,6 +82,9 @@ lazy.nvim:
-- if should append "+n more" to the status when there's tasks remaining
show_remaining = true,

-- if should show messages on the status string
show_messages = true,

-- window configs of the floating tasks editor
-- see :h nvim_open_win() for available options
edit_win_config = {
Expand Down
Binary file modified demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion lua/doing/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ local Config = {}
---@field show_remaining boolean show "+n more" when there are more than 1 tasks
---@field edit_win_config vim.api.keyset.win_config window configs of the floating editor

---@class DoingOptions
Config.default_opts = {
message_timeout = 2000,
doing_prefix = "Doing: ",

-- doesn"t display on buffers that match filetype/filename/filepath to
Expand All @@ -24,7 +24,10 @@ Config.default_opts = {
show_remaining = true,

-- if should show messages on the status string
-- if true, the status will show a message for the duration
-- of message_timeout in the status string
show_messages = true,
message_timeout = 2000,

winbar = {
enabled = true, -- if plugin should manage the winbar
Expand Down
5 changes: 3 additions & 2 deletions lua/doing/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function Utils.should_display()
local home_path_abs = tostring(os.getenv("HOME"))
local curr = vim.fn.expand("%:p")

---@diagnostic disable-next-line: param-type-mismatch
for _, exclude in ipairs(ignore) do
-- checks if exclude is a relative filepath and expands it
if exclude:sub(1, 2) == "./" or exclude:sub(1, 2) == ".\\" then
Expand Down Expand Up @@ -91,9 +92,9 @@ function Utils.get_path_separator()
return dir_separator
end

--- calls vim.notify with a title and icon
--- calls vim.notify with a styled title and icon
---@param msg string the message to show
---@param log_level? integer the log level to show
---@param log_level? integer One of the values from |vim.log.levels|.
function Utils.notify(msg, log_level)
vim.notify(msg, log_level or vim.log.levels.OFF,
{ title = "doing.nvim", icon = "", })
Expand Down

0 comments on commit c1c8911

Please sign in to comment.