nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3.04k stars 134 forks source link

[orgmode] vim/shared.lua:0: The reverse lookup found an existing value for "" while processing key "5" #569

Closed mcepl closed 1 year ago

mcepl commented 1 year ago

Describe the bug

When I run org_mappings.todo_next_state (<Leader>cit) I get the error message in the title of this issue.

Using neovim-0.9.0+git.1685321092.9dd48f783-6.1.x86_64 (build from https://github.com/neovim/neovim/commit/9dd48f7832f4656af4a2579368641268bb6399e7), the latest nvim-orgmode (https://github.com/nvim-orgmode/orgmode/commit/7d4a3ffe9f766db7eab4c98610078f62f83965df), and I also have enabled my own plugin (https://git.sr.ht/~mcepl/editorconfig-orgmode.nvim).

Steps to reproduce

  1. Open .org file,
  2. move cursor on some TODO headline
  3. press <Leader>cit

Expected behavior

status of the line shifts one event ahead

Emacs functionality

error message, no change in the status of the keyword.

Minimal init.lua


-- Enter your minimal_init.lua here

Screenshots and recordings

No response

OS / Distro

openSUSE/Tumbleweed

Neovim version/commit

9dd48f7832f4656af4a2579368641268bb6399e7

Additional context

No response

jgollenz commented 1 year ago

Can you please first check if the error persists if you use the minimal_init.lua? Thanks

mcepl commented 1 year ago

Yup, I can safely reproduce just with this diff:

tumbleweed-pkg~/.l/s/n/s/p/p/s/o/scripts (master *)$ git diff
diff --git a/scripts/minimal_init.lua b/scripts/minimal_init.lua
index 0a54069..b963165 100644
--- a/scripts/minimal_init.lua
+++ b/scripts/minimal_init.lua
@@ -10,6 +10,7 @@ local function load_plugins()
       'wbthomason/packer.nvim',
       { 'nvim-treesitter/nvim-treesitter' },
       { 'kristijanhusak/orgmode.nvim', branch = 'master' },
+      {'https://git.sr.ht/~mcepl/editorconfig-orgmode.nvim'},
     },
     config = {
       package_root = package_root,
tumbleweed-pkg~/.l/s/n/s/p/p/s/o/scripts (master *)$ 
kristijanhusak commented 1 year ago

If it doesn't happen without that diff then it's an issue in that plugin.

mcepl commented 1 year ago

Do you see anything wrong with this piece of code (that’s really all it is in the plugin)?

    if #keywords > 1 then
        local Config = require("orgmode.config")
        Config:extend({
            org_todo_keywords = keywords,
        })
        require("orgmode.colors.todo_highlighter").add_todo_keyword_highlights()
    end

I cannot find any real documentation to this function (it all comes from https://github.com/nvim-orgmode/orgmode/issues/486).

kristijanhusak commented 1 year ago

From the error I would assume that some of the keywords are empty strings. Can you debug and check?

mcepl commented 1 year ago

https://git.sr.ht/~mcepl/editorconfig-orgmode.nvim/commit/48b6fb01f49a

Thank you for your patience.

BTW, could this plugin be added to the list of orgMode plugins?