nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3.04k stars 134 forks source link

OrgTSTag highlight group should include the surrounding colons #423

Closed maxmahlke closed 2 years ago

maxmahlke commented 2 years ago

Describe the bug

The OrgTSTag highlight group allows to make tags less prominent, yet it does not include the surrounding :. In org, they are included.

Steps to reproduce

Actually, with the minimal_init.lua, I do not get any tag highlighting. I added vim.cmd([[highlight OrgTSTag gui=underline]]) but it does not add any highlighting.

I'm attaching a screenshot from my config.

Expected behavior

The surrounding : should match the style of the tag text.

Emacs functionality

No response

Minimal init.lua

vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])

local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'

local function load_plugins()
  require('packer').startup({
    {
      'wbthomason/packer.nvim',
      { 'nvim-treesitter/nvim-treesitter' },
      { 'kristijanhusak/orgmode.nvim', branch = 'master' },
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
    },
  })
end

_G.load_config = function()
  require('orgmode').setup_ts_grammar()
  require('nvim-treesitter.configs').setup({
    highlight = {
      enable = true,
      additional_vim_regex_highlighting = { 'org' },
    },
  })

  vim.cmd([[packadd nvim-treesitter]])
  vim.cmd([[runtime plugin/nvim-treesitter.lua]])
  vim.cmd([[TSUpdateSync org]])

  -- Close packer after install
  if vim.bo.filetype == 'packer' then
    vim.api.nvim_win_close(0, true)
  end

  require('orgmode').setup()

  -- Reload current file if it's org file to reload tree-sitter
  if vim.bo.filetype == 'org' then
    vim.cmd([[edit!]])
    vim.cmd([[highlight OrgTSTag gui=underline]])
  end
end

if vim.fn.isdirectory(install_path) == 0 then
  vim.fn.system({ 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path })
  load_plugins()
  require('packer').sync()
  vim.cmd([[autocmd User PackerCompileDone ++once lua load_config()]])
else
  load_plugins()
  load_config()
end

Screenshots and recordings

Screenshot from 2022-10-13 19-52-44

OS / Distro

Pop OS Linux

Neovim version/commit

NVIM v0.9.0-dev-72-gc5347d47e

Additional context

No response

jgollenz commented 2 years ago

@maxmahlke could you please try if this fixes the issue?

maxmahlke commented 2 years ago

It works! Thanks for the quick fix!