summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.vim/lua/zk.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/.vim/lua/zk.lua b/.vim/lua/zk.lua
index 4cd8389..bb7fe35 100644
--- a/.vim/lua/zk.lua
+++ b/.vim/lua/zk.lua
@@ -4,6 +4,8 @@ local function zk_new(path, title_dir)
   if not (path and #path > 0) then return end
 
   title_dir = title_dir or vim.fn.input('New Zettel: ')
+  if not title_dir or (title_dir == "") then return end
+
   local o = {}
   local parts = vim.split(title_dir, '/')
   if not parts[2] then
@@ -24,7 +26,7 @@ local function zk_new(path, title_dir)
         range = {start={line=2, character=0}},
       }
       vim.cmd('startinsert')
-    end,
+    end
   )
 end