Add simple help messages to nvim stacc
This commit is contained in:
parent
ac93ce1b91
commit
6dfc4c08ce
1 changed files with 15 additions and 10 deletions
|
@ -3,6 +3,9 @@ local stacc = require "stacc"
|
||||||
vim.api.nvim_create_user_command("Stacc", function(params)
|
vim.api.nvim_create_user_command("Stacc", function(params)
|
||||||
if params.args == "" then
|
if params.args == "" then
|
||||||
local count = #stacc.locations
|
local count = #stacc.locations
|
||||||
|
if count == 0 then
|
||||||
|
print("Stacc is empty. Push with `:Stacc description of current task`")
|
||||||
|
else
|
||||||
for i, location in ipairs(stacc.locations) do
|
for i, location in ipairs(stacc.locations) do
|
||||||
local bufnr, id, description = unpack(location)
|
local bufnr, id, description = unpack(location)
|
||||||
--- @type number[]
|
--- @type number[]
|
||||||
|
@ -14,6 +17,8 @@ vim.api.nvim_create_user_command("Stacc", function(params)
|
||||||
description
|
description
|
||||||
))
|
))
|
||||||
end
|
end
|
||||||
|
print(":Stacc pop|clear")
|
||||||
|
end
|
||||||
elseif params.args == "clear" then
|
elseif params.args == "clear" then
|
||||||
stacc.clear()
|
stacc.clear()
|
||||||
elseif params.args == "pop" then
|
elseif params.args == "pop" then
|
||||||
|
|
Loading…
Reference in a new issue