소스 검색

fix(bootstrap): override stdpath when called through nvim_call_function

opalmay 2 년 전
부모
커밋
bc2bb3c0eb
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      lua/lvim/bootstrap.lua

+ 7 - 0
lua/lvim/bootstrap.lua

@@ -73,6 +73,13 @@ function M:init(base_dir)
     return vim.call("stdpath", what)
     return vim.call("stdpath", what)
   end
   end
 
 
+  vim.api.nvim_call_function = function(fn, args)
+    if fn == "stdpath" then
+      return vim.fn.stdpath(args[1])
+    end
+    return vim.call(fn, unpack(args))
+  end
+
   ---Get the full path to LunarVim's base directory
   ---Get the full path to LunarVim's base directory
   ---@return string
   ---@return string
   function _G.get_lvim_base_dir()
   function _G.get_lvim_base_dir()