nvim-neorg / neorg

Modernity meets insane extensibility. The future of organizing your life in Neovim.
GNU General Public License v3.0
6.49k stars 213 forks source link

Inline markup not working #1461

Closed VictorLemosR closed 4 months ago

VictorLemosR commented 5 months ago

Prerequisites

Neovim Version

0.10

Neorg setup

Lazy config

    "nvim-neorg/neorg",
    dependencies = { "luarocks.nvim" },
    lazy = false,
    version = "*",
    config = function ()
        local paths = require("victor.paths")
        local notes_folder = paths.notes_folder
        require("neorg").setup {
            load = {
                ["core.defaults"] = {},
                ["core.concealer"] = {
                    config = {
                        folds = true,
--                        icon_preset = "basic",
--                        init_open_folds = "always"
                    },
                },
        }
     end

Neorg configs inside ftplugin:

vim.opt_local.wrap = true
vim.opt_local.colorcolumn = "120"
vim.opt_local.textwidth = 120
vim.opt_local.spelllang = 'pt,en_us'
vim.opt_local.expandtab = false
vim.opt_local.foldenable = true
vim.opt_local.conceallevel = 2
vim.opt_local.concealcursor = "nv"

Treesitter lazy config:

    { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
    { 'nvim-treesitter/playground' },
    { 'nvim-treesitter/nvim-treesitter-context' },

    config = function ()
        require'nvim-treesitter.configs'.setup {
            ensure_installed = { "python", "lua", "query", "rust", "norg" },

            -- Install parsers synchronously (only applied to `ensure_installed`)
            sync_install = true,

            -- Automatically install missing parsers when entering buffer
            -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
            auto_install = true,

            highlight = {
                enable = true,
                additional_vim_regex_highlighting = false,
            },
        }

    end

My colorscheme config:

    {"sainnhe/sonokai", priority = 1000, lazy = false,
    config = function()
        -- check for other colors, they are all good
        vim.g.sonokai_style = "andromeda"
        vim.g.sonokai_better_performance = 1
        vim.g.sonokai_colors_override = {
            yellow = {'#d5b359', '107'},
        }
        vim.cmd('colorscheme sonokai')

    end

Actual behavior

Heading's formats works: image Inline markups don't: image

As a side bug, To-do hotkeys don't work: or td, for example

Expected behavior

To work.

Steps to reproduce

  1. Installation was done via lazy.
  2. My terminal is wezterm
  3. I'm on windows
  4. Neovim 0.10
  5. Latest neorg (8.7.0 - even updated to the lastest version launched today 11-jun).

Other information

What I checked/tried:

  1. Treesitter highlight is enabled.
  2. Bold and itallic works in .md: image
  3. Checkhealth does not show any error and says concealer is ok: image
ha5h6r000wn commented 4 months ago

same here, can somebody fix it?

max397574 commented 4 months ago

try :Inspect when you're on it with the cursor and send the output @ha5h6r000wn are you sure you have the same setup? conceallevel set, concealer module loaded, treesitter highlighting enabled? those are common issues for this

ha5h6r000wn commented 4 months ago

sorry ,i missed out the line "vim.wo.conceallevel = 2", now it looks good?

image

Still, i find that the todo-item icons seems not aligned to the center. Is there any config to solve this issue? @max397574

max397574 commented 4 months ago

no this just depends on your terminal and font

VictorLemosR commented 4 months ago

try :Inspect when you're on it with the cursor and send the output @ha5h6r000wn are you sure you have the same setup? conceallevel set, concealer module loaded, treesitter highlighting enabled? those are common issues for this

Tried inspect as you asked: image

Tried in another place just to see if anything is working. Cursor at "(x)": image

max397574 commented 4 months ago

both of these seem completely wrong The first one just seems like treesitter isn't attached correctly or sth (try :InspectTree) the second one either seems like a really bad bug or a mistake on your side could you send the whole code snippet for the second one?

VictorLemosR commented 4 months ago

For the first one with :InspectTree image

For the second one, here is the full photo: image

max397574 commented 4 months ago

well the second one is correct then afaik injecting neorg into itself doesn't work

the first one seems really weird though because the syntax tree looks correct but just no highlights are applied

enck commented 4 months ago

@VictorLemosR: I had a very similar issue of bold, italic, and links. not working, but headings did work. After running :TSConfigInfo, I discovered that my treesitter config wasn't being read properly. Specifically, I noticed that modules.highlight.enabled was false, despite it being true in my config. Fixed my treesitter config to actually load, caused bold, italic, and links to started working.

Looking at your config above, the config = function() line for your nvim-treesitter config comes after the } of the nvim-treesitter-context package specification. I'm guessing your config isn't being loaded.

VictorLemosR commented 4 months ago

@VictorLemosR: I had a very similar issue of bold, italic, and links. not working, but headings did work. After running :TSConfigInfo, I discovered that my treesitter config wasn't being read properly. Specifically, I noticed that modules.highlight.enabled was false, despite it being true in my config. Fixed my treesitter config to actually load, caused bold, italic, and links to started working.

Looking at your config above, the config = function() line for your nvim-treesitter config comes after the } of the nvim-treesitter-context package specification. I'm guessing your config isn't being loaded.

Thank you! That was exactly it. As you suggested, :TSConfigInfo showed my modules.highlight.enable was false. I just changed the initialization of my config for treesitter to the end of my initialization and it worked