Skip to content

Commit

Permalink
Fix ZK detection
Browse files Browse the repository at this point in the history
  • Loading branch information
zmre committed Dec 16, 2024
1 parent 8872f99 commit c616a8a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pwnvim/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,17 @@ end

M.newGeneralNote = function()
local zk = require("zk.commands")
local zkfolder = require("zk.util").resolve_notebook_path(0)
local zkfolder = require("zk.util").notebook_root(vim.api.nvim_buf_get_name(0))
local subdir = ""
if vim.fn.isdirectory(zkfolder .. "/Notes") == 1 then
if not zkfolder then
zkfolder = vim.env.ZK_NOTEBOOK_DIR
subdir = 'Notes'
elseif vim.fn.isdirectory(zkfolder .. "/content") == 1 then
subdir = "content"
else
if vim.fn.isdirectory(zkfolder .. "/Notes") == 1 then
subdir = 'Notes'
elseif vim.fn.isdirectory(zkfolder .. "/content") == 1 then
subdir = "content"
end
end

M.telescope_get_folder_and_title(zkfolder, subdir, function(folder, title)
Expand Down

0 comments on commit c616a8a

Please sign in to comment.