Skip to content

Error collapsing heading after refreshing agenda #243

@schultzter

Description

@schultzter

Describe the bug

I get the error message attempt to index local 'file' (a nil value) when trying to collapse a TODO heading I have opened prior to refreshing (r) the agenda view.

I noticed this in :checkhealth but the missing file, highlights.scm, is there when I check in the directory (as well as injections.scm).

## The following errors have been detected:
  - ERROR: org(highlights): ...s\Neovim\share\nvim\runtime/lua/vim/treesitter/query.lua:161: query: error at position 672
    org(highlights) is concatenated from the following files:
    | [ERROR]:"C:\Users\redacted\AppData\Local\nvim-data\site\pack\paqs\start\orgmode\queries\org\highlights.scm", failed to load: ...s\Neovim\share\nvim\runtime/lua/vim/treesitter/query.lua:161: query: error at position 672

...

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 13
  - OK: Loaded parser for org: ABI version 13
  - OK: Loaded parser for c: ABI version 13

Steps to reproduce

  1. open an org file
  2. expand at least one TODO headline
  3. view the agenda
  4. refresh the agenda
  5. attempt to collapse the TODO headline previously expanded
  6. expand any other TODO headline
  7. attempt to collapse those TODO headlines

Expected behavior

Headlines will collapse without error.

Emacs functionality

It works!

Minimal init.lua

-- Load custom tree-sitter grammar for org filetyp
require('orgmode').setup_ts_grammar()

-- Tree-sitter configuration
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
}

require('orgmode').setup({
org_agenda_files = 'C:/Users/redact/Documents/Notebooks/*',
org_default_notes_file = 'C:/Users/redact/Documents/Notebooks/refile.org',
org_todo_keywords = {'TODO', 'INPROGRESS', 'WAITING','DONE'}
})

Screenshots and recordings

image

OS / Distro

Windows 10

Neovim version/commit

0.6.1

Additional context

My home directory, ~, is different when working from home (local c:\users\redacted) vs at the office (network mounted m:)

Metadata

Metadata

Assignees

No one assigned

    Labels

    WindowsWindows OS issuebugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions