From 805aeab26557e3b0c2da60db4caec04307ca5c25 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 8 Aug 2022 14:05:45 -0400 Subject: [PATCH] feat: determine if a line contains a checked box --- lua/toggle-checkbox.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/toggle-checkbox.lua b/lua/toggle-checkbox.lua index 3536cbe..a686d89 100644 --- a/lua/toggle-checkbox.lua +++ b/lua/toggle-checkbox.lua @@ -1,5 +1,9 @@ local checked_character = "x" +local line_contains_a_checked_checkbox = function(line) + return string.find(line, "[" .. checked_character .. "]") +end + local M = {} M.check = function(line)