Skip to content

Commit 6c8ec4e

Browse files
Make ts grammar revision private variable. Fixes #222.
1 parent 14df439 commit 6c8ec4e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lua/orgmode/init.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
_G.orgmode = _G.orgmode or {
2-
ts_revision = '1c3eb533a9cf6800067357b59e03ac3f91fc3a54',
3-
}
1+
_G.orgmode = _G.orgmode or {}
2+
local ts_revision = '1c3eb533a9cf6800067357b59e03ac3f91fc3a54'
43
local setup_ts_grammar_used = false
54
local instance = nil
65

@@ -68,7 +67,7 @@ local function setup_ts_grammar(revision)
6867
parser_config.org = {
6968
install_info = {
7069
url = 'https://github.com/milisims/tree-sitter-org',
71-
revision = revision or _G.orgmode.ts_revision,
70+
revision = revision or ts_revision,
7271
files = { 'src/parser.c', 'src/scanner.cc' },
7372
},
7473
filetype = 'org',
@@ -81,7 +80,7 @@ local function check_ts_grammar()
8180
end
8281
vim.defer_fn(function()
8382
local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
84-
if parser_config and parser_config.org and parser_config.org.install_info.revision ~= _G.orgmode.ts_revision then
83+
if parser_config and parser_config.org and parser_config.org.install_info.revision ~= ts_revision then
8584
require('orgmode.utils').echo_error({
8685
'You are using outdated version of tree-sitter grammar for Orgmode.',
8786
'To use latest version, replace current grammar installation with "require(\'orgmode\').setup_ts_grammar()" and run :TSUpdate org.',

0 commit comments

Comments
 (0)