]> git.r.bdr.sh - rbdr/tree-sitter-api-notation/commitdiff
Use the plugin dir
authorRuben Beltran del Rio <redacted>
Wed, 4 Oct 2023 14:27:55 +0000 (16:27 +0200)
committerRuben Beltran del Rio <redacted>
Wed, 4 Oct 2023 14:27:55 +0000 (16:27 +0200)
lua/tree-sitter-api-notation.lua

index 223958a163760bcfb3098249723704b341468d7d..184cb573548ab36bd7b02db27fc496bf9514985e 100644 (file)
@@ -2,10 +2,12 @@
 local M = {}
 
 function M.setup()
+  local config_file_path = debug.getinfo(1).source:sub(2)
+  local plugin_dir = vim.fn.fnamemodify(config_file_path, ':h:h')
   local parser_config = require 'nvim-treesitter.parsers'.get_parser_configs()
   parser_config.api_notation = {
     install_info = {
-      url = vim.fn.expand('%:p:h:h'),
+      url = plugin_dir,
       files = {'src/parser.c'},
       branch = 'main'
     }