diff --git a/lib/notational-velocity-view.coffee b/lib/notational-velocity-view.coffee index 036b3c9..736a251 100644 --- a/lib/notational-velocity-view.coffee +++ b/lib/notational-velocity-view.coffee @@ -17,7 +17,7 @@ class NotationalVelocityView extends SelectListView @skipPopulateList = false @prevCursorPosition = 0 @documentsLoaded = false - @docQuery = new DocQuery(@rootDirectory, {recursive: true}) + @docQuery = new DocQuery(@rootDirectory, {recursive: true, extensions: atom.config.get('nvatom.extensions')}) @docQuery.on "ready", () => @documentsLoaded = true @setLoading() @@ -92,7 +92,8 @@ class NotationalVelocityView extends SelectListView item = @getSelectedItem() filePath = null sanitizedQuery = @getFilterQuery().replace(/\s+$/, '') - calculatedPath = path.join(@rootDirectory, sanitizedQuery + '.md') + extension = if atom.config.get('nvatom.extensions').length then atom.config.get('nvatom.extensions')[0] else '.md' + calculatedPath = path.join(@rootDirectory, sanitizedQuery + extension) if item? filePath = item.filePath else if fs.existsSync(calculatedPath) diff --git a/lib/notational-velocity.coffee b/lib/notational-velocity.coffee index 6620b3c..f13e3c3 100644 --- a/lib/notational-velocity.coffee +++ b/lib/notational-velocity.coffee @@ -9,6 +9,13 @@ module.exports = description: 'The directory to archive notes' type: 'string' default: path.join(process.env.ATOM_HOME, 'nvatom-notes') + extensions: + title: 'Extensions' + description: 'The first extension will be used for newly created notes.' + type: 'array' + default: ['.md', '.txt'] + items: + type: 'string' enableLunrPipeline: title: 'Enable Lunr Pipeline' description: 'Lunr pipeline preprocesses query to make search faster. However, it will skip searching some of stop words such as "an" or "be".'