neorg icon indicating copy to clipboard operation
neorg copied to clipboard

Folds don't work right away with Neorg index

Open trev-dev opened this issue 1 year ago • 3 comments

Prerequisites

  • [X] I am using the latest stable release of Neovim
  • [X] I am using the latest version of the plugin

Neovim Version

NVIM v0.9.0

Neorg setup

(module config.plugin.neorg)

(let [n (require :neorg)]
  (n.setup {:load {:core.defaults {}
                   :core.export {}
                   :core.highlights {}
                   :core.integrations.treesitter {}
                   :core.journal {:config {:strategy "flat"}}
                   :core.mode {}
                   :core.neorgcmd {}
                   :core.completion {:config {:engine "nvim-cmp"}}
                   :core.concealer {:config {:icon_preset "diamond"}}
                   :core.dirman {:config
                                 {:workspaces
                                  {:personal "~/Notes/personal/"
                                   :work "~/Notes/work/"}
                                  :default_workspace "personal"}}}}))

(let [au vim.api.nvim_create_autocmd
      augrp vim.api.nvim_create_augroup
      lo vim.opt_local]
  (au [:FileType] {:group (augrp :NorgConceal {:clear true})
                   :pattern "norg"
                   :callback (λ []
                               (set lo.colorcolumn "0")
                               (set lo.conceallevel 2)
                               (set lo.foldlevel 99))}))

(let [map vim.keymap.set]
  (map :n :<leader>o ":Neorg<CR>" {:desc "Neorg"}))

Actual behavior

Folds cannot be toggled after navigating to Neorg index. They do work if you edit a norg file directly or refresh the buffer with :e

Expected behavior

Be able to fold/unfold right after using Neorg index

Steps to reproduce

  1. Open Neovim
  2. :Neorg index<CR>
  3. Attempt to collapse/open folds with zc and zo

Potentially conflicting plugins

:shrug

Other information

No response

Help

Yes

Implementation help

Not sure I need any, but a push in the right direction never hurts.

trev-dev avatar May 03 '23 06:05 trev-dev