Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neorg markup no longer renders after 8.0.0 #1374

Closed
Tvrt1e opened this issue Apr 1, 2024 Discussed in #1373 · 20 comments
Closed

Neorg markup no longer renders after 8.0.0 #1374

Tvrt1e opened this issue Apr 1, 2024 Discussed in #1373 · 20 comments

Comments

@Tvrt1e
Copy link

Tvrt1e commented Apr 1, 2024

Discussed in #1373

Originally posted by Tvrt1e March 31, 2024
nvim ver:
NVIM v0.10.0-dev-2785+gfeaab21c7
Build type: RelWithDebInfo
LuaJIT 2.1.1710088188
Nothing in neorg log.(since reinstalling)
Main branch
Modlues:

  • core.concealer
  • core.keybinds.keybinds
  • core.clipboard
  • core.clipboard.code-blocks
  • core.esupports.hop
  • core.esupports.indent
  • core.esupports.metagen
  • core.integrations.treesitter
  • core.itero
  • core.journal
  • core.defaults
  • core.mode
  • core.dirman
  • core.neorgcmd.commands.return
  • core.autocommands
  • core.ui
  • core.storage
  • core.dirman.utils
  • core.keybinds
  • core.concealer.preset_diamond
  • core.ui.text_popup
  • core.concealer.preset_varied
  • core.concealer.preset_basic
  • core.neorgcmd
  • core.tangle
  • core.qol.todo_items
  • core.qol.toc
  • core.promo
  • core.pivot
  • core.highlights
  • core.ui.selection_popup
  • core.looking-glass
    Just to make sure I uninstalled all other nvim plugins and reverted changes to init.vim since installing neorg. After reverting these changes I got the same behavior.
    Steps to reproduce:
  1. Install neorg via :Rocks install neorg
  2. Make nvim/lua/plugins/neorg.lua
  3. Paste basic config(shown below)
  4. Open a .norg file with neorg markdown syntax

:Neorg works fine so the plugin is installed, but in .norg files no Neorg features work except for a few. I installed neorg using vim-plug, so I removed it and installed via rocks.nvim, but still nothing worked. Any ideas as to why? Maybe I misunderstood the configuration.
Example:
Neorg-help

neorg.lua:

require('neorg').setup {
    load = {
        ["core.defaults"] = {}, 
        ["core.concealer"] = {}, 
        ["core.dirman"] = { 
            config = {
                workspaces = {
                    notes = "~/Documents/notes",
                },
            },
        },
    },
}

notes:
I reverted to 7.0.0 and got the same behavior.
When removing core.concealer everything including headers become plain text regardless of cursor position.

@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker Apr 1, 2024
@Tvrt1e Tvrt1e changed the title Neorg markup no longer works after 8.0.0 Neorg markup no longer renders after 8.0.0 Apr 1, 2024
@max397574
Copy link
Contributor

do you 1. have a colorscheme installed and 2. have conceallevel set correctly?

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 1, 2024

  1. Yes I do, but as stated I got rid of it just to make sure it wasn't the issue, and it was not.
  2. :set conceallevel=3 changes nothing. Also as I understand it, the basic functionality of neorg should work fine without the concealer module. I will note that what I said in my issue was the wrong way around. I get no rendering whatsoever without concealer, but with concealer I only get headers.

@max397574
Copy link
Contributor

well regarding the colorscheme
neorg doesn't define the highlights it uses
it just links to some normally defined by a colorscheme so you actually need one

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 1, 2024

So could my issue have something to do with my colorscheme as opposed to neorg itself?

@Drew-Daniels
Copy link

I started noticing the same issue maybe a few days ago. Not sure what could have changed, but fwiw, I'm still using lazy as my PM and have the following configuration as recommended in the docs (and which was working for awhile):

{
  "vhyrro/luarocks.nvim",
  priority = 1000,
  config = true,
},
{
  "nvim-neorg/neorg",
  dependencies = { "luarocks.nvim" },
  lazy = false,
  version = "*",
  config = true,
},

I've tried running :Neorg sync-parsers to see if that fixes the issue, and it runs, but still get the same result:

image

image

image

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 2, 2024

I decided to switch to lazy.nvim because I fell like I've tried everything else, and I'm getting the exact same behavior as I was using rocks.nvim.
Drew-Daniels I think our problems are a bit different. When I type headers they render like normal but the text itself does not change from plain text. Your text is changing color as it should but the markdown isn't being concealed.

