aboutsummaryrefslogtreecommitdiff
path: root/lua/simple-denote/api.lua
diff options
context:
space:
mode:
authorDefaultGen <notes.propeller971@slmail.me>2024-06-05 04:33:37 -0400
committerDefaultGen <notes.propeller971@slmail.me>2024-06-05 04:33:37 -0400
commitc24731f92478e7c1546a77c70d0309db3d63be13 (patch)
tree7aac46eecefdac2d7f0bb72edde37bbeb57ba51d /lua/simple-denote/api.lua
parentc625270f9d8f156c0c1c32c10e662a68a0fb0694 (diff)
downloadsimple-denote.nvim-c24731f92478e7c1546a77c70d0309db3d63be13.tar.gz
Added signature support
Diffstat (limited to 'lua/simple-denote/api.lua')
-rw-r--r--lua/simple-denote/api.lua31
1 files changed, 18 insertions, 13 deletions
diff --git a/lua/simple-denote/api.lua b/lua/simple-denote/api.lua
index f99c21d..d986469 100644
--- a/lua/simple-denote/api.lua
+++ b/lua/simple-denote/api.lua
@@ -2,14 +2,6 @@ local M = {}
local internal = require("simple-denote.internal")
-function M.splitspace(str)
- local chunks = {}
- for substring in str:gmatch("%S+") do
- table.insert(chunks, #chunks, substring)
- end
- return chunks
-end
-
---@param options table
---@param name string|nil
---@param tags table|nil
@@ -30,7 +22,7 @@ end
---@param options table
---@param filename string|nil
---@param new_title string|nil
-function M.retitle(options, filename, title)
+function M.title(options, filename, title)
if not filename then
filename = vim.fn.expand("%")
end
@@ -39,13 +31,13 @@ function M.retitle(options, filename, title)
title = input
end)
end
- internal.retitle(options, filename, title)
+ internal.title(options, filename, title)
end
---@param options table
---@param filename string|nil
----@param new_tags table|nil
-function M.retag(options, filename, tags)
+---@param tags table|nil
+function M.tag(options, filename, tags)
if not filename then
filename = vim.fn.expand("%")
end
@@ -54,7 +46,20 @@ function M.retag(options, filename, tags)
tags = input
end)
end
- internal.retag(options, filename, tags)
+ internal.tag(options, filename, tags)
+end
+
+---@param options table
+---@param filename string|nil
+---@param sig string
+function M.signature(options, filename, sig)
+ filename = filename or vim.fn.expand("%")
+ if not sig then
+ vim.ui.input({ prompt = "Signature: " }, function(input)
+ sig = input
+ end)
+ end
+ internal.signature(options, filename, sig)
end
return M