From 56920918f3abecdef7d52f2681d56d3bdb33a797 Mon Sep 17 00:00:00 2001 From: Seongjae Lee Date: Mon, 20 Apr 2015 08:11:44 -0700 Subject: [PATCH] Do not create an empty note when search panel query is empty --- lib/notational-velocity-view.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/notational-velocity-view.coffee b/lib/notational-velocity-view.coffee index e85bc60..d010854 100644 --- a/lib/notational-velocity-view.coffee +++ b/lib/notational-velocity-view.coffee @@ -89,9 +89,10 @@ class NotationalVelocityView extends SelectListView @cancel() else sanitizedQuery = @getFilterQuery().replace(/\s+$/, '') - filePath = path.join(@rootDirectory, sanitizedQuery + '.md') - fs.writeFileSync(filePath, '') - atom.workspace.open(filePath) + if sanitizedQuery.length > 0 + filePath = path.join(@rootDirectory, sanitizedQuery + '.md') + fs.writeFileSync(filePath, '') + atom.workspace.open(filePath) @cancel() destroy: ->