diff options
Diffstat (limited to 'plugin/50-notes.lua')
| -rw-r--r-- | plugin/50-notes.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugin/50-notes.lua b/plugin/50-notes.lua index 11a8aef..fa55743 100644 --- a/plugin/50-notes.lua +++ b/plugin/50-notes.lua @@ -27,11 +27,11 @@ -- `<Tab>` / `<S-Tab>` (in notes buffers): go to next/previous followable entity -- -if vim.env.NOTES_DIR == nil then - vim.notify("NOTES_DIR is not set", vim.log.levels.ERROR) +local notes_dir = require("dotfiles.notes").dir +if notes_dir == nil then + vim.notify("50-notes.lua: NOTES_DIR is not set, notes wiki disabled", vim.log.levels.WARN) return end -local notes_dir = vim.fs.normalize(vim.env.NOTES_DIR) local tagfile = vim.fs.joinpath(vim.fn.stdpath("state"), "notes-tags") local follow = require("dotfiles.follow") @@ -199,7 +199,7 @@ end -- Returns a note's path relative to the notes dir, without `.md`, or nil if not a note. local function note_rel_path(path) - local prefix = vim.fs.normalize(notes_dir) .. "/" + local prefix = notes_dir .. "/" path = vim.fs.normalize(path) if not vim.startswith(path, prefix) then return nil |
