Skip to content

Spell checker does not work on list item #175

@gzagatti

Description

@gzagatti

Describe the bug

Misspelled words in list items do not get highlighted.

Steps to reproduce

Write a misspelled word in a list item:

The following list contains misspelled items:

- hello, asd is not highlighted
-  bar

The following misspelled word asd is highlighted.

Expected behavior

That the misspelled word is highlighted.

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', run = ':TSUpdate'},
      {'kristijanhusak/orgmode.nvim', branch = 'master' },
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
    },
  }
end

_G.load_config = function()
  local parser_config = require('nvim-treesitter.parsers').get_parser_configs()

  parser_config.org = {
    install_info = {
      url = 'https://github.com/milisims/tree-sitter-org',
      revision = 'main',
      files = {'src/parser.c', 'src/scanner.cc'},
    },
    filetype = 'org',
  }
  vim.cmd[[packadd nvim-treesitter]]
  vim.cmd[[TSUpdate]]

  require('orgmode').setup()
  require('nvim-treesitter.configs').setup({
  -- If TS highlights are not enabled at all, or disabled via `disable` prop, highlighting will fallback to default Vim syntax highlighting
  highlight = {
    enable = true,
    disable = {'org'}, -- Remove this to use TS highlighter for some of the highlights (Experimental)
    additional_vim_regex_highlighting = {'org'}, -- Required since TS highlighter doesn't support all syntax features (conceal)
  },
  ensure_installed = {'org'}, -- Or run :TSUpdate org

  })

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 PackerComplete ++once lua load_config()]]
else
  load_plugins()
  require('packer').sync()
  _G.load_config()
end

Screenshots and recordings

image

OS / Distro

Ubuntu 20.04

Neovim version/commit

0.6.0

Additional context

This bug can be fixed by adding @Spell to line 69 of orgmode/syntax/org_legacy.vim :

syntax match org_list_item /.*$/ contained contains=org_bold,org_italic,org_underline,org_code,org_verbatim,org_strike,@Spell

However, I am wondering if problem might not affect other syntax items. My thought was that line 68 of orgmode/syntax/org.vim would have set spelling check in the whole file by default.

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