From 08515829b29ec518c7d8459a9c35b28ac5d9f168 Mon Sep 17 00:00:00 2001 From: pysan3 Date: Fri, 22 Mar 2024 05:20:41 +0900 Subject: [PATCH] fix(base): return self from `to_absolute` for easier chaining --- lua/pathlib/base.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/pathlib/base.lua b/lua/pathlib/base.lua index 3b9d2c0..d4b588f 100644 --- a/lua/pathlib/base.lua +++ b/lua/pathlib/base.lua @@ -414,11 +414,12 @@ end ---@param cwd PathlibPath|nil # If passed, this is used instead of `vim.fn.getcwd()`. function Path:to_absolute(cwd) if self:is_absolute() then - return + return self end local new = self.new(cwd or vim.fn.getcwd(), self) self._raw_paths:clear() self:copy_all_from(new) + return self end ---Get the path being modified with `filename-modifiers`