diff --git a/ftplugin/org.lua b/ftplugin/org.lua index 078e4ce07..bbecc4fc6 100644 --- a/ftplugin/org.lua +++ b/ftplugin/org.lua @@ -24,7 +24,7 @@ vim.bo.modeline = false vim.opt_local.fillchars:append('fold: ') vim.opt_local.foldmethod = 'expr' vim.opt_local.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -if utils.has_version_10() and config.ui.folds.colored then +if config.ui.folds.colored then vim.opt_local.foldtext = '' else vim.opt_local.foldtext = 'v:lua.require("orgmode.org.indent").foldtext()' diff --git a/lua/orgmode/colors/highlighter/foldtext.lua b/lua/orgmode/colors/highlighter/foldtext.lua index 96761f297..c66295747 100644 --- a/lua/orgmode/colors/highlighter/foldtext.lua +++ b/lua/orgmode/colors/highlighter/foldtext.lua @@ -6,7 +6,6 @@ local utils = require('orgmode.utils') ---@class OrgFoldtextHighlighter ---@field highlighter OrgHighlighter ---@field namespace number ----@field enabled number ---@field cache table> local OrgFoldtext = {} @@ -14,7 +13,6 @@ local OrgFoldtext = {} function OrgFoldtext:new(opts) local data = { highlighter = opts.highlighter, - enabled = utils.has_version_10(), cache = setmetatable({}, { __mode = 'k' }), } setmetatable(data, self) @@ -39,10 +37,6 @@ function OrgFoldtext:_highlight(bufnr, line, value) end function OrgFoldtext:on_line(bufnr, line) - if not self.enabled then - return false - end - local is_current_buf = bufnr == vim.api.nvim_get_current_buf() if not is_current_buf then diff --git a/lua/orgmode/colors/highlights.lua b/lua/orgmode/colors/highlights.lua index 536a367d1..3a5da821f 100644 --- a/lua/orgmode/colors/highlights.lua +++ b/lua/orgmode/colors/highlights.lua @@ -70,43 +70,6 @@ function M.link_highlights() ['@org.edit_src'] = 'Visual', } - if not utils.has_version_10() then - links = vim.tbl_extend('force', links, { - ['@org.priority.highest'] = 'Error', - ['@org.timestamp.active'] = 'PreProc', - ['@org.timestamp.inactive'] = 'Comment', - ['@org.bullet'] = 'Identifier', - ['@org.checkbox'] = 'PreProc', - ['@org.checkbox.halfchecked'] = 'PreProc', - ['@org.checkbox.checked'] = 'PreProc', - ['@org.properties'] = 'Constant', - ['@org.properties.name'] = 'Constant', - ['@org.drawer'] = 'Constant', - ['@org.tag'] = 'Function', - ['@org.plan'] = 'Constant', - ['@org.comment'] = 'Comment', - ['@org.directive'] = 'Comment', - ['@org.block'] = 'Comment', - ['@org.latex'] = 'Statement', - ['@org.latex_env'] = 'Statement', - ['@org.hyperlink'] = 'Underlined', - ['@org.code'] = 'String', - ['@org.code.delimiter'] = 'String', - ['@org.verbatim'] = 'String', - ['@org.verbatim.delimiter'] = 'String', - ['@org.bold'] = { bold = true }, - ['@org.bold.delimiter'] = { bold = true }, - ['@org.italic'] = { italic = true }, - ['@org.italic.delimiter'] = { italic = true }, - ['@org.strikethrough'] = { strikethrough = true }, - ['@org.strikethrough.delimiter'] = { strikethrough = true }, - ['@org.underline'] = { underline = true }, - ['@org.underline.delimiter'] = { underline = true }, - ['@org.table.delimiter'] = '@punctuation', - ['@org.table.heading'] = '@function', - }) - end - for src, def in pairs(links) do if type(def) == 'table' then def.default = true diff --git a/lua/orgmode/org/indent.lua b/lua/orgmode/org/indent.lua index 987616bcd..2bf6f7fc2 100644 --- a/lua/orgmode/org/indent.lua +++ b/lua/orgmode/org/indent.lua @@ -323,10 +323,6 @@ local function foldtext() end local function setup_virtual_indent() - if not utils.has_version_10() then - return - end - local virtualIndent = VirtualIndent:new() if config.org_startup_indented or vim.b.org_indent_mode then diff --git a/lua/orgmode/utils/init.lua b/lua/orgmode/utils/init.lua index 8b1378435..e7174a7c0 100644 --- a/lua/orgmode/utils/init.lua +++ b/lua/orgmode/utils/init.lua @@ -557,11 +557,6 @@ function utils.edit_file(filename) } end -function utils.has_version_10() - local v = vim.version() - return not vim.version.lt({ v.major, v.minor, v.patch }, { 0, 10, 0 }) -end - ---@generic EntryType : any ---@param entries EntryType[] ---@param check_fn fun(entry: EntryType, index: number): boolean