From 3b449c72a369fc5787ae55b33b2930cd8d2e0b45 Mon Sep 17 00:00:00 2001 From: Stefan Rakel Date: Fri, 27 Oct 2023 10:06:08 +0200 Subject: [PATCH] Move lua code to lua folder --- {plugin => lua}/checkbox.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) rename {plugin => lua}/checkbox.lua (95%) diff --git a/plugin/checkbox.lua b/lua/checkbox.lua similarity index 95% rename from plugin/checkbox.lua rename to lua/checkbox.lua index 3adc1e4..edb3ce9 100644 --- a/plugin/checkbox.lua +++ b/lua/checkbox.lua @@ -20,8 +20,17 @@ -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- SOFTWARE. +-- Initialize patterns local prefixPatterns = {"%-", "%*", "#+", "%->", "=>", "%d+%."} local skipPatterns = {"%-", "%*", "%->", "=>", "%d+%."} + +if vim.g.checkbox_prefixPatterns then + prefixPatterns = vim.g.checkbox_prefixPatterns +end +if vim.g.checkbox_skipPatterns then + prefixPatterns = vim.g.checkbox_skipPatterns +end + -- returns indentation level, checked status and text if the line has a checbox -- nil otherwise local function getCheckboxFromLine(lineNum) @@ -174,4 +183,7 @@ local function switchAndUpdateCheckbox() end end -vim.keymap.set("n", "x", switchAndUpdateCheckbox) +return { + checkbox = switchAndUpdateCheckbox +} +