summary refs log tree commit diff
path: root/.vim/lua/zk.lua
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2021-12-07 13:55:40 +0100
committerRobert Günzler <r@gnzler.io>2021-12-07 14:00:27 +0100
commit9b5f086344ac06d9926dd8ca48140f31de29330e (patch)
tree80b64dd5d4afbd2fe74a58b4965e1498e56bb0db /.vim/lua/zk.lua
parent6a3429dcccfa4ec1a35016c34c84e09bfc913200 (diff)
vim: use new vim.ui funcs (neovim 0.6.0)
Diffstat (limited to '')
-rw-r--r--.vim/lua/zk.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/.vim/lua/zk.lua b/.vim/lua/zk.lua
index bb7fe35..242badc 100644
--- a/.vim/lua/zk.lua
+++ b/.vim/lua/zk.lua
@@ -3,8 +3,12 @@ local function zk_new(path, title_dir)
   path = path or vim.loop.cwd()
   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
+  if not title_dir then
+    vim.ui.input('New Zettel: ', function(result)
+      title_dir = result
+      end)
+  end
+  if title_dir == "" then return end
 
   local o = {}
   local parts = vim.split(title_dir, '/')