From fc336b75c5198e33beacab59d448875c30cf07b8 Mon Sep 17 00:00:00 2001 From: gh-liu Date: Thu, 23 May 2024 10:08:41 +0800 Subject: [PATCH] feat: use relative path for a better initial view in `:buffers` --- lua/grapple/tag.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/grapple/tag.lua b/lua/grapple/tag.lua index 56c0097..456e7ab 100644 --- a/lua/grapple/tag.lua +++ b/lua/grapple/tag.lua @@ -25,7 +25,9 @@ function Tag:select(command) local app = require("grapple").app() command = command or app.settings.command - command(self.path) + -- Use relative path for a better initial view in `:buffers` + local path_norm = vim.fn.fnameescape(vim.fn.fnamemodify(self.path, ":.")) + command(path_norm) if self.cursor then local current_cursor = vim.api.nvim_win_get_cursor(0)