Skip to content

Commit ac78216

Browse files
chore: Remove backward compatibility for Neovim < 0.10.0
1 parent 271a6fa commit ac78216

File tree

5 files changed

+1
-53
lines changed

5 files changed

+1
-53
lines changed

ftplugin/org.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ vim.bo.modeline = false
2424
vim.opt_local.fillchars:append('fold: ')
2525
vim.opt_local.foldmethod = 'expr'
2626
vim.opt_local.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
27-
if utils.has_version_10() and config.ui.folds.colored then
27+
if config.ui.folds.colored then
2828
vim.opt_local.foldtext = ''
2929
else
3030
vim.opt_local.foldtext = 'v:lua.require("orgmode.org.indent").foldtext()'

lua/orgmode/colors/highlighter/foldtext.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ local utils = require('orgmode.utils')
66
---@class OrgFoldtextHighlighter
77
---@field highlighter OrgHighlighter
88
---@field namespace number
9-
---@field enabled number
109
---@field cache table<number, table<number, OrgFoldtextLineValue>>
1110
local OrgFoldtext = {}
1211

1312
---@param opts { highlighter: OrgHighlighter }
1413
function OrgFoldtext:new(opts)
1514
local data = {
1615
highlighter = opts.highlighter,
17-
enabled = utils.has_version_10(),
1816
cache = setmetatable({}, { __mode = 'k' }),
1917
}
2018
setmetatable(data, self)
@@ -39,10 +37,6 @@ function OrgFoldtext:_highlight(bufnr, line, value)
3937
end
4038

4139
function OrgFoldtext:on_line(bufnr, line)
42-
if not self.enabled then
43-
return false
44-
end
45-
4640
local is_current_buf = bufnr == vim.api.nvim_get_current_buf()
4741

4842
if not is_current_buf then

lua/orgmode/colors/highlights.lua

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -70,43 +70,6 @@ function M.link_highlights()
7070
['@org.edit_src'] = 'Visual',
7171
}
7272

73-
if not utils.has_version_10() then
74-
links = vim.tbl_extend('force', links, {
75-
['@org.priority.highest'] = 'Error',
76-
['@org.timestamp.active'] = 'PreProc',
77-
['@org.timestamp.inactive'] = 'Comment',
78-
['@org.bullet'] = 'Identifier',
79-
['@org.checkbox'] = 'PreProc',
80-
['@org.checkbox.halfchecked'] = 'PreProc',
81-
['@org.checkbox.checked'] = 'PreProc',
82-
['@org.properties'] = 'Constant',
83-
['@org.properties.name'] = 'Constant',
84-
['@org.drawer'] = 'Constant',
85-
['@org.tag'] = 'Function',
86-
['@org.plan'] = 'Constant',
87-
['@org.comment'] = 'Comment',
88-
['@org.directive'] = 'Comment',
89-
['@org.block'] = 'Comment',
90-
['@org.latex'] = 'Statement',
91-
['@org.latex_env'] = 'Statement',
92-
['@org.hyperlink'] = 'Underlined',
93-
['@org.code'] = 'String',
94-
['@org.code.delimiter'] = 'String',
95-
['@org.verbatim'] = 'String',
96-
['@org.verbatim.delimiter'] = 'String',
97-
['@org.bold'] = { bold = true },
98-
['@org.bold.delimiter'] = { bold = true },
99-
['@org.italic'] = { italic = true },
100-
['@org.italic.delimiter'] = { italic = true },
101-
['@org.strikethrough'] = { strikethrough = true },
102-
['@org.strikethrough.delimiter'] = { strikethrough = true },
103-
['@org.underline'] = { underline = true },
104-
['@org.underline.delimiter'] = { underline = true },
105-
['@org.table.delimiter'] = '@punctuation',
106-
['@org.table.heading'] = '@function',
107-
})
108-
end
109-
11073
for src, def in pairs(links) do
11174
if type(def) == 'table' then
11275
def.default = true

lua/orgmode/org/indent.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,6 @@ local function foldtext()
323323
end
324324

325325
local function setup_virtual_indent()
326-
if not utils.has_version_10() then
327-
return
328-
end
329-
330326
local virtualIndent = VirtualIndent:new()
331327

332328
if config.org_startup_indented or vim.b.org_indent_mode then

lua/orgmode/utils/init.lua

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,6 @@ function utils.edit_file(filename)
557557
}
558558
end
559559

560-
function utils.has_version_10()
561-
local v = vim.version()
562-
return not vim.version.lt({ v.major, v.minor, v.patch }, { 0, 10, 0 })
563-
end
564-
565560
---@generic EntryType : any
566561
---@param entries EntryType[]
567562
---@param check_fn fun(entry: EntryType, index: number): boolean

0 commit comments

Comments
 (0)