use vim function to get data dir

This commit is contained in:
Senghan Bright 2021-01-15 18:01:19 +01:00
parent 6dd33341e7
commit 9cf45fcbac

View File

@ -68,7 +68,7 @@ function M:bootstrap(opts)
self.max_entries = opts.max_entries or 2000
-- create the db if it doesn't exist
local db_root = opts.docs_root or "$XDG_DATA_HOME/nvim"
local db_root = opts.docs_root or vim.fn.stdpath('data')
local db_filename = db_root .. "/file_frecency.sqlite3"
self.db = sql.open(db_filename)
if not self.db then