@TheLeoP
Copy link
Contributor

TheLeoP commented Apr 2, 2024

@Tvrt1e use :Inspect on any part of the document that should be highlighted to check which highlight groups are being applied.

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 3, 2024

@TheLeoP :Inspect on text returns No items found at position 25,5, in buffer 1(text surrounded by asterisks).

@TheLeoP
Copy link
Contributor

TheLeoP commented Apr 3, 2024

@Tvrt1e What does :InspectTree show?

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 3, 2024

@TheLeoP :InspectTree shows (bold)))) ; [25, 5] - [25, 11].

@TheLeoP
Copy link
Contributor

TheLeoP commented Apr 3, 2024

@Tvrt1e is that the whole output? For me, with a document containing only *algo*, it shows the following (take into account that I pressed I to show which parser is producing which parts of the tree):

(document ; [0, 0] - [1, 0] norg
  (paragraph ; [0, 0] - [1, 0] norg
    (paragraph_segment ; [0, 0] - [0, 6] norg
      (bold)))) ; [0, 0] - [0, 6] norg

Are both norg and norg_meta treesitter parsers installed correctly? Does your local installation of neorg not contain queries/norg/highlights.scm or queries/norg_meta/highlights.scm for some reason?

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 3, 2024

Sorry I just pasted the line that was highlighted when I ran the command. If I make a .norg file with only *algo* I get this:

(document ; [0, 0] - [1, 0]
  (paragraph ; [0, 0] - [1, 0]
    (paragraph_segment ; [0, 0] - [0, 6]
      (bold)))) ; [0, 0] - [0, 6]

I have on my system both norg and norg_meta treesitter parsers and highlights.scm for both.

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 3, 2024

As a note after switching to lazy.nvim horizontal lines now also work, (they didn't before.) So any syntax that changes the form/appearance of text works, but any syntax that keeps the text but changes its quality(color, etc.) does not work.

@pysan3
Copy link
Contributor

pysan3 commented Apr 4, 2024

BTW will :e! apply highlights by any chance? If it does, it'll be easier to spot the problem.

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 4, 2024

:e! does nothing.

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 4, 2024

Reverting to 7.0.0 fixes the issue entirely. Still would like to see this figured out so that I can keep up to date in the future.

@vhyrro
Copy link
Member

vhyrro commented Apr 6, 2024

@Drew-Daniels your issue stems from the fact that you're invoking config = true (which does not load the concealer by default). The concealer module has to be enabled separately :)

@Tvrt1e it really does seem like there's some sort of issue on your end. Are you lazy loading nvim-treesitter in any way? What if you make nvim-treesitter a dependency of Neorg? I.e:

{
    "nvim-neorg/neorg",
    dependencies = { "nvim-treesitter" },
    -- rest of config goes here
}

Post 8.0 we did remove a snippet related to highlighting. It was a very hacky bit of code that tried forcefully restarting nvim-treesitter's highlight cache to get things to display just in case. We can't rely on such hacks in our codebase though, and thus decided to remove it. The root cause of things not being displayed properly are either:

  • The colourscheme isn't loaded on time (give your colourscheme a high priority in lazy.nvim to make it work) OR the colourscheme isn't being loaded at all.
  • nvim-treesitter is being loaded too late (tbh this is unlikely)\

I haven't found any way of reproducing your issues though which makes the situation harder than it otherwise would be 😅

@Tvrt1e
Copy link
Author

Tvrt1e commented Apr 6, 2024

I did install neorg with the treesitter dependency, and at the time I was still using vim-plug for my colorscheme. Yesterday I started using the kickstart.nvim config and after updating neorg to the latest version it worked just fine. The issue was likely that I called my colorscheme after loading lazy plugins. Thank you.

@Tvrt1e Tvrt1e closed this as completed Apr 6, 2024
@github-project-automation github-project-automation bot moved this from added-updated-reopened to done in sorting neorg issue tracker Apr 6, 2024
@vhyrro
Copy link
Member

vhyrro commented Apr 6, 2024

Awesome, happy to hear it got resolved! :)

@Drew-Daniels
Copy link

Thanks @vhyrro ! That was exactly it. I had followed the docs after the luarocks change and had forgotten was setting config did 🤦🏻‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants