fix(prompt): allow cancelling title input

This commit is contained in:
Thomas Lambert
2022-09-29 11:11:20 +02:00
parent bc2c45ce6c
commit 76919abaaf
2 changed files with 24 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ local linkutils = require("taglinks.linkutils")
local dateutils = require("taglinks.dateutils")
local Path = require("plenary.path")
local vaultPicker = require("vaultpicker")
local tkutils = require("telekasten.utils")
-- declare locals for the nvim api stuff to avoid more lsp warnings
local vim = vim
@@ -2038,7 +2039,7 @@ local function CreateNoteSelectTemplate(opts)
return
end
vim.ui.input({ prompt = "Title: " }, function(title)
tkutils.prompt_title(function(title)
if not title then
title = ""
end
@@ -2115,7 +2116,7 @@ local function CreateNote(opts)
return CreateNoteSelectTemplate(opts)
end
vim.ui.input({ prompt = "Title: ", default = "" }, function(title)
tkutils.prompt_title(function(title)
if not title then
title = ""
end