Skip to content

Links in Logbook are not concealed #353

@cands

Description

@cands

Describe the bug

Links that are put inside the Logbook are not concealed.

Steps to reproduce

Using the below minimal test file with minimal_init.lua shows that the links in the Logbook are not concealed, whereas links outside the Logbook are concealed (see also screenshots below).

* TODO test
  :PROPERTIES:
  :CUSTOM_ID: 20220626-150132742653-test
  :END:
  :LOGBOOK:
  - Note taken on [2022-06-26 Sun 15:13] \\
    [[hook://file/EYu30fFFa?p=Y2FuZHN0ZWYvRGVza3RvcA==&n=test%2Emd][test.md]]
    [[https://github.com/nvim-orgmode/orgmode][nvim-orgmode/orgmode: Orgmode clone written in Lua for Neovim 0.7+.]]
    [[file:test.org::#20220626-150132742653-test][test]]
  :END:
  [[hook://file/EYu30fFFa?p=Y2FuZHN0ZWYvRGVza3RvcA==&n=test%2Emd][test.md]]
  [[https://github.com/nvim-orgmode/orgmode][nvim-orgmode/orgmode: Orgmode clone written in Lua for Neovim 0.7+.]]
  [[file:test.org::#20220626-150132742653-test][test]]

Expected behavior

Conceal also links inside the Logbook.

Emacs functionality

Links inside the Logbook are concealed.

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!]])
  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

Neovim:
20220626_151359_screenshot_Neovim

Emacs:
20220626_151435_screenshot_Emacs

OS / Distro

macOS 12.4

Neovim version/commit

Neovim 0.7.0 / nvim-orgmode commit 3186ac3

Additional context

I use the Logbook extensively and use both internal and external links as references. The links are not concealed in nvim-orgmode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions