Skip to content

Commit 50d1a97

Browse files
[NOTICE] Add warning about tree-sitter branch becoming master soon.
1 parent 7592652 commit 50d1a97

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616

1717
## Tree-sitter
1818
Tree-sitter support branch: https://github.com/kristijanhusak/orgmode.nvim/tree/tree-sitter
19-
#### NOTE: tree-sitter branch will become main very soon!
20-
All new features and fixes are going to the `tree-sitter` branch.
19+
#### Tree-sitter branch will become main very soon!
20+
To remove warning message, you can do two things:
21+
1. Temporarily switch to the [tree-sitter](https://github.com/kristijanhusak/orgmode.nvim/tree/tree-sitter) branch
22+
2. Stay on master branch and install [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) and [tree-sitter-org grammar](https://github.com/milisims/tree-sitter-org). More info here: https://github.com/kristijanhusak/orgmode.nvim/tree/tree-sitter#setup.
2123

2224
## Installation
2325

lua/orgmode/init.lua

+13
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function Org:new()
1414
setmetatable(data, self)
1515
self.__index = self
1616
data:setup_autocmds()
17+
vim.defer_fn(data.notify_update, 200)
1718
return data
1819
end
1920

@@ -47,6 +48,18 @@ function Org:setup_autocmds()
4748
vim.cmd([[augroup END]])
4849
end
4950

51+
function Org:notify_update()
52+
local success, _ = pcall(vim.treesitter.inspect_language, 'org')
53+
if success then
54+
return
55+
end
56+
local msg = {
57+
'[orgmode] Master branch will soon require tree-sitter support.',
58+
'To remove this message, see https://github.com/kristijanhusak/orgmode.nvim/tree/master#tree-sitter.',
59+
}
60+
vim.notify(table.concat(msg, '\n'), vim.log.levels.WARN)
61+
end
62+
5063
---@param opts? table
5164
---@return Org
5265
local function setup(opts)

0 commit comments

Comments
 (0)