From 3461be4d2d880293c92bc7b4119ba53289ef03cc Mon Sep 17 00:00:00 2001 From: moxie Date: Sat, 14 Mar 2026 04:28:05 +0200 Subject: refactor: simplify wiki discovery functions --- lua/muwiki/links/creation.lua | 2 +- lua/muwiki/links/open.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lua/muwiki/links') diff --git a/lua/muwiki/links/creation.lua b/lua/muwiki/links/creation.lua index 0b31b10..81c45a6 100644 --- a/lua/muwiki/links/creation.lua +++ b/lua/muwiki/links/creation.lua @@ -52,7 +52,7 @@ function M.create_link() vim.api.nvim_buf_set_text(0, start_row, start_col, end_row, end_col, { link_text }) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('', true, false, true), 'n', false) - local wiki_root = config.get_wiki_root_for_file(vim.api.nvim_buf_get_name(0)) + local wiki_root = config.wiki_root(0) if not wiki_root then vim.notify('Not in a wiki buffer', vim.log.levels.ERROR) return diff --git a/lua/muwiki/links/open.lua b/lua/muwiki/links/open.lua index 5afec53..c8a1233 100644 --- a/lua/muwiki/links/open.lua +++ b/lua/muwiki/links/open.lua @@ -7,7 +7,7 @@ local url_handlers = require('muwiki.links.url_handlers') local M = {} local function get_wiki_root_or_notify() - local wiki_root = config.get_wiki_root_for_buffer(0) + local wiki_root = config.wiki_root(0) if not wiki_root then vim.notify('Not in a wiki buffer', vim.log.levels.ERROR) return nil -- cgit v1.2.3