From 4ae1e858e60f9d3ed2020d346c0c301b74f9609a Mon Sep 17 00:00:00 2001 From: Mario Domgoergen Date: Thu, 21 Nov 2013 16:29:38 +0100 Subject: [PATCH 1/2] add checkbox if there's nothing to toggle --- plugin/checkbox.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/checkbox.vim b/plugin/checkbox.vim index 8c853b3..194f0eb 100644 --- a/plugin/checkbox.vim +++ b/plugin/checkbox.vim @@ -23,6 +23,8 @@ fu! checkbox#ToggleCB() let line = substitute(line, "\\[ \\]", "[x]", "") elseif(match(line, "\\[x\\]") != -1) let line = substitute(line, "\\[x\\]", "[ ]", "") + else + let line = substitute(line, "^", "[ ] ", "") endif call setline('.', line) From 5fee8d1636b2e3eea044f642aff5bc35c96e8ba8 Mon Sep 17 00:00:00 2001 From: Mario Domgoergen Date: Thu, 21 Nov 2013 16:34:00 +0100 Subject: [PATCH 2/2] added documentation for the new add checkbox feature --- README.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.markdown b/README.markdown index 81edb8e..22cba49 100644 --- a/README.markdown +++ b/README.markdown @@ -30,3 +30,6 @@ becomes * [x] Do some work. and vice versa. + +If there is nothing to toggle a checkbox is added to the beginning of +the current line.